]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ppd-localize.c
License change: Apache License, Version 2.0.
[thirdparty/cups.git] / cups / ppd-localize.c
index 9f837b87ee47564e3e389011ac6df0d9bde7aa04..fecf3432bb035611f7822bc7263a327d7c458b18 100644 (file)
@@ -1,16 +1,10 @@
 /*
- * "$Id$"
- *
  * PPD localization routines for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- * which should have been included with this file.  If this file is
- * file is missing or damaged, see the license at "http://www.cups.org/".
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
  *
  * PostScript is a trademark of Adobe Systems, Inc.
  *
@@ -20,8 +14,6 @@
  * (or any derivative of it) with software other than GNU
  * GhostScript (or its derivatives) is governed by the CUPS license
  * agreement.
- *
- * This file is subject to the Apple OS-Developed Software exception.
  */
 
 /*
@@ -46,7 +38,7 @@ static cups_lang_t    *ppd_ll_CC(char *ll_CC, size_t ll_CC_size);
  * descriptions, printer presets, and custom option parameters.  Each
  * localized string uses the UTF-8 character encoding.
  *
- * @since CUPS 1.2/OS X 10.5@
+ * @since CUPS 1.2/macOS 10.5@
  */
 
 int                                    /* O - 0 on success, -1 on error */
@@ -231,7 +223,7 @@ ppdLocalizeAttr(ppd_file_t *ppd,    /* I - PPD file */
  *
  * If no value of the requested scheme can be found, NULL is returned.
  *
- * @since CUPS 1.3/OS X 10.5@
+ * @since CUPS 1.3/macOS 10.5@
  */
 
 const char *                           /* O - Value or NULL if not found */
@@ -484,7 +476,7 @@ ppdLocalizeIPPReason(
  * text from the attribute value. If no localized text for the requested
  * name can be found, @code NULL@ is returned.
  *
- * @since CUPS 1.4/OS X 10.6@
+ * @since CUPS 1.4/macOS 10.6@
  */
 
 const char *                           /* O - Value or @code NULL@ if not found */
@@ -622,7 +614,7 @@ _ppdGetLanguages(ppd_file_t *ppd)   /* I - PPD file */
 /*
  * '_ppdHashName()' - Generate a hash value for a device or profile name.
  *
- * This function is primarily used on OS X, but is generally accessible
+ * This function is primarily used on macOS, but is generally accessible
  * since cupstestppd needs to check for profile name collisions in PPD files...
  */
 
@@ -667,7 +659,7 @@ _ppdLocalizedAttr(ppd_file_t *ppd,  /* I - PPD file */
    /*
     * <rdar://problem/22130168>
     *
-    * Hong Kong locale needs special handling...  Sigh...
+    * Multiple locales need special handling...  Sigh...
     */
 
     if (!strcmp(ll_CC, "zh_HK"))
@@ -696,6 +688,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))
       {
        /*
@@ -772,8 +775,3 @@ ppd_ll_CC(char   *ll_CC,            /* O - Country-specific locale name */
                 lang->language, ll_CC));
   return (lang);
 }
-
-
-/*
- * End of "$Id$".
- */