Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dot notation not supported #18

Closed
vjandrea opened this issue Jan 6, 2016 · 6 comments
Closed

Dot notation not supported #18

vjandrea opened this issue Jan 6, 2016 · 6 comments

Comments

@vjandrea
Copy link

vjandrea commented Jan 6, 2016

If i have

'product' => 'Product',
'product.name' => 'Name',
'product.price' => 'Price',

after localization:missing i'll get

'product' => array(
    'name' => 'Name',
    'price' => 'Price',
),

As you can see the first keyword is lost. Would it be possible to support dot notation, maybe through an option?

@potsky
Copy link
Owner

potsky commented Jan 6, 2016

Hello,

you cannot use dots in lemma tokens!

localization:missing will parse your code and generate :

  • trans('product.name') to 'product' => array( 'name' => 'product.name' )
  • trans('productname') to 'productname' => 'product.name'

I could add an option to unsupport dot notation and keep translations in a flat mode. Is this really what you want?

@vjandrea
Copy link
Author

vjandrea commented Jan 6, 2016

I think i missed the Laravel documentation part about the dots, i looked now but there's no mention about it.
I use dots just because IMHO it looks cleaner: {{ trans('frontend.product.name') }}
It would be great to have an option that keeps translations in a flat mode. Thanks!

@potsky
Copy link
Owner

potsky commented Jan 6, 2016

And I think I missed the Laravel documentation part about flat lemma !

I am totally rewritting the extension to support all laravel version, add automatic translations with Bing Translator, add output formatting options (PSR0, 2, etc...) so I will add this option in the next release.

For the end of the month I hope...

@potsky
Copy link
Owner

potsky commented Jan 16, 2016

Hi !

The new version with your feature is ready. I have totally rewritten the package and added new features like automatic translations with Bing Translator, code style for lang files, etc... Do you want to test it before going on production?

@potsky
Copy link
Owner

potsky commented Jan 19, 2016

Ok, the new version is released.

You need to change your composer version and set the correct package version according to your laravel version.

@potsky potsky closed this as completed Jan 19, 2016
@vjandrea
Copy link
Author

Sorry @potsky 'been quite busy lately. I'll test it ASAP, thanks for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants