![]() |
|
Theme localization - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Translating (https://forum.zenphoto.org/forum-8.html) +--- Thread: Theme localization (/thread-12762.html) |
Theme localization - PaulBuhtab - 24-06-2015 Greetings! I’ve been trying to turn “Libratus” theme into multilingual one. Theme localization - acrylian - 24-06-2015 The problem is that Libratus is simply not setup for theme based translation. http://www.zenphoto.org/news/translating-tutorial#plugin-and-themetranslations Theme localization - PaulBuhtab - 24-06-2015 So do I have to replace every instance of "gettext("some text");" with "gettext_th("some text","");" to have a mulilingual theme with a separate translation file? And ngettext with ngettext_th, right? Will try. Alternatively, I could include those string into main zenphoto.po file. But it will mix everything up. Theme localization - acrylian - 24-06-2015 Yes, correct. Theme localization - PaulBuhtab - 30-06-2015 It worked. Thanks! The theme I'm trying to improve uses single quotes (') to enclose textstring and module names (i.e.gettext('some text'); OR include('inc-footer.php');). Theme localization - acrylian - 30-06-2015 For gettext it should not matter if single or double quotes. Gettext text is not parsed like an Except here you are right that single quotes are preferable generally. Theme localization - PaulBuhtab - 14-07-2015 The translation worked fine for single language localized site. But a problem is that I can’t switch back to English if I try to implement a multilingual site (with a language switch). zp-core strings are translated as they should when I switch site language from the front end, but the theme strings remain translated regardless of user selected language, default site language, HTTP_Accept_Language option. My code is updated on github (see first post for link). The translation itself isn’t completed, yet. Theme localization - acrylian - 14-07-2015 Works for me generally besides that not all strings are gettexted apparently. Also there is a typo on album.php line 114 ( But please try the support build as there was just an issue discovered with the language selector that broke the English flag. Theme localization - PaulBuhtab - 26-08-2015 After switching language options back and forth everthing works fine. But it seems "gettext" and "gettext_th" may not behave synchronous in come cases. Maybe some combination of hosting setting is the cause. Theme localization - acrylian - 26-08-2015 Do you have an example? Are really all theme strings covered in the theme translation file? Theme localization - PaulBuhtab - 27-08-2015 Here is an example (an empty one): http://2fd6db98ea.url-de-test.ws/ I missed "ngetexted" strings, because was not sure of "ngetext_th" syntax and even existence. Don't guarantee but suppose that all instances of "getext" replaced. When able I'll update github repository. And I'm almost ready to submit core translation for Russian lang for v 1.4.9. Theme localization - acrylian - 27-08-2015 As far as I can see on that site all is properly translated and is kept that way when I switch between English and Russian. Syntax of ngettext() is explained here: Setting up Poedit is quite easy, you just have to add the gettext_th/gettext_pl calls to the catalog settings under additionall keywords (not sure how it is named right now as my Poedit is in German). You cannot disable the normal gettext calls, only add additional ones if I understand right. A Russian core translation will be very welcome. If you submit set the internal version to the next version (so in this case 1.4.10). Theme localization - PaulBuhtab - 27-08-2015 Glad that proper functioning is confirmed so far. Tested it different browsers - seems OK. Theme localization - acrylian - 27-08-2015 [quote]Maybe both “gettext” and “gettext_th” versions should exist separately. Theme localization - PaulBuhtab - 28-08-2015 I wanted to say that generally there are two ways of localizing site running zenphoto. The first and the default way is translating zp_core, with the third party theme path included into zenphoto.po project. The second way seems more preferable for me, but others may have their own reasons. Theme localization - acrylian - 28-08-2015 Ok, actually the second way is the preferred way for every third party plugin or theme and it is that way noted on our translation tutorial. Third party string should not be in a core translation. |