[virt-tools-list] [libosinfo v3 1/4] Add translation framework

Christophe Fergeau cfergeau at redhat.com
Wed Oct 24 14:27:12 UTC 2012


On Wed, Oct 24, 2012 at 12:02:28AM +0300, Zeeshan Ali (Khattak) wrote:
> @@ -23,6 +23,7 @@
>   */
>  
>  #include <config.h>
> +#include <glib/gi18n-lib.h>
>  
>  #include <osinfo/osinfo.h>
>  
> @@ -70,6 +71,11 @@ osinfo_loader_class_init (OsinfoLoaderClass *klass)
>  {
>      GObjectClass *g_klass = G_OBJECT_CLASS (klass);
>  
> +    bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
> +#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
> +    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
> +#endif

HAVE_BIND_TEXTDOMAIN_CODESET does not seem to be defined anywhere as the
preprocessed C file does not contain this call even if
bind_textdomain_codeset declaration is present.

> diff --git a/tools/osinfo-db-validate.c b/tools/osinfo-db-validate.c
> index 65454d7..31bfeea 100644
> --- a/tools/osinfo-db-validate.c
> +++ b/tools/osinfo-db-validate.c
> @@ -26,6 +26,7 @@
>  #include <glib.h>
>  #include <gio/gio.h>
>  #include <libxml/relaxng.h>
> +#include <locale.h>
>  
>  #define SCHEMA PKGDATADIR "/schemas/libosinfo.rng"
>  
> @@ -248,6 +249,7 @@ gint main(gint argc, gchar **argv)
>      GError *error = NULL;
>      gint ret = EXIT_FAILURE;
>  
> +    setlocale(LC_ALL, "");

As said in another email, I think it would be better to fully initialize
i18n there even if it's not really useful as long as translated strings are
only coming from libosinfo and not from the binary.

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/20121024/082891aa/attachment.sig>


More information about the virt-tools-list mailing list