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

Internationalization i18n #15

Open
leocaseiro opened this issue Sep 10, 2016 · 1 comment
Open

Internationalization i18n #15

leocaseiro opened this issue Sep 10, 2016 · 1 comment

Comments

@leocaseiro
Copy link
Owner

Implement translations with .mo

@ghost
Copy link

ghost commented Sep 11, 2016

hello @leocaseiro , COP already has two languages, english and portuguese, the translation process is very easy, all you need to do is download poedit, create a .mo file for whatever language you want to translate to(e. g. if someone want to translate it to korean, it would interesting save as ko_KR that is the locale of that country, here a list of references). The rest, you need to fill the plugin using __ functions with the string in english and the name of plugin like __('hello world', PLUGIN_NAME); (maybe you need to configure the file to read __ functions), next step is update the file, poedit will get all strings and list to you, so you will translate it to your idiom, when you finish, save the file. To change the language, i implemented a conditional that checks the lang of html tag and load the correct language. Other important thing, translate always ENGLISH to the language you desire, i had a lot of pain trying to translate portuguese to english in other projects because of utf8 characters until notice the logic is reverse :)

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

1 participant