| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 26 matching lines...) Expand all Loading... |
| 37 #include "public/platform/Platform.h" | 37 #include "public/platform/Platform.h" |
| 38 #include "public/platform/WebString.h" | 38 #include "public/platform/WebString.h" |
| 39 #include "wtf/text/StringBuilder.h" | 39 #include "wtf/text/StringBuilder.h" |
| 40 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
| 41 | 41 |
| 42 using WebKit::WebLocalizedString; | 42 using WebKit::WebLocalizedString; |
| 43 using WebKit::WebString; | 43 using WebKit::WebString; |
| 44 | 44 |
| 45 namespace WebCore { | 45 namespace WebCore { |
| 46 | 46 |
| 47 String queryLocalizedString(WebLocalizedString::Name name) | 47 static String query(WebLocalizedString::Name name) |
| 48 { | 48 { |
| 49 return WebKit::Platform::current()->queryLocalizedString(name); | 49 return WebKit::Platform::current()->queryLocalizedString(name); |
| 50 } | 50 } |
| 51 | 51 |
| 52 String queryLocalizedString(WebLocalizedString::Name name, const String& paramet
er) | 52 static String query(WebLocalizedString::Name name, const WebString& parameter) |
| 53 { | 53 { |
| 54 return WebKit::Platform::current()->queryLocalizedString(name, parameter); | 54 return WebKit::Platform::current()->queryLocalizedString(name, parameter); |
| 55 } | 55 } |
| 56 | 56 |
| 57 String queryLocalizedString(WebLocalizedString::Name name, const String& paramet
er1, const String& parameter2) | 57 static String query(WebLocalizedString::Name name, const WebString& parameter1,
const WebString& parameter2) |
| 58 { | 58 { |
| 59 return WebKit::Platform::current()->queryLocalizedString(name, parameter1, p
arameter2); | 59 return WebKit::Platform::current()->queryLocalizedString(name, parameter1, p
arameter2); |
| 60 } | 60 } |
| 61 | 61 |
| 62 static String query(WebLocalizedString::Name name) | |
| 63 { | |
| 64 return queryLocalizedString(name); | |
| 65 } | |
| 66 | |
| 67 static String query(WebLocalizedString::Name name, const WebString& parameter) | |
| 68 { | |
| 69 return queryLocalizedString(name, parameter); | |
| 70 } | |
| 71 | |
| 72 static String query(WebLocalizedString::Name name, const WebString& parameter1,
const WebString& parameter2) | |
| 73 { | |
| 74 return queryLocalizedString(name, parameter1, parameter2); | |
| 75 } | |
| 76 | |
| 77 String searchableIndexIntroduction() | 62 String searchableIndexIntroduction() |
| 78 { | 63 { |
| 79 return query(WebLocalizedString::SearchableIndexIntroduction); | 64 return query(WebLocalizedString::SearchableIndexIntroduction); |
| 80 } | 65 } |
| 81 | 66 |
| 82 String submitButtonDefaultLabel() | 67 String submitButtonDefaultLabel() |
| 83 { | 68 { |
| 84 return query(WebLocalizedString::SubmitButtonDefaultLabel); | 69 return query(WebLocalizedString::SubmitButtonDefaultLabel); |
| 85 } | 70 } |
| 86 | 71 |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 String validationMessageValueMissingForSelectText() | 445 String validationMessageValueMissingForSelectText() |
| 461 { | 446 { |
| 462 return query(WebLocalizedString::ValidationValueMissingForSelect); | 447 return query(WebLocalizedString::ValidationValueMissingForSelect); |
| 463 } | 448 } |
| 464 | 449 |
| 465 String validationMessageTypeMismatchText() | 450 String validationMessageTypeMismatchText() |
| 466 { | 451 { |
| 467 return query(WebLocalizedString::ValidationTypeMismatch); | 452 return query(WebLocalizedString::ValidationTypeMismatch); |
| 468 } | 453 } |
| 469 | 454 |
| 470 String validationMessageTypeMismatchForEmailText() | |
| 471 { | |
| 472 return query(WebLocalizedString::ValidationTypeMismatchForEmail); | |
| 473 } | |
| 474 | |
| 475 String validationMessageTypeMismatchForMultipleEmailText() | |
| 476 { | |
| 477 return query(WebLocalizedString::ValidationTypeMismatchForMultipleEmail); | |
| 478 } | |
| 479 | |
| 480 String validationMessageTypeMismatchForURLText() | 455 String validationMessageTypeMismatchForURLText() |
| 481 { | 456 { |
| 482 return query(WebLocalizedString::ValidationTypeMismatchForURL); | 457 return query(WebLocalizedString::ValidationTypeMismatchForURL); |
| 483 } | 458 } |
| 484 | 459 |
| 485 String validationMessagePatternMismatchText() | 460 String validationMessagePatternMismatchText() |
| 486 { | 461 { |
| 487 return query(WebLocalizedString::ValidationPatternMismatch); | 462 return query(WebLocalizedString::ValidationPatternMismatch); |
| 488 } | 463 } |
| 489 | 464 |
| 490 String validationMessageTooLongText(int valueLength, int maxLength) | 465 String validationMessageTooLongText(int valueLength, int maxLength) |
| 491 { | 466 { |
| 492 return query(WebLocalizedString::ValidationTooLong, String::number(valueLeng
th), String::number(maxLength)); | 467 return query(WebLocalizedString::ValidationTooLong, String::number(valueLeng
th), String::number(maxLength)); |
| 493 } | 468 } |
| 494 | 469 |
| 495 String validationMessageRangeUnderflowText(const String& minimum) | 470 String validationMessageRangeUnderflowText(const String& minimum) |
| 496 { | 471 { |
| 497 return query(WebLocalizedString::ValidationRangeUnderflow, minimum); | 472 return query(WebLocalizedString::ValidationRangeUnderflow, minimum); |
| 498 } | 473 } |
| 499 | 474 |
| 500 String validationMessageRangeOverflowText(const String& maximum) | 475 String validationMessageRangeOverflowText(const String& maximum) |
| 501 { | 476 { |
| 502 return query(WebLocalizedString::ValidationRangeOverflow, maximum); | 477 return query(WebLocalizedString::ValidationRangeOverflow, maximum); |
| 503 } | 478 } |
| 504 | 479 |
| 505 String validationMessageStepMismatchText(const String& base, const String& step) | |
| 506 { | |
| 507 return query(WebLocalizedString::ValidationStepMismatch, base, step); | |
| 508 } | |
| 509 | |
| 510 String validationMessageBadInputForNumberText() | 480 String validationMessageBadInputForNumberText() |
| 511 { | 481 { |
| 512 return query(WebLocalizedString::ValidationBadInputForNumber); | 482 return query(WebLocalizedString::ValidationBadInputForNumber); |
| 513 } | 483 } |
| 514 | 484 |
| 515 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 485 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
| 516 String validationMessageBadInputForDateTimeText() | 486 String validationMessageBadInputForDateTimeText() |
| 517 { | 487 { |
| 518 return query(WebLocalizedString::ValidationBadInputForDateTime); | 488 return query(WebLocalizedString::ValidationBadInputForDateTime); |
| 519 } | 489 } |
| 520 #endif | 490 #endif |
| 521 | 491 |
| 522 } // namespace WebCore | 492 } // namespace WebCore |
| OLD | NEW |