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 load multiple json files in a .html file? #232

Open
Bojan996 opened this issue Sep 24, 2021 · 1 comment
Open

How to load multiple json files in a .html file? #232

Bojan996 opened this issue Sep 24, 2021 · 1 comment

Comments

@Bojan996
Copy link

So i thought making separate translation files for each .js file that i have cause they are very big. So in my html page my code looks like this:

<script > $.i18n().locale = 'en'; $.i18n().load( ["i18n/access.json", "i18n/example.json", "i18n/index.json"] ).done( () => $('[data-i18n]').i18n() ); </script>

Obviously this array import method does not work, so how can i do this?

Also while im here, is there a more effective way of getting the html tags translate tan the method in the .done block?

Thanks

@Bojan996
Copy link
Author

Bojan996 commented Sep 24, 2021

I have found kind of a solution if someone has the same issue. It works well but i have a feeling that this can be done a lot easier. So in the script tag the code is:

image

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

No branches or pull requests

1 participant