04-03-2013, 01:15 AM,
|
|
tomglare
Member
 
|
Posts: 31
Threads: 13
Joined: Feb 2012
|
|
Setting up new language
I am trying to set up new language(s) for use with the gettext() calls. These are not "real" languages, but rather customised variations to cater for the
jargon used in different types of business for the same thing. Have done a quick test, editing an existing .po file, then running "msgfmt -o messages.mo messages.po" to check I understand this part of the operation, then I created a new "en_XX/LC_MESSAGES" directory, copied messages.po there and compiled it. I also added a new stanza to LanguagesArray.php and checked I can change the user language; however it seems to ignore the new .mo file.
Is what I am trying to do feasible, and if so, where I am I going wrong?
|
|
04-03-2013, 07:30 PM,
|
|
tomglare
Member
 
|
Posts: 31
Threads: 13
Joined: Feb 2012
|
|
RE: Setting up new language
Thanks for that. Yes, it does appear that the language needs to be defined at the operating system level (/usr/share/locale) even if the translation strings actually come from the WebERP files. I "borrowed" en_NZ from /usr/share/locale, which did not already have a matching WebERP directory, and once I had created the WebERP directory the text translation worked. So it looks like I just need to work out how to add a new language at the operating system level and I can then do it properly.
|
|
04-03-2013, 10:44 PM,
|
|
tomglare
Member
 
|
Posts: 31
Threads: 13
Joined: Feb 2012
|
|
RE: Setting up new language
You may also have to restart Apache after making any changes - I found this after a very frustrating couple of hours!!
|
|
04-04-2013, 12:44 AM,
|
|
tomglare
Member
 
|
Posts: 31
Threads: 13
Joined: Feb 2012
|
|
RE: Setting up new language
So now I am back to creating a new linux locale, at which point I am stuck. I have seen the command locale-gen mentioned, but this does not seem to be available for Centos (and we are fairly strict on installing only packaged software on the server). Does localedef do the same thing, and does anyone know what the arguments would be? I presume I just need effectively a copy of the en_GB.utf8 locale.
|
|
04-04-2013, 01:51 AM,
(This post was last modified: 04-04-2013, 06:58 AM by phil.)
|
|
RE: Setting up new language
(04-04-2013, 12:44 AM)tomglare Wrote: So now I am back to creating a new linux locale, at which point I am stuck. I have seen the command locale-gen mentioned, but this does not seem to be available for Centos (and we are fairly strict on installing only packaged software on the server). Does localedef do the same thing, and does anyone know what the arguments would be? I presume I just need effectively a copy of the en_GB.utf8 locale.
There is a good example here of an en_XX locale:
http://xyne.archlinux.ca/projects/locale...en_xxposix
Its not very clear where the code is to be found, but it's here:
http://xyne.archlinux.ca/projects/locale-en_xx/src/
Hope this helps
Tim
|
|
04-04-2013, 11:20 PM,
|
|
tomglare
Member
 
|
Posts: 31
Threads: 13
Joined: Feb 2012
|
|
RE: Setting up new language
Finally cracked it!! The documentation on localedef is woefully inconsistent, and the location of the relevant directories is very confusing (charmaps live in one place, the charset-independent locale definitions in another, and the binary files, resulting from compiling the above two, live in a third. Plus, depending on the syntax you use, you can end up with either a single archive containing all the locales, or several separate files for each locale. And the usr/share/locale directory is nothing to do this process - instead it is a repository for application-specific translation files).
Anyway, much hair-tearing later, it transpires that all you need (on Centos at least) is the command :
localedef -cvi en_GB -f UTF-8 en_YL.utf8
to create a customised locale which matches the en_YL.utf8 locale set up in the webERP system. It all now works!!
|
|
11-18-2013, 05:51 PM,
|
|
Folies2013
Member
 
|
Posts: 19
Threads: 10
Joined: Nov 2013
|
|
RE: Setting up new language
when I try to select another language like German it still show English.
I checked in the webERP/locale/de_DE.utf8/LC_MESSAGES German language is there.
But when I checked in weberp/languages only english is there.
How can i ADD IT ?
|
|
|