[virt-tools-list] [libosinfo v2 2/4] Load localized values for entity params

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Tue Oct 23 13:09:44 UTC 2012


On Tue, Oct 23, 2012 at 10:58 AM, Christophe Fergeau
<cfergeau at redhat.com> wrote:
> On Tue, Oct 23, 2012 at 04:54:53AM +0300, Zeeshan Ali (Khattak) wrote:
>> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
>>
>> Use the localized values of entity params if available.
>> ---
>>  osinfo/osinfo_loader.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
>> index 47db85b..88de701 100644
>> --- a/osinfo/osinfo_loader.c
>> +++ b/osinfo/osinfo_loader.c
>> @@ -232,7 +232,8 @@ static void osinfo_loader_entity(OsinfoLoader *loader,
>>              return;
>>
>>          if (value) {
>> -            osinfo_entity_set_param(entity, keys[i], value);
>> +            const gchar *local_value = g_dgettext(GETTEXT_PACKAGE, value);
>> +            osinfo_entity_set_param(entity, keys[i], local_value);
>
> We want to check some 'is_translatable' marker, otherwise if a
> non-translatable string is present in the database and has the same value
> as a translatable string, then we'll get a translation for it.

Given that only strings that we explicitly ask to be translated (using
_ and *gettext) in the code will be translated, is that going to be a
problem?

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124




More information about the virt-tools-list mailing list