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

Christophe Fergeau cfergeau at redhat.com
Tue Oct 23 07:58:03 UTC 2012


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.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20121023/4cf166ee/attachment.sig>


More information about the virt-tools-list mailing list