| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | |
| 3 * | |
| 4 * Redistribution and use in source and binary forms, with or without | |
| 5 * modification, are permitted provided that the following conditions | |
| 6 * are met: | |
| 7 * 1. Redistributions of source code must retain the above copyright | |
| 8 * notice, this list of conditions and the following disclaimer. | |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | |
| 10 * notice, this list of conditions and the following disclaimer in the | |
| 11 * documentation and/or other materials provided with the distribution. | |
| 12 * | |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 24 */ | |
| 25 | |
| 26 #include "config.h" | |
| 27 #include "LocalizedStrings.h" | |
| 28 #include "PlatformString.h" | |
| 29 #include "IntSize.h" | |
| 30 | |
| 31 #undef LOG | |
| 32 | |
| 33 #include "base/logging.h" | |
| 34 #include "base/file_util.h" | |
| 35 #include "base/string16.h" | |
| 36 #include "base/string_util.h" | |
| 37 #include "grit/webkit_strings.h" | |
| 38 #include "webkit/glue/glue_util.h" | |
| 39 #include "webkit/glue/webkit_glue.h" | |
| 40 | |
| 41 | |
| 42 using namespace WebCore; | |
| 43 | |
| 44 inline String GetLocalizedString(int message_id) { | |
| 45 const string16& str = webkit_glue::GetLocalizedString(message_id); | |
| 46 return webkit_glue::String16ToString(str); | |
| 47 } | |
| 48 | |
| 49 String WebCore::searchableIndexIntroduction() { | |
| 50 return GetLocalizedString(IDS_SEARCHABLE_INDEX_INTRO); | |
| 51 } | |
| 52 String WebCore::submitButtonDefaultLabel() { | |
| 53 return GetLocalizedString(IDS_FORM_SUBMIT_LABEL); | |
| 54 } | |
| 55 String WebCore::inputElementAltText() { | |
| 56 return GetLocalizedString(IDS_FORM_INPUT_ALT); | |
| 57 } | |
| 58 String WebCore::resetButtonDefaultLabel() { | |
| 59 return GetLocalizedString(IDS_FORM_RESET_LABEL); | |
| 60 } | |
| 61 String WebCore::fileButtonChooseFileLabel() { | |
| 62 return GetLocalizedString(IDS_FORM_FILE_BUTTON_LABEL); | |
| 63 } | |
| 64 String WebCore::fileButtonNoFileSelectedLabel() { | |
| 65 return GetLocalizedString(IDS_FORM_FILE_NO_FILE_LABEL); | |
| 66 } | |
| 67 | |
| 68 String WebCore::searchMenuNoRecentSearchesText() { | |
| 69 return GetLocalizedString(IDS_RECENT_SEARCHES_NONE); | |
| 70 } | |
| 71 String WebCore::searchMenuRecentSearchesText() { | |
| 72 return GetLocalizedString(IDS_RECENT_SEARCHES); | |
| 73 } | |
| 74 String WebCore::searchMenuClearRecentSearchesText() { | |
| 75 return GetLocalizedString(IDS_RECENT_SEARCHES_CLEAR); | |
| 76 } | |
| 77 | |
| 78 // A11y strings. | |
| 79 String WebCore::AXWebAreaText() { | |
| 80 return GetLocalizedString(IDS_AX_ROLE_WEB_AREA); | |
| 81 } | |
| 82 String WebCore::AXLinkText() { | |
| 83 return GetLocalizedString(IDS_AX_ROLE_LINK); | |
| 84 } | |
| 85 String WebCore::AXListMarkerText() { | |
| 86 return GetLocalizedString(IDS_AX_ROLE_LIST_MARKER); | |
| 87 } | |
| 88 String WebCore::AXImageMapText() { | |
| 89 return GetLocalizedString(IDS_AX_ROLE_IMAGE_MAP); | |
| 90 } | |
| 91 String WebCore::AXHeadingText() { | |
| 92 return GetLocalizedString(IDS_AX_ROLE_HEADING); | |
| 93 } | |
| 94 String WebCore::AXDefinitionListTermText() { | |
| 95 NOTIMPLEMENTED(); | |
| 96 return String("term"); | |
| 97 } | |
| 98 String WebCore::AXDefinitionListDefinitionText() { | |
| 99 NOTIMPLEMENTED(); | |
| 100 return String("definition"); | |
| 101 } | |
| 102 String WebCore::AXButtonActionVerb() { | |
| 103 return GetLocalizedString(IDS_AX_BUTTON_ACTION_VERB); | |
| 104 } | |
| 105 String WebCore::AXRadioButtonActionVerb() { | |
| 106 return GetLocalizedString(IDS_AX_RADIO_BUTTON_ACTION_VERB); | |
| 107 } | |
| 108 String WebCore::AXTextFieldActionVerb() { | |
| 109 return GetLocalizedString(IDS_AX_TEXT_FIELD_ACTION_VERB); | |
| 110 } | |
| 111 String WebCore::AXCheckedCheckBoxActionVerb() { | |
| 112 return GetLocalizedString(IDS_AX_CHECKED_CHECK_BOX_ACTION_VERB); | |
| 113 } | |
| 114 String WebCore::AXUncheckedCheckBoxActionVerb() { | |
| 115 return GetLocalizedString(IDS_AX_UNCHECKED_CHECK_BOX_ACTION_VERB); | |
| 116 } | |
| 117 String WebCore::AXLinkActionVerb() { | |
| 118 return GetLocalizedString(IDS_AX_LINK_ACTION_VERB); | |
| 119 } | |
| 120 | |
| 121 String WebCore::multipleFileUploadText(unsigned number_of_files) { | |
| 122 return webkit_glue::String16ToString(ReplaceStringPlaceholders( | |
| 123 webkit_glue::GetLocalizedString(IDS_FORM_FILE_MULTIPLE_UPLOAD), | |
| 124 WideToUTF16Hack(UintToWString(number_of_files)), | |
| 125 NULL)); | |
| 126 } | |
| 127 // Used in FTPDirectoryDocument.cpp | |
| 128 String WebCore::unknownFileSizeText() { | |
| 129 return String(); | |
| 130 } | |
| 131 | |
| 132 // The following two functions are not declared in LocalizedStrings.h. | |
| 133 // They are used by the menu for the HTML keygen tag. | |
| 134 namespace WebCore { | |
| 135 String keygenMenuHighGradeKeySize() { | |
| 136 return GetLocalizedString(IDS_KEYGEN_HIGH_GRADE_KEY); | |
| 137 } | |
| 138 String keygenMenuMediumGradeKeySize() { | |
| 139 return GetLocalizedString(IDS_KEYGEN_MED_GRADE_KEY); | |
| 140 } | |
| 141 | |
| 142 // Used in ImageDocument.cpp as the title for pages when that page is an image. | |
| 143 String imageTitle(const String& filename, const IntSize& size) { | |
| 144 // C3 97 is UTF-8 for U+00D7 (multiplication sign). | |
| 145 std::string size_str = StringPrintf(" (%d\xC3\x97%d)", | |
| 146 size.width(), size.height()); | |
| 147 return filename + webkit_glue::StdStringToString(size_str); | |
| 148 } | |
| 149 | |
| 150 } //namespace WebCore | |
| 151 | |
| 152 // We don't use these strings, so they return an empty String. We can't just | |
| 153 // make them asserts because webcore still calls them. | |
| 154 String WebCore::contextMenuItemTagOpenLinkInNewWindow() { return String(); } | |
| 155 String WebCore::contextMenuItemTagDownloadLinkToDisk() { return String(); } | |
| 156 String WebCore::contextMenuItemTagCopyLinkToClipboard() { return String(); } | |
| 157 String WebCore::contextMenuItemTagOpenImageInNewWindow() { return String(); } | |
| 158 String WebCore::contextMenuItemTagDownloadImageToDisk() { return String(); } | |
| 159 String WebCore::contextMenuItemTagCopyImageToClipboard() { return String(); } | |
| 160 String WebCore::contextMenuItemTagOpenFrameInNewWindow() { return String(); } | |
| 161 String WebCore::contextMenuItemTagCopy() { return String(); } | |
| 162 String WebCore::contextMenuItemTagGoBack() { return String(); } | |
| 163 String WebCore::contextMenuItemTagGoForward() { return String(); } | |
| 164 String WebCore::contextMenuItemTagStop() { return String(); } | |
| 165 String WebCore::contextMenuItemTagReload() { return String(); } | |
| 166 String WebCore::contextMenuItemTagCut() { return String(); } | |
| 167 String WebCore::contextMenuItemTagPaste() { return String(); } | |
| 168 String WebCore::contextMenuItemTagNoGuessesFound() { return String(); } | |
| 169 String WebCore::contextMenuItemTagIgnoreSpelling() { return String(); } | |
| 170 String WebCore::contextMenuItemTagLearnSpelling() { return String(); } | |
| 171 String WebCore::contextMenuItemTagSearchWeb() { return String(); } | |
| 172 String WebCore::contextMenuItemTagLookUpInDictionary() { return String(); } | |
| 173 String WebCore::contextMenuItemTagOpenLink() { return String(); } | |
| 174 String WebCore::contextMenuItemTagIgnoreGrammar() { return String(); } | |
| 175 String WebCore::contextMenuItemTagSpellingMenu() { return String(); } | |
| 176 String WebCore::contextMenuItemTagCheckSpelling() { return String(); } | |
| 177 String WebCore::contextMenuItemTagCheckSpellingWhileTyping() { return String();
} | |
| 178 String WebCore::contextMenuItemTagCheckGrammarWithSpelling() { return String();
} | |
| 179 String WebCore::contextMenuItemTagFontMenu() { return String(); } | |
| 180 String WebCore::contextMenuItemTagBold() { return String(); } | |
| 181 String WebCore::contextMenuItemTagItalic() { return String(); } | |
| 182 String WebCore::contextMenuItemTagUnderline() { return String(); } | |
| 183 String WebCore::contextMenuItemTagOutline() { return String(); } | |
| 184 String WebCore::contextMenuItemTagWritingDirectionMenu() { return String(); } | |
| 185 String WebCore::contextMenuItemTagTextDirectionMenu() { return String(); } | |
| 186 String WebCore::contextMenuItemTagDefaultDirection() { return String(); } | |
| 187 String WebCore::contextMenuItemTagLeftToRight() { return String(); } | |
| 188 String WebCore::contextMenuItemTagRightToLeft() { return String(); } | |
| 189 String WebCore::contextMenuItemTagInspectElement() { return String(); } | |
| 190 String WebCore::contextMenuItemTagShowSpellingPanel(bool show) { return String()
; } | |
| 191 // TODO(scherkus): These should return something. | |
| 192 String WebCore::mediaElementLiveBroadcastStateText() { return String(); } | |
| 193 String WebCore::mediaElementLoadingStateText() { return String(); } | |
| OLD | NEW |