[haiku] Re: Translation in context (was: Re: How to participate in localization of Haiku)

  • From: PulkoMandy <pulkomandy@xxxxxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Sat, 03 Oct 2009 15:01:49 +0200

Le Sat, 03 Oct 2009 14:07:31 +0200, Jonas Sundström <jonas@xxxxxxxxxxx> a écrit:


"Humdinger" <humdingerb@xxxxxxxxxxxxxx> wrote:
 ...
You have to see where a string is used to get a correct
translation. Perfect would be a WYSIWYG mode where you
could replace any string of an app while it's running.

Haiku app scripting can do rudimentary inspection of the
view hiearchy of a running application. (I admit that I'm
uncertain on the boundaries of that capability.)

I think it would be possible to make a separate inspection/
translation application, which you would run along-side the
application you're translating. You'd be interacting normally
with the application and switch to the inspection tool to do
translation.

It would use Haiku application scripting to build a tree of
the view hierarchy, crosschecking the strings of every view/
control it encounters with the default catalog and the catalog
you're working on, highlighting the active view hierarcy
section's catalog entries, letting you almost edit in context.

I think it might even let you inject the new string, in place,
in addition to updating the catalog you're editing. But such
injections would not be meaningful for strings that are
composed by substrings and arguments at runtime. (The inspector
could possibly look for printf-style varargs and warn about it.)

Maybe the application scripting can be improved somehow to
make this faux-translation-in-context more reliable, and the
views/controls improved to allow more reliable identification
by way of scripting - in a future API revision.

Another idea might be to have the tool do string animation
(xxx, YYYY, xxx, YYYY, ..., etc) and have focus change to its
view, in the target application, on selection of a catalog entry
in the inspector, showing its location in the GUI. (If that part
of the GUI is actually live at the moment.)

Don't you think you are a bit overengineering it ?
Actually, the Locale Kit should support reloading of a catalog when you switch to a new preferred language in the preflet. I'm not sure how to do it, but once done it would allow to just send the 'locale changed' message to the app and force it to reload the catalog you just wrote to disk. As for lookup, it is possible to look at the context and comment of the string in the catfile. If localization is done right, this should be enough to find them out easily in the window. An online translation tool could sort strings by context and display a screenshot of the apps with the english strings, showing the said context (often a view of the application). When translating, it is possible to have as many contexts as you want. So translators should get enough help with that...

--
Adrien Destugues / PulkoMandy
http://pulkomandy.ath.cx

Other related posts: