Semantic marking for i18n

Jaroslaw Staniek js at iidea.pl
Thu Apr 26 16:25:28 BST 2007


Chusslove Illich said the following, On 2007-04-23 01:14:

>> [: Olivier Goffart :]
>> Anyway, not all i18n call are going to be displayed in place where it is
>> possible to have HTML.
>> How will i18n cope with that ?
> 
> Yes, that was a prime problem. The only automatic solution would be (as Frans 
> and Krzysztof were saying in that thread) to proliferate the use of 
> KLocalizedStrings throught the UI widgets, replacing QStrings. But, this 
> would introduce discrepancy with Qt widgets, not to mention that there may be 
> ambiguous situations for automatic format decision, which would, in my 
> opinion, result in a mess.
> 
> So, that part I would leave to programmers, as it was so far. For example, if 
> the message opens with <html> or <qt> tag, then rich formatting is used, 
> otherwise plain. Even though Qt is less strict about this (tries to guess 
> it's rich text by looking at other tags if <html>/<qt> is missing), it seems 
> people were nevertheless remembering to put the <qt> tag.
> 
> Some heuristic may also be possible with semantic markings. Eg. if the message 
> contains <para> tag, it's quite probably used where rich text is possible. 
> And so on.
> 
> Krazy checks may also help, assuring that strings at typical UI widget calls 
> (eg. at tooltip position) contain <html> tag...

I remembner the i18n-related thread, and still would like to use such tags, 
and, for instance, forget about having random formatting for URLs [1] in KDE apps.

If KDE documentation system became able to reuse messages directly from 
i18n(), maybe one day we could benefit from well tagged messages appearing in 
docs.
For example: various glosarries/appendices can reuse some text from the code, 
for documenting meaning of questions or warnings an application can display. 
Interesting thing is that the message is already translated within the GUI...

[1] examples:
'/foo/bar'
<b>/foo/bar</b>
\"/foo/bar\"
/foo/bar

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice: http://www.kexi.pl/en, http://www.koffice.org
  KDE3 & KDE4 Libraries for MS Windows: http://kdelibs.com, http://www.kde.org




More information about the kde-core-devel mailing list