Follow-up Comment #2, patch #1154 (project wesnoth):

I'm wasn't fond of fetching language code as message either, but could not
find a way around it. The problem runs deeper than it seemed at first sight
(to me, at least).

One direct problem is that filesystem.cpp is part of libwesnoth-core, while
language setting/querying functionality (e.g. get_language() from
language.cpp) is part of libwesnoth-game, which I understand to be higher in
the library stack. Though a workaround could certainly be made there (e.g.
rearranging some code, reading configuration manually)...

The more serious problem is that, to my best deduction, Wesnoth does not
really have a concept of "language", but relies solely on locales. On a Linux
system, this means that "language choosing" is actually locale choosing, and
once Wesnoth sets the locale, it is left to Gettext (i.e. libc) to actually
resolve from which language the messages are going to be returned. E.g. if
pt_BR.UTF-8 locale is chosen (disguised as Brasilian Portugese language),
then Gettext will actually fetch pt message whenever pt_BR one is not
available. Moreover, if "System Default" language is used, as is the default,
no locale is stored in Wesnoth config and object returned by get_language()
reports empty string as localename attribute (because setlocale(LC_ALL, "")
is enough to get Gettext running in that case), and translated language name
(i.e. a guise for locale name) as language attribute, neither of which is of
any use in this context.

So, to solve the first problem, one needs to add some more code and/or
rearrange what belongs to which library, and to solve the second, that added
code would have to mimic Gettext's internal procedure of resolving language
based on locale, so that text and image language never fall out of sync. Such
code would seriously blow the size of the patch, and could lead to maintenance
pain when multiple platforms are taken into account. So, as the lesser evil, I
added that admittedly quite dumb looking message.

As for --ovr suffix being terse, how about straight out --overlay?


    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?1154>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to