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

Localize this extension to other languages and regions #12

Open
ceilican opened this issue Feb 11, 2015 · 10 comments
Open

Localize this extension to other languages and regions #12

ceilican opened this issue Feb 11, 2015 · 10 comments

Comments

@ceilican
Copy link
Contributor

Add translations of the description of this extension here:
https://github.com/OiWorld/CarbonFootprintGoogleMaps/blob/master/Description.md

@ceilican ceilican changed the title Localize this extension to your own native language and region Localize this extension to other languages and regions Feb 11, 2015
@rohankatyal29
Copy link
Contributor

@ceilican: Are you expecting something like this:

screen shot 2016-03-03 at 1 48 30 pm

A select menu to chose the language

@ceilican
Copy link
Contributor Author

ceilican commented Mar 3, 2016

Not exactly. Ideally, the app should detect the user's language automatically. This should be feasible with use Google's localization features. In particular, I was thinking of this: https://developer.chrome.com/webstore/i18n

Another app of mine that has been partially localized is Mind The Word (see also https://github.com/OiWorld/MindTheWord/tree/master/Source/_locales and https://github.com/OiWorld/MindTheWord/blob/master/Description.md). However, even there I haven't been able to localize the texts that appear in the options page. I was only able to localize the texts that appear in the Chrome Web Store. Google's instructions don't say how to use localized messages inside the app itself, and I haven't had time to research how to do that yet. If you could find that out, that would be great.

@rohankatyal29
Copy link
Contributor

I have figured out a solution for this. But I am not being able to test it. I changed my chrome's locale using chrome://setting/languages and the used var language = window.navigator.userLanguage || window.navigator.language; to check my current locale, but it still shows en-US. I am not being able to change the accept language. I even tried with a chrome extension which changes the locale of browser with no luck. Do you know of any reliable way to change and test the locale of the browser?

@ceilican
Copy link
Contributor Author

ceilican commented Mar 8, 2016

No, unfortunately I don't know yet how to detect the user's language.

What you described seems to be a bug in Chrome. Maybe it would be worth it to send a bug report to Chrome's developers.

@rohankatyal29
Copy link
Contributor

I will send a bug report to Chrome's developers and wait for their response

@share-with-me
Copy link

@rohankatyal29 I used navigator.userLanguage , navigator.browserLanguage , navigator.systemLanguage and managed to get the same output en-US . However, when I tried to change my browser default language to some other language, it still outputs en-US. Is it the same thing that you have tried? Also any updates from chrome bug issue?
Edit:
I tried to change the language settings from control panel and the userLanguage now outputs the language I changed to, but browserLanguage still outputs the same en-US .
@ceilican any way to go about these that you can suggest with?!

@rohankatyal29
Copy link
Contributor

@share-with-me: I have tried doing that plus a couple of things more with no success. Don't have any updates about the bug yet

@PrateekGupta1509
Copy link
Collaborator

I have implemented this in my pull request #33 , added support for Hindi language. To add support for other languages would need their respective translations.

To add support for your language the procedure that needs to be followed is given below:

To Add another language:

- create a messages.json in _locales/[language_code]/ directory
- use the key set mentioned in any of the pre-existing messages.json file for en / hi
- description is optional and is not displayed

To get language-code for your language: https://developer.chrome.com/webstore/i18n

To test: (use hi as language-code for Hindi)

On Linux : LANGUAGE=<language-code> google-chrome

For windows and Mac OS X : visit [https://developer.chrome.com/extensions/i18n#testing-win](https://developer.chrome.com/extensions/i18n#testing-win)

ceilican added a commit that referenced this issue Mar 11, 2016
Issue #12 Localize this extension to other languages and regions
@ceilican
Copy link
Contributor Author

Thank you, @PrateekGupta1509 ! I will keep this issue open, in case other people would like to contribute other languages.

ashutoshsaboo added a commit to ashutoshsaboo/CarbonFootprintGoogleMaps that referenced this issue Mar 15, 2016
ceilican added a commit that referenced this issue Mar 19, 2016
Adds French Translation, as requested in Issue #12
@AnandKumar22
Copy link

@ceilican I have added the Portugal Translation, please have a look at it.

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

5 participants