Merge pull request #2023 from juergenhoetzel/master
[mono.git] / tools / locale-builder / Driver.cs
index 17d8a32c1625d1578a296638a719fb9002364a18..3907485baf297ebbf7bac4d6c0a66c013e42ff3d 100644 (file)
@@ -1000,6 +1000,12 @@ namespace Mono.Tools.LocaleBuilder
                                nodes = node.SelectNodes ("months/monthContext[@type='stand-alone']/monthWidth[@type='wide']/month");
                                ProcessAllNodes (nodes, df.MonthNames, AddOrReplaceValue);
 
+                               if (df.MonthNames != null) {
+                                       if (ci.Name == "sv" || ci.Name == "sv-SE") {
+                                               ToLower (df.MonthNames);
+                                       }
+                               }
+
                                // Apply global rule first <alias source="locale" path="../../monthContext[@type='format']/monthWidth[@type='abbreviated']"/>
                                if (ci.Name == "ja" || ci.Name == "ja-JP") {
                                        // Use common number style
@@ -1010,6 +1016,12 @@ namespace Mono.Tools.LocaleBuilder
                                        ProcessAllNodes (nodes, df.AbbreviatedMonthNames, AddOrReplaceValue);
                                }
 
+                               if (df.AbbreviatedMonthNames != null) {
+                                       if (ci.Name == "sv" || ci.Name == "sv-SE") {
+                                               ToLower (df.AbbreviatedMonthNames);
+                                       }
+                               }
+
                                nodes = node.SelectNodes ("months/monthContext[@type='format']/monthWidth[@type='wide']/month");
                                if (nodes != null) {
                                        ProcessAllNodes (nodes, df.MonthGenitiveNames, AddOrReplaceValue);
@@ -1027,6 +1039,12 @@ namespace Mono.Tools.LocaleBuilder
                                nodes = node.SelectNodes ("days/dayContext[@type='stand-alone']/dayWidth[@type='abbreviated']/day");
                                ProcessAllNodes (nodes, df.AbbreviatedDayNames, AddOrReplaceDayValue);
 
+                               if (df.AbbreviatedDayNames != null) {
+                                       if (ci.Name == "sv" || ci.Name == "sv-SE") {
+                                               ToLower (df.AbbreviatedDayNames);
+                                       }
+                               }
+
                                // TODO: This is not really ShortestDayNames as .NET uses it
                                // Apply global rules first <alias source="locale" path="../../dayContext[@type='stand-alone']/dayWidth[@type='narrow']"/>
                                nodes = node.SelectNodes ("days/dayContext[@type='format']/dayWidth[@type='narrow']/day");
@@ -1152,6 +1170,7 @@ namespace Mono.Tools.LocaleBuilder
                        // .net has incorrect separators for some countries and we want to be compatible
                        switch (ci.Name) {
                        case "es-ES":
+                       case "es":
                                // es-ES does not have group separator but .net has '.'
                                value = ".";
                                break;
@@ -1171,6 +1190,19 @@ namespace Mono.Tools.LocaleBuilder
                        }
                }
 
+               static void ToLower (string[] values)
+               {
+                       if (values == null)
+                               return;
+
+                       for (int i = 0; i < values.Length; ++i) {
+                               if (values [i] == null)
+                                       continue;
+
+                               values [i] = values [i].ToLower ();
+                       }
+               }
+
                string GetInfinitySymbol (CultureInfoEntry ci)
                {
                        // TODO: Add more