[xbuild] Implement FileLogger . Fix #676650 .
[mono.git] / tools / locale-builder / CultureInfoEntry.cs
index b6448e687aa92982462b16a955633ee48c1029c6..fb9f642e2420449bbb9f702b218fbecfc3a41649 100644 (file)
@@ -15,7 +15,13 @@ namespace Mono.Tools.LocaleBuilder {
 
         public class CultureInfoEntry : Entry {
 
-                public string Language;
+               public static CultureInfoEntry ShallowCopy (CultureInfoEntry e)
+               {
+                       return (CultureInfoEntry) e.MemberwiseClone ();
+               }
+
+                string language;
+
                 public string Territory;
                 public string EnglishName;
                 public string DisplayName;
@@ -27,6 +33,7 @@ namespace Mono.Tools.LocaleBuilder {
                 public string Lcid;
                 public string ParentLcid;
                 public string SpecificLcid;
+                public int RegionId = -1;
                 public DateTimeFormatEntry DateTimeFormatEntry;
                 public NumberFormatEntry NumberFormatEntry;
                 public TextInfoEntry TextInfoEntry;
@@ -43,11 +50,20 @@ namespace Mono.Tools.LocaleBuilder {
                         NumberFormatEntry = new NumberFormatEntry ();
                 }
 
+                public string Language {
+                        get {
+                                return language;
+                        }
+                        set {
+                                language = (value == "zh") ? "zh-CHS" : value;
+                        }
+                }
+
                 public string Name {
                         get {
                                 if (Territory == null)
                                         return Language;
-                                return Language + "-" + Territory;
+                                return (Language.StartsWith ("zh") ? "zh" : Language) + "-" + Territory;
                         }
                 }
 
@@ -61,16 +77,17 @@ namespace Mono.Tools.LocaleBuilder {
                 public void AppendTableRow (StringBuilder builder)
                 {
                         builder.Append ("\t{");
-                        builder.AppendFormat ("{0}, {1}, {2}, " +
-                                        "{3}, {4}, {5}, " +
-                                        "{6}, {7}, {8}, " +
-                                        "{9}, {10}, " +
-                                        "{11}, " +
-                                        "{12}, {13}, {14}",
-                                        Lcid, ParentLcid, SpecificLcid,
+                        builder.AppendFormat ("{0}, {1}, {2}, {3}," +
+                                        "{4}, {5}, {6}, " +
+                                        "{7}, {8}, {9}, " +
+                                        "{10}, {11}, {12}, " +
+                                        "{13}, " +
+                                        "{14}, {15}, {16}",
+                                        Lcid, ParentLcid, SpecificLcid, RegionId,
                                         EncodeStringIdx (Name), EncodeStringIdx (IcuName), EncodeStringIdx (EnglishName),
                                         EncodeStringIdx (DisplayName), EncodeStringIdx (NativeName), EncodeStringIdx (Win3Lang),
                                         EncodeStringIdx (ISO3Lang), EncodeStringIdx (ISO2Lang),
+                                        EncodeStringIdx (Territory),
                                         ValuesString (CalendarData),
                                         DateTimeFormatEntry == null ? -1 : DateTimeFormatEntry.Row,
                                         NumberFormatEntry == null ? -1 : NumberFormatEntry.Row,