[gimp] Bug 777754 - Failure to recognise installed help system.



commit 53465942f83ee5807a9e6e101c123efbbcda80e4
Author: Jehan <jehan girinstud io>
Date:   Wed Feb 1 00:53:39 2017 +0100

    Bug 777754 - Failure to recognise installed help system.
    
    It seems that the Windows platform could sometimes return locales in the
    form en-GB (so an IETF language tag, I guess) instead of a POSIX locale.
    This little hack should take care of the easy cases until we get a
    better and generic fix.

 plug-ins/help/gimphelp.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/help/gimphelp.c b/plug-ins/help/gimphelp.c
index abcc5bb..a73a9ba 100644
--- a/plug-ins/help/gimphelp.c
+++ b/plug-ins/help/gimphelp.c
@@ -125,6 +125,22 @@ gimp_help_parse_locales (const gchar *help_locales)
   for (p = strchr (s, ':'); p; p = strchr (s, ':'))
     {
       gchar *new = g_strndup (s, p - s);
+      gchar *c;
+
+      /* Apparently some systems (i.e. Windows) would return a value as
+       * IETF language tag, which is a different format from POSIX
+       * locale; especially it would separate the lang and the region
+       * with an hyphen instead of an underscore.
+       * Actually the difference is much deeper, and IETF language tags
+       * can have extended language subtags, a script subtag, variants,
+       * moreover using different codes.
+       * We'd actually need to look into this in details (TODO).
+       * this dirty hack should do for easy translation at least (like
+       * "en-GB" -> "en_GB).
+       */
+      c = strchr (new, '-');
+      if (c)
+        *c = '_';
 
       locales = g_list_append (locales, new);
       s = p + 1;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]