[Scummvm-cvs-logs] SF.net SVN: scummvm:[54479] scummvm/trunk

Johannes Schickel lordhoto at scummvm.org
Sat Nov 27 03:19:57 CET 2010


On 11/27/2010 01:44 AM, Jordi Vilalta Prat wrote:
> Hi,
>
> 2010/11/25<lordhoto at users.sourceforge.net>:
>> Revision: 54479
>>           http://scummvm.svn.sourceforge.net/scummvm/?rev=54479&view=rev
>> Author:   lordhoto
>> Date:     2010-11-25 18:40:56 +0000 (Thu, 25 Nov 2010)
>>
>> Log Message:
>> -----------
>> OSYSTEM: Add API to query the system locale.
>>
>> I also adapted the SDL backend to implement the API.
> Thanks for adding this, it's another step forward. However, there's
> one annoyance: the addition of the
> getLanguageLocale(parseLanguageFromLocale()) step adds the requirement
> of the locale language to be present in the languages table in
> utils.cpp. In my particular case it has caused the Catalan language
> not to be auto-detected anymore, since it wasn't in the known
> languages table.
>
> It would be more flexible (as it was before) if getSystemLanguage()
> returned a Common::String. If a backend needs manual language mapping,
> the porter wouldn't mind having to return a string instead of an enum
> value.

There is a (major) problem about returning a Common::String though: we 
need to agree on a locale format. We could of course chose the more or 
less simple way out and say we use Linux (POSIX?) style locales. In the 
end if we use the system language for more than the translation code it 
is definitely easier to have it return a Common::Language, that way we 
could say auto select (select and not choose!) the game language of the 
users system in case we have multiple detection entries for example.

// Johannes




More information about the Scummvm-git-logs mailing list