]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix some localization issues with Norwegian.
authorMichael Sweet <msweet@msweet-retina.local>
Thu, 14 Apr 2016 16:09:35 +0000 (12:09 -0400)
committerMichael Sweet <msweet@msweet-retina.local>
Thu, 14 Apr 2016 16:09:35 +0000 (12:09 -0400)
CHANGES.txt
cups/language.c
cups/ppd-localize.c
ppdc/ppdc-catalog.cxx

index e57160005c74d0f200571794c1417406d83e9d07..fb9d09940137b42f53743e714aeca14fb48708d0 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES.txt - 2.2b1 - 2016-04-12
+CHANGES.txt - 2.2b1 - 2016-04-14
 --------------------------------
 
 CHANGES IN CUPS V2.2b1
@@ -27,4 +27,6 @@ CHANGES IN CUPS V2.2b1
          (<rdar://problem/23135640>)
        - Added a new cupsHashData API and support for hashed job passwords
          (<rdar://problem/20221502>)
+       - Localization fixes (<rdar://problem/25292403>,
+         <rdar://problem/25461517>)
        - Documentation changes (Issue #4781)
index 32a2af641b17e18c57d37979f3bdf2cbd5fc8fa3..f1afeccd58f2f49e7d6df11ce18664d219931896 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * I18N/language support for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2016 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -1335,6 +1335,18 @@ appleMessageLoad(const char *locale)     /* I - Locale ID */
     snprintf(filename, sizeof(filename), CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings", locale);
   }
 
+  if (access(filename, 0))
+  {
+   /*
+    * <rdar://problem/25292403>
+    *
+    * Try with just the language code...
+    */
+
+    strlcpy(baselang, locale, sizeof(baselang));
+    snprintf(filename, sizeof(filename), CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings", baselang);
+  }
+
   DEBUG_printf(("1appleMessageLoad: filename=\"%s\"", filename));
 
   if (access(filename, 0))
@@ -1345,7 +1357,9 @@ appleMessageLoad(const char *locale)      /* I - Locale ID */
 
     if (!strncmp(locale, "en", 2))
       locale = "English";
-    else if (!strncmp(locale, "nb", 2) || !strncmp(locale, "nl", 2))
+    else if (!strncmp(locale, "nb", 2))
+      locale = "no";
+    else if (!strncmp(locale, "nl", 2))
       locale = "Dutch";
     else if (!strncmp(locale, "fr", 2))
       locale = "French";
index 64d7108860729581417ecd7ecc3f59ef39ec9414..c20dbf937644e3c2fff5b23e75f4fd0dd57e820f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PPD localization routines for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2016 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -694,6 +694,17 @@ _ppdLocalizedAttr(ppd_file_t *ppd, /* I - PPD file */
        snprintf(lkeyword, sizeof(lkeyword), "jp.%s", keyword);
        attr = ppdFindAttr(ppd, lkeyword, spec);
       }
+      else if (!strncmp(ll_CC, "nb", 2))
+      {
+       /*
+       * Norway has two languages, "Bokmal" (the primary one)
+       * and "Nynorsk" (new Norwegian); this code maps from the (currently)
+       * recommended "nb" to the previously recommended "no"...
+       */
+
+       snprintf(lkeyword, sizeof(lkeyword), "no.%s", keyword);
+       attr = ppdFindAttr(ppd, lkeyword, spec);
+      }
       else if (!strncmp(ll_CC, "no", 2))
       {
        /*
index 854b58de00667ca7c2047911f80df96858f9603f..ad7157bc56db432f511d28ecbd859c44fc2e8c32 100644 (file)
@@ -1,7 +1,7 @@
 //
 // Shared message catalog class for the CUPS PPD Compiler.
 //
-// Copyright 2007-2014 by Apple Inc.
+// Copyright 2007-2016 by Apple Inc.
 // Copyright 2002-2006 by Easy Software Products.
 //
 // These coded instructions, statements, and computer programs are the
@@ -78,7 +78,9 @@ ppdcCatalog::ppdcCatalog(const char *l,       // I - Locale
 
       if (!strncmp(l, "en", 2))
        tl = "English";
-      else if (!strncmp(l, "nb", 2) || !strncmp(l, "nl", 2))
+      else if (!strncmp(l, "nb", 2))
+        tl = "no";
+      else if (!strncmp(l, "nl", 2))
        tl = "Dutch";
       else if (!strncmp(l, "fr", 2))
        tl = "French";