Imported Upstream version 4.2.0.179

Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent 183bba2c9a
commit 6992685b86
7507 changed files with 90259 additions and 657307 deletions

View File

@@ -174,10 +174,6 @@ namespace Mono.Tools.LocaleBuilder
writer.WriteLine ("{0}: {1}", "NumberGroupSeparator", nf.NumberGroupSeparator);
Dump (writer, nf.NumberGroupSizes, "NumberGroupSizes", true);
writer.WriteLine ("{0}: {1}", "NumberNegativePattern", nf.NumberNegativePattern);
writer.WriteLine ("{0}: {1}", "PercentDecimalDigits", nf.PercentDecimalDigits);
writer.WriteLine ("{0}: {1}", "PercentDecimalSeparator", nf.PercentDecimalSeparator);
writer.WriteLine ("{0}: {1}", "PercentGroupSeparator", nf.PercentGroupSeparator);
Dump (writer, nf.PercentGroupSizes, "PercentGroupSizes", true);
writer.WriteLine ("{0}: {1}", "PercentNegativePattern", nf.PercentNegativePattern);
writer.WriteLine ("{0}: {1}", "PercentPositivePattern", nf.PercentPositivePattern);
writer.WriteLine ("{0}: {1}", "PercentSymbol", nf.PercentSymbol);
@@ -935,12 +931,10 @@ namespace Mono.Tools.LocaleBuilder
// We don't add 3 as it's for some arabic states only
switch (data.ThreeLetterISOLanguageName) {
case "amh":
data.NumberFormatEntry.NumberDecimalDigits =
data.NumberFormatEntry.PercentDecimalDigits = 1;
data.NumberFormatEntry.NumberDecimalDigits = 1;
break;
default:
data.NumberFormatEntry.NumberDecimalDigits =
data.NumberFormatEntry.PercentDecimalDigits = 2;
data.NumberFormatEntry.NumberDecimalDigits = 2;
break;
}
@@ -973,7 +967,7 @@ namespace Mono.Tools.LocaleBuilder
string calendar;
// Default calendar is for now always "gregorian"
switch (ci.Name) {
switch (ci.OriginalName) {
case "th": case "th-TH":
calendar = "buddhist";
ci.CalendarType = CalendarType.ThaiBuddhist; // typeof (ThaiBuddhistCalendar);
@@ -1006,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
@@ -1016,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);
@@ -1033,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");
@@ -1110,12 +1122,6 @@ namespace Mono.Tools.LocaleBuilder
node = doc.SelectSingleNode ("ldml/numbers/symbols");
if (node != null) {
el = node.SelectSingleNode ("decimal");
if (el != null) {
ni.NumberDecimalSeparator =
ni.PercentDecimalSeparator = el.InnerText;
}
el = node.SelectSingleNode ("plusSign");
if (el != null)
ni.PositiveSign = el.InnerText;
@@ -1179,9 +1185,20 @@ namespace Mono.Tools.LocaleBuilder
}
if (value != null) {
ni.NumberGroupSeparator =
ni.PercentGroupSeparator =
ni.CurrencyGroupSeparator = value;
ni.NumberGroupSeparator = ni.CurrencyGroupSeparator = value;
}
}
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 ();
}
}

View File

@@ -49,10 +49,12 @@ namespace Mono.Tools.LocaleBuilder
public string NumberGroupSeparator = ",";
public string[] NumberGroupSizes = new string[Constants.GROUP_SIZE];
public string NumberNegativePattern;
/*
public int PercentDecimalDigits;
public string PercentDecimalSeparator = ",";
public string PercentGroupSeparator = ",";
public string[] PercentGroupSizes = new string[Constants.GROUP_SIZE];
*/
public string PercentNegativePattern;
public string PercentPositivePattern;
public string PercentSymbol = "%";
@@ -89,8 +91,6 @@ namespace Mono.Tools.LocaleBuilder
builder.Append (EncodeStringIdx (CurrencyDecimalSeparator) + ", ");
builder.Append (EncodeStringIdx (CurrencyGroupSeparator) + ", ");
builder.Append (EncodeStringIdx (PercentDecimalSeparator) + ", ");
builder.Append (EncodeStringIdx (PercentGroupSeparator) + ", ");
builder.Append (EncodeStringIdx (NumberDecimalSeparator) + ", ");
builder.Append (EncodeStringIdx (NumberGroupSeparator) + ", ");
@@ -111,13 +111,10 @@ namespace Mono.Tools.LocaleBuilder
builder.Append (NumberNegativePattern + ", ");
builder.Append (CurrencyDecimalDigits + ", ");
builder.Append (PercentDecimalDigits + ", ");
builder.Append (NumberDecimalDigits + ", ");
AppendGroupSizes (builder, CurrencyGroupSizes);
builder.Append (", ");
AppendGroupSizes (builder, PercentGroupSizes);
builder.Append (", ");
AppendGroupSizes (builder, NumberGroupSizes);
builder.Append ('}');

View File

@@ -1 +1 @@
b2e7e8b961017e7fb586222c7827496d7c82d1f7
5acbc5535da9977890582be2151836a36f5070c6