Boot.cpp misreading languages.lua file [SOLVED]

For those having trouble installing/running the game or to report a bug

Moderator: Staff

User avatar
marcavis
Junior Member
Posts: 32
Joined: Wed Jun 10, 2009 12:28 am
Location: Santa Catarina, Brazil
Contact:

Boot.cpp misreading languages.lua file [SOLVED]

Postby marcavis » Wed Feb 17, 2010 4:11 am

I'm working on the Brazilian Portuguese translation of Allacrost, (locale = pt_BR), so I added the following line to dat/config/languages.lua so boot mode would add it as a language choice:
languages[2] = "pt_BR" .. hoa_system.Translate("Portuguese (Brazil)");
The problem is that boot.cpp (around line 640) only expects a two-letter locale, like "en" or "fr". "pt" wouldn't cause problems, but we have to differentiate between Portuguese from Brazil and from Portugal.
So the boot mode code splits the concatenated string "pt_BRPortuguese (Brazil)" and displays "_BRPortuguese (Brazil)", not aware that the locale has 5 letters in this case.
Last edited by marcavis on Wed Feb 17, 2010 3:42 pm, edited 2 times in total.
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Boot.cpp misreading languages.lua file

Postby Roots » Wed Feb 17, 2010 5:09 am

Yeah, if I'm thinking about this correctly I believe the code right now only uses two character strings as the language key. It sounds like gettext supports languages that use a language string identifier more than two characters, so we should really be working with strings of arbitrary lengths for the key and not just two character ones. Maybe gorzuate can get that working. I'd do it myself but I've kind of hacked my copy of the code to hell at the moment and its going to take a minor miracle just for me to get everything to compile again. :angel:
Image
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Re: Boot.cpp misreading languages.lua file

Postby gorzuate » Wed Feb 17, 2010 5:42 am

Ok, I'll look at it.
Image
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Re: Boot.cpp misreading languages.lua file

Postby gorzuate » Wed Feb 17, 2010 10:31 am

'ave a go now, mate. Should be fixed.

Beware: the format of languages.lua has changed.
Image
User avatar
marcavis
Junior Member
Posts: 32
Joined: Wed Jun 10, 2009 12:28 am
Location: Santa Catarina, Brazil
Contact:

Re: Boot.cpp misreading languages.lua file

Postby marcavis » Wed Feb 17, 2010 3:41 pm

Yup, it works correctly now. :approve:

Return to “Technical Issues”

Who is online

Users browsing this forum: No registered users and 1 guest