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

Create internationalization (i18n) translations #25

Closed
daltondiaz opened this issue Jan 29, 2019 · 7 comments
Closed

Create internationalization (i18n) translations #25

daltondiaz opened this issue Jan 29, 2019 · 7 comments

Comments

@daltondiaz
Copy link

Create i18n feature for future translations.

@myliang
Copy link
Owner

myliang commented Jan 30, 2019

I haven’t thought about how to do it yet.

@xam4lor
Copy link

xam4lor commented Feb 2, 2019

How about creating a folder with some files in it. When the user "load" the code on the index.html file, he passes a parameter called 'language' (default EN), and the code just load the corresponding file.

@xam4lor
Copy link

xam4lor commented Feb 2, 2019

For example like the following structure :

In 'index.html' :

[...]
.loadData({
  language : 'EN'
})
[...]

And the code just check the file in src/language/EN.json and load it into a global constant object like 'LANGUAGE'.
To get a text, we just need to do a LANGUAGE.get(_id) to get the corresponding string.

@xam4lor
Copy link

xam4lor commented Feb 2, 2019

Check my modification test.

@daltondiaz
Copy link
Author

Check my modification test.

Its ok for me!

Create a PR!!

@xam4lor
Copy link

xam4lor commented Feb 6, 2019

Done! Check #48.

myliang referenced this issue Feb 28, 2019
@myliang myliang closed this as completed Mar 1, 2019
@myliang
Copy link
Owner

myliang commented Mar 2, 2019

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