Member
Member
fanda   17-06-2010, 23:39
#1

I found zenphoto is mixing gettexts domains during run script, when theme has its own lc_messagess/domain. If there is no solution for this, this can be the solution (usable also for plugins etc):

New custom function for getting string from another than standard (zenphoto) domain. Something like
`
gettextd($string, $domain) {

  1. set $domain as domain
  2. get string
  3. set back default/previous domain
    }
    `
    _() function is nice helper. :-)
Administrator
Administrator
acrylian   18-06-2010, 08:34
#2

Yes, theme and plugin translations do not exactly work now. We had postponed that until we got an idea. Seems you had that now. This seems like an interessting and simple idea for this issue. Thanks, we will experiment with that.

btw, we did not use the short term _() because it is too easy to overread and search for in source code.

Member
Member
fanda   11-08-2010, 09:57
#3

I am using this and works well:
function gettext_th($string, $domain) { setupCurrentLocale(NULL,$domain,"theme"); $output = gettext($string); setMainDomain(); return $output; }
I add it into functions-i18n.php file.

Administrator
Administrator
acrylian   11-08-2010, 10:10
#4

We will try that. I assume you have configured Poedit or similar differently to note the gettext_th as well.

Member
Member
fanda   05-10-2010, 12:57
#5

Yes, of course. 'gettext_th' is added into keywords field in catalog settings.

In .po it looks like:
"X-Poedit-KeywordsList: gettext_th\n"

Administrator
Administrator
acrylian   05-10-2010, 13:05
#6

Thanks, meanwhile it is already implemented with a few minor modifications in the svn/nightly builds, separately for themes and plugins. In case you are interessted, Info about that already on the translation tutorial.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.