[Scummvm-devel] Improving translation support in ScummVM

Thierry Crozat criezy at scummvm.org
Fri Jun 25 01:23:35 CEST 2010


Le 24 juin 2010 à 21:24, Johannes Schickel a écrit :

> On 06/24/2010 08:04 AM, Eugene Sandulenko wrote:
>> 
>> 
>>> 1) Some of the locale strings use %d etc. to add numbers, strings
>>> etc. to the output. While that might be fine, the major problem here
>>> is: the order is fixed, so it might be hard for translators to take
>>> grammar or the like into account when doing translations for those
>>> messages.
>>> 
>> As I've mentioned, those belong to _t(). Feel free to remove that
>> feature altogether. Originally this was implemented for the sake of
>> completeness, but I do not believe that we need to translate debug
>> output. Rather, we need to implement FR #2616463: "ALL: Display errors
>> in graphic display before exiting"
>> 
> 
> I just noticed we have some of those occurrences in _() usages too:
> 
> gui/massadd.cpp:244:        snprintf(buf, sizeof(buf), "%s", _("Scan 
> complete!"));
> gui/massadd.cpp:247:        snprintf(buf, sizeof(buf), _("Discovered %d 
> new games."), _games.size());
> gui/massadd.cpp:251:        snprintf(buf, sizeof(buf), _("Scanned %d 
> directories ..."), _dirsScanned);
> gui/massadd.cpp:254:        snprintf(buf, sizeof(buf), _("Discovered %d 
> new games ..."), _games.size());
> gui/KeysDialog.cpp:83:                sprintf(selection, _("Associated 
> key : %s"), SDL_GetKeyName((SDLKey)key));
> gui/KeysDialog.cpp:105:                sprintf(selection, _("Associated 
> key : %s"), SDL_GetKeyName((SDLKey)key));
> gui/KeysDialog.cpp:144:            sprintf(selection, _("Associated key 
> : %s"), SDL_GetKeyName((SDLKey) state.keycode));
> backends/platform/wii/options.cpp:188:            label = 
> String::printf(_("Network not initialsed (%d)"), status);
> base/main.cpp:205:            warning(_("Engine does not support debug 
> level '%s'"), token.c_str());
> base/main.cpp:430:            warning("%s", _("Could not find any engine 
> capable of running the selected game"));
> 
> What will we do about those?


All those have only one argument to the format string. So there is no order issue for the translations. Maybe we can say that using one %something in translatable string is fine. But we should try not to use more than one?

As for translating debug output it seems indeed to be superfluous. This might also make the support more difficult if we ask the user to give the debug output for a particular problem and we end up with some cryptic cyrillic characters. The same goes for all messages targeted at the developers or advanced users. I think they should be left in english.

Thierry





More information about the Scummvm-devel mailing list