Translations in profile files?

George Goldberg grundleborg at googlemail.com
Tue Jun 14 18:58:47 CEST 2011


On 14 June 2011 17:46, David Edmundson <david at davidedmundson.co.uk> wrote:
> On Mon, Jun 13, 2011 at 10:30 PM, George Kiagiadakis
> <kiagiadakis.george at gmail.com> wrote:
>> Hi,
>>
>> I just noticed we are shipping some .profile files for several
>> protocols and there are some strings in those files that appear on the
>> UI. For example, sofiasip-sip.profile has:
>>
>> <name>Voice over IP (VoIP/SIP)</name>
>>
>> My question is, how do these strings get translated? Afaik it is not
>> allowed to show any text on the UI if it doesn't get through i18n(),
>> even if it's some english-only protocol name.
>>
>
> In the accounts KCM almost all strings from telepathy are pushed
> through dictionary.cpp which effectively runs
>
> if (string=="Some Message") {
>  return i18n("Some Message");
> } else {
>  return string;
> }
>
> (it's not quite like that, it's stored in a map)
>
> I think every time you see a profile name, it will have gone through
> this code. This was originally written for when we only had protocol
> names, not profile files with the (English) human readable names.
>
> BUT:
>
>  1) It's a bit weird.
>  2) This only happens in the accounts KCM. CL / Presence Applet don't
> have access to this.
>  3) Not all the profile names (if any) are actually in dictionary.cpp
> so it doesn't really do anything. In fact there's line's in the code
> that say "remove this when we have profiles"
>  4) It defeats the point of human readable names in profiles.
>
> Ideally we want to have translations in the profile files. Maybe we
> should ask the telepathy ML?
>
> At a second best option I guess we would need something like the
> accounts dictionary in the KDE-TP library.

The accounts dictionary is a horrible hack and got me told off by the
i18n people at the time it was first implemented. Apparently we should
be using .desktop files for this kind of translation. (But having
translations in profile files might make more sense... I'm not sure -
thinking KDE and Gnome i18n might have different conflicting
conventions?)

--
George


More information about the KDE-Telepathy mailing list