I have translated the GnuCash website to zh_CN.

Geert Janssens janssens-geert at telenet.be
Wed May 5 06:32:07 EDT 2010


On Sunday 2 May 2010, Tao Wang wrote:
> On Sun, May 2, 2010 at 9:00 AM, Geert Janssens
> 
> <janssens-geert at telenet.be> wrote:
> > On Saturday 1 May 2010, Tao Wang wrote:
> >> Hi,
> >>
> >> I have translated GnuCash website to zh_CN. Could you commit it?
> >
> > Hi Tao,
> >
> > I have added your translation to the website, but it doesn't seem to work
> > when I test it on my system. Does it work for you ?
> >
> > Perhaps one of the devs with access to the server logs could check if the
> > translations cause some error.
> 
> No, it doesn't work for me.
> 
> I check the info.php on the server, which contains a list of "locale
> -a". I found server doesn't support "zh_CN", I think this might be the
> problem.
> 
> For Japanese, the debug info on the first line is:
> <!-- ja_JP , locale_res [ja_JP] , dir_res /home/gnucash/www/gnucash -->
> But, for Chinese, it's:
> <!-- zh_CN , locale_res [] , dir_res /home/gnucash/www/gnucash -->
> which locale_res is empty.
> 
Linas has added this. The website shows in simplified Chinese for me now.

If you like, you can change the language in the header to use native glyphs 
(like Japanese does). This information is in externals/header.phtml

> >> And for website, since it's PHP-based website, Could you add a short
> >> code to automatically detect user's language? I think the information
> >> should contained in the users request. If the user language detected,
> >> and the language is available for the website, then just redirect user
> >> to their language automatically. Thanks.
> >
> > This is a useful idea. I may have a look at this later.
> >
> > Geert
> 
> I write a code to automatically detect user's language and assign
> $locale and $lang_dir

Thank you for this code. I will look at integrating it in the website sometime 
later.

<snip>
 
> And one more question, why not use parameter for different language?
> such as http://www.gnucash.org/index.phtml?lang=zh_CN. So that
> sub-directories for different languages is not necessary anymore. Only
> one set files is required.
> 
I never wrote the original code, but I can imagine some motivations:
* gettext requires a directory per language for the translations file, so the 
directory was there already to begin with
* when using a parameter to set the language instead of using directories, all 
the devs must remember to include it in each new link they add to the 
webpages. This can easily be forgotten
* setting up the directory is only required once per language. Of course, if 
completely new pages are added, this would require a link to be added in each 
language directory as well. But the website is fairly static, so this hasn't 
happened for quite some time.

> I also found the <meta> for charset is missing, the following line
> should put in <head>, and before <title></title>:
> 
> <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
> 
I have added this, thank you.

Geert


More information about the gnucash-devel mailing list