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

Cannot get data-i18n to work #212

Open
FabienCharlet opened this issue Apr 6, 2020 · 0 comments
Open

Cannot get data-i18n to work #212

FabienCharlet opened this issue Apr 6, 2020 · 0 comments

Comments

@FabienCharlet
Copy link

Hello !

Thanks for your work and your great library :)

I'm not an experienced Javascript developer and I'm having trouble having basic features to work ...
I'm probably missing something ;)

First, I've cloned the repository, edited the index.html file and add at the first line after <div class="container"> :

Test : <p data-i18n="one"></p>

This result to : Test : .

But, after reading the doc, I would think that, as the page contains <html lang="en" dir="ltr"> , I would see Test : ONE because demo-en.json contains "one": "ONE".

The rest of the page works when I change the value in the dropdown. So I think I have misunderstood something.

I tested another thing and I have an unexpected behavior too.

I edited the demo.js file and at the end of the last function I added :

$.i18n().load( 'i18n/demo-he.json', 'he')
	
$.i18n({
	    locale: 'he' // Locale is Hebrew
});
	
alert($.i18n( 'one' ));

Once again, regarding to the doc, I would expect to view the translation of 'one' which is in the demo-he.json file. But I only see one. Whatever the message I search I always have the key displayed and not the value.

Am I missing something ?

Thanks in advance for your time 👍

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