Hello, we apologize but forum registrations are non-functional at this time. This issue should be fixed around mid-December. Until then, please stop by our Discord channel if you'd like to get in touch with the team. Thanks!

Boot.cpp misreading languages.lua file [SOLVED]

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

Moderator: Staff

Post Reply
User avatar
marcavis
Junior Member
Posts: 32
Joined: Tue Jun 09, 2009 6:28 pm
Location: Santa Catarina, Brazil

Boot.cpp misreading languages.lua file [SOLVED]

Post by marcavis » Tue Feb 16, 2010 9:11 pm

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 8:42 am, edited 2 times in total.
User avatar
Roots
Dictator
Posts: 8669
Joined: Wed Jun 16, 2004 12:07 pm
Location: Austin TX
Contact:

Re: Boot.cpp misreading languages.lua file

Post by Roots » Tue Feb 16, 2010 10:09 pm

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: Wed Jun 16, 2004 9:03 pm
Location: Hermosa Beach, CA
Contact:

Re: Boot.cpp misreading languages.lua file

Post by gorzuate » Tue Feb 16, 2010 10:42 pm

Ok, I'll look at it.
Image
User avatar
gorzuate
Developer
Posts: 2575
Joined: Wed Jun 16, 2004 9:03 pm
Location: Hermosa Beach, CA
Contact:

Re: Boot.cpp misreading languages.lua file

Post by gorzuate » Wed Feb 17, 2010 3: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: Tue Jun 09, 2009 6:28 pm
Location: Santa Catarina, Brazil

Re: Boot.cpp misreading languages.lua file

Post by marcavis » Wed Feb 17, 2010 8:41 am

Yup, it works correctly now. :approve:
Post Reply