Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: third_party/WebKit/Source/platform/text/PlatformLocale.cpp

Issue 2737263002: Fixed "characters" typo in message validation when input length is 1 (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011,2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011,2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 String Locale::validationMessageTooLongText(unsigned valueLength, 205 String Locale::validationMessageTooLongText(unsigned valueLength,
206 int maxLength) { 206 int maxLength) {
207 return queryString(WebLocalizedString::ValidationTooLong, 207 return queryString(WebLocalizedString::ValidationTooLong,
208 convertToLocalizedNumber(String::number(valueLength)), 208 convertToLocalizedNumber(String::number(valueLength)),
209 convertToLocalizedNumber(String::number(maxLength))); 209 convertToLocalizedNumber(String::number(maxLength)));
210 } 210 }
211 211
212 String Locale::validationMessageTooShortText(unsigned valueLength, 212 String Locale::validationMessageTooShortText(unsigned valueLength,
213 int minLength) { 213 int minLength) {
214 return queryString(WebLocalizedString::ValidationTooShort, 214 if (valueLength == 1) {
215 return queryString(WebLocalizedString::ValidationTooShort,
216 convertToLocalizedNumber(String::number(valueLength)),
217 convertToLocalizedNumber(String::number(minLength)));
218 }
219
220 return queryString(WebLocalizedString::ValidationTooShortPlural,
215 convertToLocalizedNumber(String::number(valueLength)), 221 convertToLocalizedNumber(String::number(valueLength)),
216 convertToLocalizedNumber(String::number(minLength))); 222 convertToLocalizedNumber(String::number(minLength)));
217 } 223 }
218 224
219 String Locale::weekFormatInLDML() { 225 String Locale::weekFormatInLDML() {
220 String templ = queryString(WebLocalizedString::WeekFormatTemplate); 226 String templ = queryString(WebLocalizedString::WeekFormatTemplate);
221 // Converts a string like "Week $2, $1" to an LDML date format pattern like 227 // Converts a string like "Week $2, $1" to an LDML date format pattern like
222 // "'Week 'ww', 'yyyy". 228 // "'Week 'ww', 'yyyy".
223 StringBuilder builder; 229 StringBuilder builder;
224 unsigned literalStart = 0; 230 unsigned literalStart = 0;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 : dateTimeFormatWithSeconds()); 464 : dateTimeFormatWithSeconds());
459 break; 465 break;
460 case DateComponents::Invalid: 466 case DateComponents::Invalid:
461 ASSERT_NOT_REACHED(); 467 ASSERT_NOT_REACHED();
462 break; 468 break;
463 } 469 }
464 return builder.toString(); 470 return builder.toString();
465 } 471 }
466 472
467 } // namespace blink 473 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698