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

Import translations into seperate files #50

Open
fabiulous opened this issue Aug 29, 2017 · 3 comments
Open

Import translations into seperate files #50

fabiulous opened this issue Aug 29, 2017 · 3 comments

Comments

@fabiulous
Copy link
Contributor

Is there a possibility to import translations into seperate files like fr.json, es.json, it.json and so on, instead of importing everything into translations.js?

This would allow using Async translations easily

@francescarpi
Copy link
Member

Hi,
is not possible now, but I'll consider it in the next develop.

Or you can send me a pull request ;).

Thx

@fabiulous
Copy link
Contributor Author

Sure, I was playing around with it to try and accomplish it, but I got into some questions.
If I import this into separate .js files, how would I fetch these files on demand? Point is, I don't want to bundle 1mb of translations.
If instead I turn it into a .json file, then I can just have them in a public folder and just fetch it when needed, but it will be a bit weird that one options imports into .js and the other to .json

What do you think of this?

@stayman
Copy link
Contributor

stayman commented Sep 11, 2017

@shizpi, we generally get around this problem by sending back only a portion of the js file at our server layer by reading the accept-language header of the request.

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

No branches or pull requests

3 participants