Skip to content

Commit

Permalink
2004-06-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
Browse files Browse the repository at this point in the history
	* Driver.cs: handle single quotes in the pattern. We used to fail for,
	at least, es and pt cultures with full patterns like
	"EEEE d' de 'MMMM' de 'yyyy".

svn path=/trunk/mono/; revision=29098
  • Loading branch information
gonzalop committed Jun 9, 2004
1 parent 06bdfa7 commit fa3fece
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
8 changes: 7 additions & 1 deletion tools/locale-builder/ChangeLog
@@ -1,3 +1,9 @@
2004-06-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>

* Driver.cs: handle single quotes in the pattern. We used to fail for,
at least, es and pt cultures with full patterns like
"EEEE d' de 'MMMM' de 'yyyy".

2004-06-08 Atsushi Enomoto <atsushi@ximian.com>

* Driver.cs : To make "extra pattern only" xxxFormatLength possible,
Expand Down Expand Up @@ -59,4 +65,4 @@

2004-05-24 Jackson Harper <jackson@ximian.com>

* Driver.cs: Filter on GetFiles so we only get the xml locale files.
* Driver.cs: Filter on GetFiles so we only get the xml locale files.
13 changes: 9 additions & 4 deletions tools/locale-builder/Driver.cs
Expand Up @@ -894,27 +894,28 @@ private void ParseFullDateFormat (DateTimeFormatEntry df, string full)
bool in_year_data = false;
int month_end = 0;
int year_end = 0;
bool inquote = false;

for (int i = 0; i < full.Length; i++) {
char c = full [i];
if (c == 'M') {
if (!inquote && c == 'M') {
month_day += c;
year_month += c;
in_year_data = true;
in_month_data = true;
month_end = month_day.Length;
year_end = year_month.Length;
} else if (Char.ToLower (c) == 'd') {
} else if (!inquote && Char.ToLower (c) == 'd') {
month_day += c;
in_month_data = true;
in_year_data = false;
month_end = month_day.Length;
} else if (Char.ToLower (c) == 'y') {
} else if (!inquote && Char.ToLower (c) == 'y') {
year_month += c;
in_year_data = true;
in_month_data = false;
year_end = year_month.Length;
} else if (control_chars.IndexOf (Char.ToLower (c)) >= 0) {
} else if (!inquote && control_chars.IndexOf (Char.ToLower (c)) >= 0) {
in_year_data = false;
in_month_data = false;
} else if (in_year_data || in_month_data) {
Expand All @@ -923,6 +924,10 @@ private void ParseFullDateFormat (DateTimeFormatEntry df, string full)
if (in_year_data)
year_month += c;
}

if (c == '\'') {
inquote = !inquote;
}
}

if (month_day != String.Empty) {
Expand Down

0 comments on commit fa3fece

Please sign in to comment.