Topic: Problem with gettex.

In windows(Xampp) -
gettext_native - Work but all text no in rigth code. web-page in UTF-8, base utf-8. Text in ISO-8859-5. GetText in php on.
gettext_php_traslate - work fine and code is correct. But need OFF GetText in PHP.

LINUX(Ubuntu 8.04)
gettext is ok, I check with this script http://php.russofile.ru/resources/archives/0000/gettext_sample.zip. and is work.
In FrontAccounting not work. Need again turn off Gettext and ... .

AND how a change without OFF gettext

I am change function _('Test') in T_('Test').
in all files *.php and *.inc. '_(' in 'T_('  .

and change in frontaccount\includes\lang\gettext.php
line : 130 - 133. this TunON php_gettext ALLTIME
....
if (function_exists('gettext'))
            {
              //  return get_text::_support(new gettext_native_support());
                return get_text::_support(new gettext_php_support());
}
....

and change in frontaccount\includes\lang\language.php

if (!function_exists("_"))
{
    function T_($text)
       //function _($text)
    {
   
        $retVal = get_text::gettext($text);
        if ($retVal == "")
            return $text;
           
        return $retVal;
       
    }
}

//new function
function T_($text)
    {
   
        $retVal = get_text::gettext($text);
        if ($retVal == "")
            return $text;
           
        return $retVal;
       
    }
//new function

Re: Problem with gettex.

Hello straga,

I've just checked russian translation under Debian Linux and the translation works, although declarared  20% of translated messages is optimistic approximation.

To have any localization with gettext working  you have to install respective locales. As I see your test was done with utf-8 sample, but the translation file for FA use iso-8859-5 encoding, so it will not work until you make something like:
dpkg-reconfigure locales
and select right locale to install i.e. ru_RU iso-8859-5.
After apache restart you have some messages translated, but as I said not too much. If you wish to translate the rest you can send the results to us to share with other users.
Janusz

Above applies to Debian but also should work on its derivative Ubuntu.
Good luck.

Re: Problem with gettex.

One more monent. is fail for translate ru_RU.po a change encoding: UTF-8

I use: English, Latvia, Russian in one page. If encoding page UTF-8 not problemm. if each has its own encoding is problem. For me right local UTF-8.

FrontAccouting have php_translate it fine for me.

Re: Problem with gettex.

Well, you said that gettext does not work on Linux box. This is not the case. To use say russian translation under linux you must have both FA ru_RU translation file and system locales in the same encoding. So if you want to have russian user interface on linux box where you have only ru_RU.utf-8 locales you must recode messages file, or translate it from scratch. The ru_RU.po file in download section of frontaccounting.com is encoded in ISO-8859-5, not UTF-8.

Your method to replace all the gettext _() calls makes your system not upgradable. But if you wish, you can of course do it this way. I wanted to say this all is not needed to make FA work in Russian , Latvian, Farsi or any other language if you have messages translated.

Janusz

Re: Problem with gettex.

Linux have ru_RU,  ru_RU.utf8. A have interface Latvian, Russian, English but information in database Latvian, some Russian and english.

I am understante, what way replace gettext_() not so good. But for it work fine. if need upgate, i can againt raplate all _() in all file it quickle  and go work.