Difference between revisions of "How to edit the JReviews language files"
Line 5: | Line 5: | ||
There's a folder for each language. You can modify the default.po file for your language or copy one of the 3-letter word language folders and rename it for your language. Then edit the default.po file. | There's a folder for each language. You can modify the default.po file for your language or copy one of the 3-letter word language folders and rename it for your language. Then edit the default.po file. | ||
− | When translating or changing the .po file it is very important to keep the character encoding of the file. For this you need to use a special editor like | + | When translating or changing the .po file it is very important to keep the character encoding of the file. For this you need to use a special editor like Notepad++ or Poedit. Both are free applications. |
When changing the file it is only necessary to change the msgstr, changing the msgid will not work. For example: | When changing the file it is only necessary to change the msgstr, changing the msgid will not work. For example: | ||
Line 15: | Line 15: | ||
msgstr "Submit" | msgstr "Submit" | ||
</source> | </source> | ||
+ | |||
Would be changed like this for a spanish translation: | Would be changed like this for a spanish translation: | ||
Line 24: | Line 25: | ||
msgstr "Enviar" | msgstr "Enviar" | ||
</source> | </source> | ||
+ | |||
The msgid serves as the lookup reference from the .thtml theme files where you'll find it in this format: | The msgid serves as the lookup reference from the .thtml theme files where you'll find it in this format: | ||
Line 30: | Line 32: | ||
__t("Submit"); | __t("Submit"); | ||
</source> | </source> | ||
+ | |||
There is no need to change the theme .thtml files for translation, but if you do change the references in the __t("text"); format, then those will not be translatable via the language file unless you add a new reference to them there: | There is no need to change the theme .thtml files for translation, but if you do change the references in the __t("text"); format, then those will not be translatable via the language file unless you add a new reference to them there: | ||
Line 37: | Line 40: | ||
'''After making changes to a language file you must clear the cache in JReviews''' using the "Clear cache" link in the JReviews administration. You need to do this even if caching is disabled in JReviews. | '''After making changes to a language file you must clear the cache in JReviews''' using the "Clear cache" link in the JReviews administration. You need to do this even if caching is disabled in JReviews. | ||
+ | |||
+ | |||
[[Category:JReviews]] | [[Category:JReviews]] |
Revision as of 11:57, 20 August 2010
JReviews uses language files for all the text that is used in the themes. To change the text or translate it to a different language you need to edit the files in:
- /components/com_jreviews/jreviews/locale/
There's a folder for each language. You can modify the default.po file for your language or copy one of the 3-letter word language folders and rename it for your language. Then edit the default.po file.
When translating or changing the .po file it is very important to keep the character encoding of the file. For this you need to use a special editor like Notepad++ or Poedit. Both are free applications.
When changing the file it is only necessary to change the msgstr, changing the msgid will not work. For example:
#: jreviews\views/helpers/custom_fields.php:312 #: jreviews\views/helpers/custom_fields.php:462 msgid "Submit" msgstr "Submit"
Would be changed like this for a spanish translation:
#: jreviews\views/helpers/custom_fields.php:312 #: jreviews\views/helpers/custom_fields.php:462 msgid "Submit" msgstr "Enviar"
The msgid serves as the lookup reference from the .thtml theme files where you'll find it in this format:
__t("Submit");
There is no need to change the theme .thtml files for translation, but if you do change the references in the __t("text"); format, then those will not be translatable via the language file unless you add a new reference to them there:
msgid "text" msgstr "translated text"
After making changes to a language file you must clear the cache in JReviews using the "Clear cache" link in the JReviews administration. You need to do this even if caching is disabled in JReviews.