~ubuntu-branches/ubuntu/precise/sitecopy/precise

« back to all changes in this revision

Viewing changes to intl/localename.c

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2008-07-22 07:31:05 UTC
  • mfrom: (1.1.4 upstream) (4.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080722073105-cbqs1hnc2wvqejfd
Tags: 1:0.16.6-1
* New upstream release
  - fix a crash with progress bar enabled; Closes: #486378
* debian/control
  - set myself as maintainer, Kartik as uploader
  - set Vcs-{Browser,Git} fields
  - bump Standards-Version to 3.8.0
    + debian/README.source added
  - added DM-Upload-Allowed flag
* debian/patches/05_libneon27_transition.dpatch
  - removed since merged upstream
* debian/copyrightdebian/copyright
  - updated upstream email and copyright years
* debian/patches/10_bts410703_preserve_storage_files_sigint.dpatch
  - added to preserve storage files if SIGINT (Ctrl+C) is sent to sitecopy;
    thanks to Andreas Henriksson for the patch; Closes: #410703

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Determine the current selected locale.
2
 
   Copyright (C) 1995-1999, 2000-2005 Free Software Foundation, Inc.
 
1
/* Determine name of the currently selected locale.
 
2
   Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software; you can redistribute it and/or modify it
5
5
   under the terms of the GNU Library General Public License as published
13
13
 
14
14
   You should have received a copy of the GNU Library General Public
15
15
   License along with this program; if not, write to the Free Software
16
 
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
16
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
17
   USA.  */
18
18
 
19
19
/* Written by Ulrich Drepper <drepper@gnu.org>, 1995.  */
20
20
/* Win32 code written by Tor Lillqvist <tml@iki.fi>.  */
21
21
/* MacOS X code written by Bruno Haible <bruno@clisp.org>.  */
22
22
 
23
 
#ifdef HAVE_CONFIG_H
24
 
# include <config.h>
 
23
#include <config.h>
 
24
 
 
25
/* Specification.  */
 
26
#ifdef IN_LIBINTL
 
27
# include "gettextP.h"
 
28
#else
 
29
# include "localename.h"
25
30
#endif
26
31
 
27
32
#include <stdlib.h>
29
34
 
30
35
#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
31
36
# include <string.h>
32
 
# include <CFString.h>
 
37
# include <CoreFoundation/CFString.h>
33
38
# if HAVE_CFLOCALECOPYCURRENT
34
 
#  include <CFLocale.h>
 
39
#  include <CoreFoundation/CFLocale.h>
35
40
# elif HAVE_CFPREFERENCESCOPYAPPVALUE
36
 
#  include <CFPreferences.h>
 
41
#  include <CoreFoundation/CFPreferences.h>
37
42
# endif
38
43
#endif
39
44
 
40
45
#if defined _WIN32 || defined __WIN32__
41
 
# undef WIN32   /* avoid warning on mingw32 */
42
 
# define WIN32
 
46
# define WIN32_NATIVE
43
47
#endif
44
48
 
45
 
#ifdef WIN32
 
49
#ifdef WIN32_NATIVE
46
50
# define WIN32_LEAN_AND_MEAN
47
51
# include <windows.h>
48
52
/* List of language codes, sorted by value:
495
499
# define SUBLANG_AZERI_CYRILLIC 0x02
496
500
# endif
497
501
# ifndef SUBLANG_BENGALI_INDIA
498
 
# define SUBLANG_BENGALI_INDIA 0x00
 
502
# define SUBLANG_BENGALI_INDIA 0x01
499
503
# endif
500
504
# ifndef SUBLANG_BENGALI_BANGLADESH
501
 
# define SUBLANG_BENGALI_BANGLADESH 0x01
 
505
# define SUBLANG_BENGALI_BANGLADESH 0x02
502
506
# endif
503
507
# ifndef SUBLANG_CHINESE_MACAU
504
508
# define SUBLANG_CHINESE_MACAU 0x05
591
595
# define SUBLANG_NEPALI_INDIA 0x02
592
596
# endif
593
597
# ifndef SUBLANG_PUNJABI_INDIA
594
 
# define SUBLANG_PUNJABI_INDIA 0x00
 
598
# define SUBLANG_PUNJABI_INDIA 0x01
595
599
# endif
596
600
# ifndef SUBLANG_PUNJABI_PAKISTAN
597
 
# define SUBLANG_PUNJABI_PAKISTAN 0x01
 
601
# define SUBLANG_PUNJABI_PAKISTAN 0x02
598
602
# endif
599
603
# ifndef SUBLANG_ROMANIAN_ROMANIA
600
 
# define SUBLANG_ROMANIAN_ROMANIA 0x00
 
604
# define SUBLANG_ROMANIAN_ROMANIA 0x01
601
605
# endif
602
606
# ifndef SUBLANG_ROMANIAN_MOLDOVA
603
 
# define SUBLANG_ROMANIAN_MOLDOVA 0x01
 
607
# define SUBLANG_ROMANIAN_MOLDOVA 0x02
604
608
# endif
605
609
# ifndef SUBLANG_SERBIAN_LATIN
606
610
# define SUBLANG_SERBIAN_LATIN 0x02
608
612
# ifndef SUBLANG_SERBIAN_CYRILLIC
609
613
# define SUBLANG_SERBIAN_CYRILLIC 0x03
610
614
# endif
611
 
# ifndef SUBLANG_SINDHI_INDIA
612
 
# define SUBLANG_SINDHI_INDIA 0x00
613
 
# endif
614
615
# ifndef SUBLANG_SINDHI_PAKISTAN
615
616
# define SUBLANG_SINDHI_PAKISTAN 0x01
616
617
# endif
 
618
# ifndef SUBLANG_SINDHI_AFGHANISTAN
 
619
# define SUBLANG_SINDHI_AFGHANISTAN 0x02
 
620
# endif
617
621
# ifndef SUBLANG_SPANISH_GUATEMALA
618
622
# define SUBLANG_SPANISH_GUATEMALA 0x04
619
623
# endif
671
675
# ifndef SUBLANG_TAMAZIGHT_ARABIC
672
676
# define SUBLANG_TAMAZIGHT_ARABIC 0x01
673
677
# endif
674
 
# ifndef SUBLANG_TAMAZIGHT_LATIN
675
 
# define SUBLANG_TAMAZIGHT_LATIN 0x02
 
678
# ifndef SUBLANG_TAMAZIGHT_ALGERIA_LATIN
 
679
# define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02
676
680
# endif
677
681
# ifndef SUBLANG_TIGRINYA_ETHIOPIA
678
 
# define SUBLANG_TIGRINYA_ETHIOPIA 0x00
 
682
# define SUBLANG_TIGRINYA_ETHIOPIA 0x01
679
683
# endif
680
684
# ifndef SUBLANG_TIGRINYA_ERITREA
681
 
# define SUBLANG_TIGRINYA_ERITREA 0x01
 
685
# define SUBLANG_TIGRINYA_ERITREA 0x02
682
686
# endif
683
687
# ifndef SUBLANG_URDU_PAKISTAN
684
688
# define SUBLANG_URDU_PAKISTAN 0x01
694
698
# endif
695
699
#endif
696
700
 
 
701
# if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
 
702
/* MacOS X 10.2 or newer */
 
703
 
 
704
/* Canonicalize a MacOS X locale name to a Unix locale name.
 
705
   NAME is a sufficiently large buffer.
 
706
   On input, it contains the MacOS X locale name.
 
707
   On output, it contains the Unix locale name.  */
 
708
#  if !defined IN_LIBINTL
 
709
static
 
710
#  endif
 
711
void
 
712
gl_locale_name_canonicalize (char *name)
 
713
{
 
714
  /* This conversion is based on a posting by
 
715
     Deborah GoldSmith <goldsmit@apple.com> on 2005-03-08,
 
716
     http://lists.apple.com/archives/carbon-dev/2005/Mar/msg00293.html */
 
717
 
 
718
  /* Convert legacy (NeXTstep inherited) English names to Unix (ISO 639 and
 
719
     ISO 3166) names.  Prior to MacOS X 10.3, there is no API for doing this.
 
720
     Therefore we do it ourselves, using a table based on the results of the
 
721
     MacOS X 10.3.8 function
 
722
     CFLocaleCreateCanonicalLocaleIdentifierFromString().  */
 
723
  typedef struct { const char legacy[21+1]; const char unixy[5+1]; }
 
724
          legacy_entry;
 
725
  static const legacy_entry legacy_table[] = {
 
726
    { "Afrikaans",             "af" },
 
727
    { "Albanian",              "sq" },
 
728
    { "Amharic",               "am" },
 
729
    { "Arabic",                "ar" },
 
730
    { "Armenian",              "hy" },
 
731
    { "Assamese",              "as" },
 
732
    { "Aymara",                "ay" },
 
733
    { "Azerbaijani",           "az" },
 
734
    { "Basque",                "eu" },
 
735
    { "Belarusian",            "be" },
 
736
    { "Belorussian",           "be" },
 
737
    { "Bengali",               "bn" },
 
738
    { "Brazilian Portugese",   "pt_BR" },
 
739
    { "Brazilian Portuguese",  "pt_BR" },
 
740
    { "Breton",                "br" },
 
741
    { "Bulgarian",             "bg" },
 
742
    { "Burmese",               "my" },
 
743
    { "Byelorussian",          "be" },
 
744
    { "Catalan",               "ca" },
 
745
    { "Chewa",                 "ny" },
 
746
    { "Chichewa",              "ny" },
 
747
    { "Chinese",               "zh" },
 
748
    { "Chinese, Simplified",   "zh_CN" },
 
749
    { "Chinese, Traditional",  "zh_TW" },
 
750
    { "Chinese, Tradtional",   "zh_TW" },
 
751
    { "Croatian",              "hr" },
 
752
    { "Czech",                 "cs" },
 
753
    { "Danish",                "da" },
 
754
    { "Dutch",                 "nl" },
 
755
    { "Dzongkha",              "dz" },
 
756
    { "English",               "en" },
 
757
    { "Esperanto",             "eo" },
 
758
    { "Estonian",              "et" },
 
759
    { "Faroese",               "fo" },
 
760
    { "Farsi",                 "fa" },
 
761
    { "Finnish",               "fi" },
 
762
    { "Flemish",               "nl_BE" },
 
763
    { "French",                "fr" },
 
764
    { "Galician",              "gl" },
 
765
    { "Gallegan",              "gl" },
 
766
    { "Georgian",              "ka" },
 
767
    { "German",                "de" },
 
768
    { "Greek",                 "el" },
 
769
    { "Greenlandic",           "kl" },
 
770
    { "Guarani",               "gn" },
 
771
    { "Gujarati",              "gu" },
 
772
    { "Hawaiian",              "haw" }, /* Yes, "haw", not "cpe".  */
 
773
    { "Hebrew",                "he" },
 
774
    { "Hindi",                 "hi" },
 
775
    { "Hungarian",             "hu" },
 
776
    { "Icelandic",             "is" },
 
777
    { "Indonesian",            "id" },
 
778
    { "Inuktitut",             "iu" },
 
779
    { "Irish",                 "ga" },
 
780
    { "Italian",               "it" },
 
781
    { "Japanese",              "ja" },
 
782
    { "Javanese",              "jv" },
 
783
    { "Kalaallisut",           "kl" },
 
784
    { "Kannada",               "kn" },
 
785
    { "Kashmiri",              "ks" },
 
786
    { "Kazakh",                "kk" },
 
787
    { "Khmer",                 "km" },
 
788
    { "Kinyarwanda",           "rw" },
 
789
    { "Kirghiz",               "ky" },
 
790
    { "Korean",                "ko" },
 
791
    { "Kurdish",               "ku" },
 
792
    { "Latin",                 "la" },
 
793
    { "Latvian",               "lv" },
 
794
    { "Lithuanian",            "lt" },
 
795
    { "Macedonian",            "mk" },
 
796
    { "Malagasy",              "mg" },
 
797
    { "Malay",                 "ms" },
 
798
    { "Malayalam",             "ml" },
 
799
    { "Maltese",               "mt" },
 
800
    { "Manx",                  "gv" },
 
801
    { "Marathi",               "mr" },
 
802
    { "Moldavian",             "mo" },
 
803
    { "Mongolian",             "mn" },
 
804
    { "Nepali",                "ne" },
 
805
    { "Norwegian",             "nb" }, /* Yes, "nb", not the obsolete "no".  */
 
806
    { "Nyanja",                "ny" },
 
807
    { "Nynorsk",               "nn" },
 
808
    { "Oriya",                 "or" },
 
809
    { "Oromo",                 "om" },
 
810
    { "Panjabi",               "pa" },
 
811
    { "Pashto",                "ps" },
 
812
    { "Persian",               "fa" },
 
813
    { "Polish",                "pl" },
 
814
    { "Portuguese",            "pt" },
 
815
    { "Portuguese, Brazilian", "pt_BR" },
 
816
    { "Punjabi",               "pa" },
 
817
    { "Pushto",                "ps" },
 
818
    { "Quechua",               "qu" },
 
819
    { "Romanian",              "ro" },
 
820
    { "Ruanda",                "rw" },
 
821
    { "Rundi",                 "rn" },
 
822
    { "Russian",               "ru" },
 
823
    { "Sami",                  "se_NO" }, /* Not just "se".  */
 
824
    { "Sanskrit",              "sa" },
 
825
    { "Scottish",              "gd" },
 
826
    { "Serbian",               "sr" },
 
827
    { "Simplified Chinese",    "zh_CN" },
 
828
    { "Sindhi",                "sd" },
 
829
    { "Sinhalese",             "si" },
 
830
    { "Slovak",                "sk" },
 
831
    { "Slovenian",             "sl" },
 
832
    { "Somali",                "so" },
 
833
    { "Spanish",               "es" },
 
834
    { "Sundanese",             "su" },
 
835
    { "Swahili",               "sw" },
 
836
    { "Swedish",               "sv" },
 
837
    { "Tagalog",               "tl" },
 
838
    { "Tajik",                 "tg" },
 
839
    { "Tajiki",                "tg" },
 
840
    { "Tamil",                 "ta" },
 
841
    { "Tatar",                 "tt" },
 
842
    { "Telugu",                "te" },
 
843
    { "Thai",                  "th" },
 
844
    { "Tibetan",               "bo" },
 
845
    { "Tigrinya",              "ti" },
 
846
    { "Tongan",                "to" },
 
847
    { "Traditional Chinese",   "zh_TW" },
 
848
    { "Turkish",               "tr" },
 
849
    { "Turkmen",               "tk" },
 
850
    { "Uighur",                "ug" },
 
851
    { "Ukrainian",             "uk" },
 
852
    { "Urdu",                  "ur" },
 
853
    { "Uzbek",                 "uz" },
 
854
    { "Vietnamese",            "vi" },
 
855
    { "Welsh",                 "cy" },
 
856
    { "Yiddish",               "yi" }
 
857
  };
 
858
 
 
859
  /* Convert new-style locale names with language tags (ISO 639 and ISO 15924)
 
860
     to Unix (ISO 639 and ISO 3166) names.  */
 
861
  typedef struct { const char langtag[7+1]; const char unixy[12+1]; }
 
862
          langtag_entry;
 
863
  static const langtag_entry langtag_table[] = {
 
864
    /* MacOS X has "az-Arab", "az-Cyrl", "az-Latn".
 
865
       The default script for az on Unix is Latin.  */
 
866
    { "az-Latn", "az" },
 
867
    /* MacOS X has "ga-dots".  Does not yet exist on Unix.  */
 
868
    { "ga-dots", "ga" },
 
869
    /* MacOS X has "kk-Cyrl".  Does not yet exist on Unix.  */
 
870
    /* MacOS X has "mn-Cyrl", "mn-Mong".
 
871
       The default script for mn on Unix is Cyrillic.  */
 
872
    { "mn-Cyrl", "mn" },
 
873
    /* MacOS X has "ms-Arab", "ms-Latn".
 
874
       The default script for ms on Unix is Latin.  */
 
875
    { "ms-Latn", "ms" },
 
876
    /* MacOS X has "tg-Cyrl".
 
877
       The default script for tg on Unix is Cyrillic.  */
 
878
    { "tg-Cyrl", "tg" },
 
879
    /* MacOS X has "tk-Cyrl".  Does not yet exist on Unix.  */
 
880
    /* MacOS X has "tt-Cyrl".
 
881
       The default script for tt on Unix is Cyrillic.  */
 
882
    { "tt-Cyrl", "tt" },
 
883
    /* MacOS X has "zh-Hans", "zh-Hant".
 
884
       Country codes are used to distinguish these on Unix.  */
 
885
    { "zh-Hans", "zh_CN" },
 
886
    { "zh-Hant", "zh_TW" }
 
887
  };
 
888
 
 
889
  /* Convert script names (ISO 15924) to Unix conventions.
 
890
     See http://www.unicode.org/iso15924/iso15924-codes.html  */
 
891
  typedef struct { const char script[4+1]; const char unixy[9+1]; }
 
892
          script_entry;
 
893
  static const script_entry script_table[] = {
 
894
    { "Arab", "arabic" },
 
895
    { "Cyrl", "cyrillic" },
 
896
    { "Mong", "mongolian" }
 
897
  };
 
898
 
 
899
  /* Step 1: Convert using legacy_table.  */
 
900
  if (name[0] >= 'A' && name[0] <= 'Z')
 
901
    {
 
902
      unsigned int i1, i2;
 
903
      i1 = 0;
 
904
      i2 = sizeof (legacy_table) / sizeof (legacy_entry);
 
905
      while (i2 - i1 > 1)
 
906
        {
 
907
          /* At this point we know that if name occurs in legacy_table,
 
908
             its index must be >= i1 and < i2.  */
 
909
          unsigned int i = (i1 + i2) >> 1;
 
910
          const legacy_entry *p = &legacy_table[i];
 
911
          if (strcmp (name, p->legacy) < 0)
 
912
            i2 = i;
 
913
          else
 
914
            i1 = i;
 
915
        }
 
916
      if (strcmp (name, legacy_table[i1].legacy) == 0)
 
917
        {
 
918
          strcpy (name, legacy_table[i1].unixy);
 
919
          return;
 
920
        }
 
921
    }
 
922
 
 
923
  /* Step 2: Convert using langtag_table and script_table.  */
 
924
  if (strlen (name) == 7 && name[2] == '-')
 
925
    {
 
926
      unsigned int i1, i2;
 
927
      i1 = 0;
 
928
      i2 = sizeof (langtag_table) / sizeof (langtag_entry);
 
929
      while (i2 - i1 > 1)
 
930
        {
 
931
          /* At this point we know that if name occurs in langtag_table,
 
932
             its index must be >= i1 and < i2.  */
 
933
          unsigned int i = (i1 + i2) >> 1;
 
934
          const langtag_entry *p = &langtag_table[i];
 
935
          if (strcmp (name, p->langtag) < 0)
 
936
            i2 = i;
 
937
          else
 
938
            i1 = i;
 
939
        }
 
940
      if (strcmp (name, langtag_table[i1].langtag) == 0)
 
941
        {
 
942
          strcpy (name, langtag_table[i1].unixy);
 
943
          return;
 
944
        }
 
945
 
 
946
      i1 = 0;
 
947
      i2 = sizeof (script_table) / sizeof (script_entry);
 
948
      while (i2 - i1 > 1)
 
949
        {
 
950
          /* At this point we know that if (name + 3) occurs in script_table,
 
951
             its index must be >= i1 and < i2.  */
 
952
          unsigned int i = (i1 + i2) >> 1;
 
953
          const script_entry *p = &script_table[i];
 
954
          if (strcmp (name + 3, p->script) < 0)
 
955
            i2 = i;
 
956
          else
 
957
            i1 = i;
 
958
        }
 
959
      if (strcmp (name + 3, script_table[i1].script) == 0)
 
960
        {
 
961
          name[2] = '@';
 
962
          strcpy (name + 3, script_table[i1].unixy);
 
963
          return;
 
964
        }
 
965
    }
 
966
 
 
967
  /* Step 3: Convert new-style dash to Unix underscore. */
 
968
  {
 
969
    char *p;
 
970
    for (p = name; *p != '\0'; p++)
 
971
      if (*p == '-')
 
972
        *p = '_';
 
973
  }
 
974
}
 
975
 
 
976
#endif
 
977
 
697
978
/* XPG3 defines the result of 'setlocale (category, NULL)' as:
698
979
   "Directs 'setlocale()' to query 'category' and return the current
699
980
    setting of 'local'."
700
981
   However it does not specify the exact format.  Neither do SUSV2 and
701
982
   ISO C 99.  So we can use this feature only on selected systems (e.g.
702
983
   those using GNU C Library).  */
703
 
#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2)
 
984
#if defined _LIBC || (defined __GLIBC__ && __GLIBC__ >= 2)
704
985
# define HAVE_LOCALE_NULL
705
986
#endif
706
987
 
707
988
/* Determine the current locale's name, and canonicalize it into XPG syntax
708
 
     language[_territory[.codeset]][@modifier]
 
989
     language[_territory][.codeset][@modifier]
709
990
   The codeset part in the result is not reliable; the locale_charset()
710
991
   should be used for codeset information instead.
711
992
   The result must not be freed; it is statically allocated.  */
712
993
 
713
994
const char *
714
 
_nl_locale_name_posix (int category, const char *categoryname)
 
995
gl_locale_name_posix (int category, const char *categoryname)
715
996
{
716
997
  /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
717
998
     On some systems this can be done by the 'setlocale' function itself.  */
738
1019
}
739
1020
 
740
1021
const char *
741
 
_nl_locale_name_default (void)
 
1022
gl_locale_name_default (void)
742
1023
{
743
1024
  /* POSIX:2001 says:
744
1025
     "All implementations shall define a locale as the default locale, to be
749
1030
      locale, customizing it for each location.  POSIX:2001 does not require
750
1031
      such a facility.  */
751
1032
 
752
 
#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined(WIN32))
 
1033
#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined(WIN32_NATIVE))
753
1034
 
754
1035
  /* The system does not have a way of setting the locale, other than the
755
1036
     POSIX specified environment variables.  We use C as default locale.  */
777
1058
 
778
1059
        if (CFStringGetCString (name, namebuf, sizeof(namebuf),
779
1060
                                kCFStringEncodingASCII))
780
 
          cached_localename = strdup (namebuf);
 
1061
          {
 
1062
            gl_locale_name_canonicalize (namebuf);
 
1063
            cached_localename = strdup (namebuf);
 
1064
          }
781
1065
        CFRelease (locale);
782
1066
#  elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */
783
1067
        CFTypeRef value =
787
1071
            && CFGetTypeID (value) == CFStringGetTypeID ()
788
1072
            && CFStringGetCString ((CFStringRef)value, namebuf, sizeof(namebuf),
789
1073
                                   kCFStringEncodingASCII))
790
 
          cached_localename = strdup (namebuf);
 
1074
          {
 
1075
            gl_locale_name_canonicalize (namebuf);
 
1076
            cached_localename = strdup (namebuf);
 
1077
          }
791
1078
#  endif
792
1079
        if (cached_localename == NULL)
793
1080
          cached_localename = "C";
797
1084
 
798
1085
# endif
799
1086
 
800
 
# if defined(WIN32) /* WIN32 */
 
1087
# if defined(WIN32_NATIVE) /* WIN32, not Cygwin */
801
1088
  {
802
1089
    LCID lcid;
803
1090
    LANGID langid;
1099
1386
      case LANG_SINDHI:
1100
1387
        switch (sub)
1101
1388
          {
1102
 
          case SUBLANG_SINDHI_INDIA: return "sd_IN";
1103
1389
          case SUBLANG_SINDHI_PAKISTAN: return "sd_PK";
 
1390
          case SUBLANG_SINDHI_AFGHANISTAN: return "sd_AF";
1104
1391
          }
1105
1392
        return "sd";
1106
1393
      case LANG_SINHALESE: return "si_LK";
1153
1440
          {
1154
1441
          /* FIXME: Adjust this when Tamazight locales appear on Unix.  */
1155
1442
          case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic";
1156
 
          case SUBLANG_TAMAZIGHT_LATIN: return "ber_MA@latin";
 
1443
          case SUBLANG_TAMAZIGHT_ALGERIA_LATIN: return "ber_DZ@latin";
1157
1444
          }
1158
1445
        return "ber_MA";
1159
1446
      case LANG_TAMIL:
1208
1495
}
1209
1496
 
1210
1497
const char *
1211
 
_nl_locale_name (int category, const char *categoryname)
 
1498
gl_locale_name (int category, const char *categoryname)
1212
1499
{
1213
1500
  const char *retval;
1214
1501
 
1215
 
  retval = _nl_locale_name_posix (category, categoryname);
 
1502
  retval = gl_locale_name_posix (category, categoryname);
1216
1503
  if (retval != NULL)
1217
1504
    return retval;
1218
1505
 
1219
 
  return _nl_locale_name_default ();
 
1506
  return gl_locale_name_default ();
1220
1507
}