Language IDs

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Language IDs

Post by minime »

wiki wrote:language-id .... Since 2.0.1 alpha 59, this value can have an alternative format that allows distinguishing up to 64 languages. To use this, set bit 6, and set the language ID in bits 0..5.
The question is, what are those IDs?

First of all, is it safe to assume that the values for the 5 original locales will remain same (for compatibility)? i.e.

Code: Select all

0x01	American
0x02	English
0x04	German
0x08	French
0x10	Spanish
I would like to reserve two IDs for Czech and Slovak. Since the current trend seems to be to use country calling codes, i've considered 420 and 421. Unfortunately those are out of range to be valid language IDs, so we have to transform them a little. Let the digits mean the numbers of bits to set high. We get:

Code: Select all

420 -> 0x10 + 0x04 + 0x01 = 0x15 (21 dec)
421 -> 0x10 + 0x04 + 0x02 = 0x16 (22 dec)
Luckily, 21 and 22 aren't international dialing tones, so we can pull this off. Besides it lends to a simple mnemonic.

Therefore the language IDs are so far:
  • Russian - 0x07 - reserved by George on Sat Jan 07, 2006 12:51 am
    Czech - 0x15 - reserved by minime
    Slovak - 0x16 - reserved by minime
    Norwegian - 0x2F - reserved by OzTransLtd on Sat Jan 07, 2006 12:01 am
with the possible inclusion of the default IDs.

Could anyone please help clarify this, since there is no official documentation on this?
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Re: Language IDs

Post by Patchman »

minime wrote:The question is, what are those IDs?
Whatever you want them to be.
First of all, is it safe to assume that the values for the 5 original locales will remain same (for compatibility)?
Yes.
Could anyone please help clarify this, since there is no official documentation on this?
Your suggestion sounds good.

In the future, anyone wanting to use a new ID should just self-document it by adding it to the wiki. I've added them myself for now.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Bing [Bot] and 29 guests