asterisk2billing.org
http://forum.asterisk2billing.org/

translation (gettext) not working on help.php file
http://forum.asterisk2billing.org/viewtopic.php?f=19&t=1927
Page 1 of 1

Author:  langenjo [ Thu Apr 05, 2007 9:32 pm ]
Post subject:  translation (gettext) not working on help.php file

Hi,

I'm trying to translate/modify the Customer Interface to German - all works fine besides the translations, that refer to the content of the lib/help.php file.

There is also another post with a similar problem, but no solution.

Any ideas?

Jo

Author:  svetur [ Fri Apr 06, 2007 3:07 am ]
Post subject: 

Hi i modified my customer interface, but i just deleted help info. Well, the translation is listed in messages.po file so it should be translated, unless the line number in help.php and messages.po doesn't match. It takes a lot of tweaking to make a descent translation.

Author:  xrg [ Fri Apr 06, 2007 7:47 am ]
Post subject: 

Not only that:
1. gettext is a binary function, called by apache and caching the results. This means, apache may never serve the new texts unless *restarted*. (In fact, you may encounter 50% the german text and 50% the untranslated. This happens because apache may have many processes runing, half of them being spawn after the translation.)

2. The .po file is not itself used. You must compile it to a .mo (binary) one. See 'msgfmt'.

3. Lines must match, entries cannot have the 'fuzzy' bit set. Of course.

4. There are some exceptions in a2b where language setting is actually ignored. A2b follows the set language only for php scripts that call the 'module-access' one. For example, the login form itself would never be translated.

Author:  langenjo [ Fri Apr 06, 2007 10:46 am ]
Post subject: 

Thanks for your reply, but this doesn't help,
xrg wrote:
Not only that:
1. gettext is a binary function, called by apache and caching the results. This means, apache may never serve the new texts unless *restarted*. (In fact, you may encounter 50% the german text and 50% the untranslated. This happens because apache may have many processes runing, half of them being spawn after the translation.)

I allways restart apache after any changes in the .po file
xrg wrote:
2. The .po file is not itself used. You must compile it to a .mo (binary) one. See 'msgfmt'.

Yes - I allways create a new .mo file using msgfmt
xrg wrote:
3. Lines must match, entries cannot have the 'fuzzy' bit set. Of course.

I don't know, what the "fuzzy" bit is, but the lines do match exactly.
xrg wrote:
4. There are some exceptions in a2b where language setting is actually ignored. A2b follows the set language only for php scripts that call the 'module-access' one. For example, the login form itself would never be translated.

I'm not sure, if this might be the solution, as everything else works fine - exept for the lib/help.php file. Every! other file gets translated correctly and I just cannot see the difference, that comes with the help.php file.

Any other ideas?

Regards,
Jo

Author:  xrg [ Fri Apr 06, 2007 11:12 am ]
Post subject: 

Got it:
look at defines.php: "lib/help.php" is included *before* the language is set.
It may not be that trivial to move the "lib/help.php" after the language. We must check that further..

Author:  langenjo [ Fri Apr 06, 2007 11:32 am ]
Post subject: 

xrg wrote:
Got it:
look at defines.php: "lib/help.php" is included *before* the language is set.
It may not be that trivial to move the "lib/help.php" after the language. We must check that further..


Perfect! That's it!

Thanks a lot.
Jo

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/