locale setting in xml file 1.5

A place to discuss Joomla! translation matters.

Moderator: wendhausen

Locked
User avatar
vancanneyt
Joomla! Ace
Joomla! Ace
Posts: 1098
Joined: Fri Aug 19, 2005 9:30 pm
Location: Buiten de wereld
Contact:

locale setting in xml file 1.5

Post by vancanneyt » Thu Dec 08, 2005 11:20 am

hello,

i am the dutch translator of the official dutch translation team and i've got a little question about the added locale tag in the xml file, when i look into the english xml file there are a bunch of locale settings, how do we know what tha locale settings could be for example the dutch language, is there any information about it?

best regards,
Sava
Last edited by davidgal on Sun Aug 13, 2006 8:07 pm, edited 1 time in total.
Member of the Dutch (nl-NL) translation team - http://joomla.taalbestand.nl - http://joomlacode.org/gf/project/nederlands/

User avatar
davidgal
Joomla! Guru
Joomla! Guru
Posts: 963
Joined: Sat Aug 20, 2005 9:19 am
Location: Israel
Contact:

Re: locale setting in xml file 1.1

Post by davidgal » Thu Dec 08, 2005 12:34 pm

A good place to start looking for the codes and understanding the standard is at http://www.w3.org/International/articles/language-tags/ or http://il2.php.net/setlocale where links to MS specific codes can be found at the end of the page

Some important things to know:

- The locale code can have between one and three elements as follows: [lang]_[country].[encoding]. The [lang] part is defined by iso 691-1 or iso 639-2 and has two or three characters. The [country] part is normally two capital letters and is defined by iso 3166. The [encoding] part can be 'utf-8', 'iso-8859-1' etc.

- Joomla gets time and date from the OS. The locale tag is used by a setlocale() function to let the OS know what language and in what form and in which encoding the date/time should be returned to the application.

- Different operating systems use different codes for language and country and (in the case of windows) for the encoding. Even between versions of Linux there are differences. This is the reason that a list of codes can be used -- one of them might be known by the specific host. It is worthwhile looking up the codes used by openBSD, suse, redhat, windows etc. (a real jungle  :'()

- As Joomla 1.1 will be using utf-8 the .[encoding] is important i.e 'nl_NL.utf-8' is important in all cases when the day or month names include extended ASCII characters (diacritic letters for example).

Some examples for Dutch language file locale tag:
dut_NL.utf-8, nld_NL.utf-8, nl_NL.utf-8, [all the previous with _NLD for country], dutch, nld, belgian, dutch-belgian, nlb

It needs some trial and error and investigation of common operating systems to find the best list.
David Gal

zerocold
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Sat Dec 10, 2005 3:17 am

Re: locale setting in xml file 1.1

Post by zerocold » Fri Dec 30, 2005 7:58 am

any clear example about this . I am do translation for Khmer langauge that use UTF-8 .

I do not know what i am missing but when i view source on my website it still show " iso-8859-1 " it wont change to utf-8 at all.

*** If you got the same problem like me check out the template file index.php and the templateDetails.xml make sure they gotthe same encording you want to use.

however the meta charactor set it wont change to utf-8 at all it still stuck with iso-8859-1
Last edited by zerocold on Fri Dec 30, 2005 8:22 am, edited 1 time in total.

User avatar
davidgal
Joomla! Guru
Joomla! Guru
Posts: 963
Joined: Sat Aug 20, 2005 9:19 am
Location: Israel
Contact:

Re: locale setting in xml file 1.1

Post by davidgal » Fri Dec 30, 2005 2:14 pm

zerocold wrote: any clear example about this . I am do translation for Khmer langauge that use UTF-8 .

I do not know what i am missing but when i view source on my website it still show " iso-8859-1 " it wont change to utf-8 at all.

*** If you got the same problem like me check out the template file index.php and the templateDetails.xml make sure they gotthe same encording you want to use.

however the meta charactor set it wont change to utf-8 at all it still stuck with iso-8859-1
Hi zerocold,

Is your site using Joomla 1.1 or Joomla 1.0.x? Can you perhaps provide a link to the site - It might help to take a look.
David Gal

zerocold
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Sat Dec 10, 2005 3:17 am

Re: locale setting in xml file 1.1

Post by zerocold » Fri Dec 30, 2005 5:44 pm

i am using 1.0.x and do the translation - http://khmerseek.net sorry i forgot to provide the link.

User avatar
davidgal
Joomla! Guru
Joomla! Guru
Posts: 963
Joined: Sat Aug 20, 2005 9:19 am
Location: Israel
Contact:

Re: locale setting in xml file 1.1

Post by davidgal » Sat Dec 31, 2005 9:28 am

OK...
The place to change the encoding of the site in Joomla 1.0.x is inside the language file (english.php is the supplied language file). There is a define statement for _ISO which you can search for. There you will find the default value of iso-8859-1 which you can change to the encoding needed.

However for Khmer language I believe that there is no single-byte character encoding and that utf-8 is the popular encoding for Khmer. Joomla 1.0.x does not really support utf-8 (this is coming with Joomla 1.1). There are sites that have implemented multi-byte character encodings in Joomla 1.0.

A quick guideline to getting Joomla 1.0 to work with utf-8 is as follows:
- use MySQL version 4.1.2 or newer (older versions don't support utf-8).
- create an empty database manually before installing Joomla. Set the character set to utf8 with some collation (utf8_general_ci).
- set 'charset=utf-8' in the _ISO define in the language file
- you may need to uncomment one line of code in the includes/database.php file at about line 102 (second line below)

Code: Select all

		$this->_table_prefix = $table_prefix;
        //@mysql_query("SET NAMES 'utf8'", $this->_resource);
		$this->_ticker = 0;
		$this->_log = array();

I suggest contacting 'eyesofkids' on the personal message system here. He can provide more input on what is required.
David Gal


Locked

Return to “Translations”