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

Example-Forum latest build, VulcanJS 1.12.8, new way of handling localization ? #94

Open
adalidda opened this issue Sep 25, 2018 · 4 comments

Comments

@adalidda
Copy link

Hi,
In the previous version of Example-Forum/Vulcan (based on meteor 1.6), I have 2 files for the text used in my app:
i18n-en.js = english
i18n-fr.js = french

then I import these files in my index.js as below:
import './i18n-en.js';
import './i18n-fr.js';

then in my settings.json
for English, I use
"locale": "en",
for French, I use
"locale": "fr",

Using above seems not working anymore in the latest version of Example-Forum latest build + VulcanJS 1.12.8, my App doesn't show text in French even if my settings.json use "fr" (still show English).

Seeing this, I check the package vulcan-i18n-fr-fr then I see that the localization file is add on the package.js, like below:
api.addFiles([
'lib/fr_FR.js'
], ['client', 'server']);

Could you confirm that this is the new way of handling localize file in VulcanJS ?

Thank You
Adalidda

@Apollinaire
Copy link
Member

Apollinaire commented Sep 25, 2018

Hi @adalidda ,
The I18n in Vulcan was updated at v1.11. You can see the docs here : http://docs.vulcanjs.org/internationalization.html

Seeing this, I check the package vulcan-i18n-fr-fr then I see that the localization file is add on the package.js, like below:

'lib/fr_FR.js'
], ['client', 'server']);

This won't help, it's just importing the files in the module, which your other files are already (through a longer pipeline though)

I don't know myself how to deal with this. It seems that the language is based on the client's locale now, so basically if your browser is not set to French the language will fallback to English by default. The docs probably provide something to handle this, but I have not had time to look into that yet

@adalidda
Copy link
Author

Thank You @Apollinaire I will look to the doc in detail.

@adalidda
Copy link
Author

After I set the cookies as following:
cookies.set('locale', 'fr');

Everything is working fine and my App is now displaying the text in French.

Thank You @Apollinaire

@Apollinaire
Copy link
Member

@adalidda could you describe more in detail what you did ?

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