[bt-devel] Language Setting
John B. Turpish
jbt at gmx.us
Wed Jan 16 19:30:22 MST 2013
I do see how dynamic translation is important to the user experience
involved in changing the setting, but I do think being able to determine
what language BibleTime starts up in is a feature in its own right.
Although it might look less professional, I think it would be more
functional if, until the day we have all widgets in bt dynamically
translating, you could change that setting and at that point it would
pop up a dialog (in the new language? existing one? both?) informing you
that "Language selection will not take effect until the next time you
start BibleTime".
Taking it a step further, the same dialog could add, "Would you like to
restart BibleTime now?" or similar and if they click "Restart" either
destroy all the UI elements and re-create them (Google tells me some
other projects handle it this way) or literally restart the process (on
Unix-like systems this could be a simple execv, which is what my local
build is doing).
Another way to delay biting the bullet would be to use a proxy
translator - a subclass of QTranslator that forwards to its base class
for all the real work, and then keeps track of a reverse mapping. Then
when the language changes you iterate through all the windows and
widgets accessing their current text, undoing the original translation,
translating into the new target, and then setting the new text. This is
obviously not perfect, because languages are not 1:1 and though you
could make some solid guesses about the current context you would have
no way to access the disambiguation text. The translator *could* change
the returned values to avoid translation conflicts within a given
context by appending '\0' characters (since they don't show up on the
screen - or is that just my font?), but there's absolutely no way to fix
a situation that does something like tr("dynamic")+var+tr("text").
More information about the bt-devel
mailing list