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

How to best deal with translations in subfolders #7

Open
chilio opened this issue Aug 4, 2018 · 3 comments
Open

How to best deal with translations in subfolders #7

chilio opened this issue Aug 4, 2018 · 3 comments

Comments

@chilio
Copy link

chilio commented Aug 4, 2018

Here is what I do:
'en.auth-message': require('../../../resources/lang/en/auth/message.php'),and thenlang.get('auth-message.translation')which works. However doing this:en.auth/message': require('../../../resources/lang/en/auth/message.php'),and thenlang.get('auth/message.translation') or laravel conventionlang.get('auth.message.translation')` does not translate
Any indeas on how to best deal with this?

@mojtabaRKS
Copy link

mojtabaRKS commented Oct 22, 2019

same issue :(((

i have 'en.front.addresses': require('../../../../lang/en/front/addresses.php')

and lang.get('front.addresses.delete.buttons.cancel'),

@mojtabaRKS
Copy link

mojtabaRKS commented Oct 22, 2019

after 2 hours problem solved !

i made my messages.js like this :
'en.front.addresses': require('../../../../lang/en/front/addresses.php'),

and in my code lang.get('front/addresses.delete.buttons.cancel'),

this is working like laravel localization !
i think this case should added to documentation like below :

subfolder :

in message.js
'{locale}.{subfolder}.{file}': require('../../../../lang/{locale}/{subfolder}/{file}.php')

and in your code :
lang.get('{subfolder}/{file}.foo.bar'),
same for more sub folders :
lang.get('{subfolder1}/{subfolder2}/{subfolder3}/.../{file}.foo.bar'),

@chilio @rmariuzzo

@rmariuzzo
Copy link
Owner

rmariuzzo commented Oct 22, 2019 via email

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

3 participants