• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
3  * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
4  * Copyright (C) 2007 Holger Hans Peter Freyther
5  * Copyright (C) 2008 Christian Dywan <christian@imendio.com>
6  * Copyright (C) 2008 Nuanti Ltd.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
21  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #include "config.h"
31 
32 #include "LocalizedStrings.h"
33 #include "NotImplemented.h"
34 #include "PlatformString.h"
35 
36 #include <gtk/gtk.h>
37 #include <glib/gi18n.h>
38 
39 namespace WebCore {
40 
gtkStockLabel(const char * stockID)41 static const char* gtkStockLabel(const char* stockID)
42 {
43     GtkStockItem item;
44     if (!gtk_stock_lookup(stockID, &item))
45         return stockID;
46     return item.label;
47 }
48 
submitButtonDefaultLabel()49 String submitButtonDefaultLabel()
50 {
51     return String::fromUTF8(_("Submit"));
52 }
53 
inputElementAltText()54 String inputElementAltText()
55 {
56     return String::fromUTF8(_("Submit"));
57 }
58 
resetButtonDefaultLabel()59 String resetButtonDefaultLabel()
60 {
61     return String::fromUTF8(_("Reset"));
62 }
63 
searchableIndexIntroduction()64 String searchableIndexIntroduction()
65 {
66     return String::fromUTF8(_("_Searchable Index"));
67 }
68 
fileButtonChooseFileLabel()69 String fileButtonChooseFileLabel()
70 {
71     return String::fromUTF8(_("Choose File"));
72 }
73 
fileButtonNoFileSelectedLabel()74 String fileButtonNoFileSelectedLabel()
75 {
76     return String::fromUTF8(_("(None)"));
77 }
78 
contextMenuItemTagOpenLinkInNewWindow()79 String contextMenuItemTagOpenLinkInNewWindow()
80 {
81     return String::fromUTF8(_("Open Link in New _Window"));
82 }
83 
contextMenuItemTagDownloadLinkToDisk()84 String contextMenuItemTagDownloadLinkToDisk()
85 {
86     return String::fromUTF8(_("_Download Linked File"));
87 }
88 
contextMenuItemTagCopyLinkToClipboard()89 String contextMenuItemTagCopyLinkToClipboard()
90 {
91     return String::fromUTF8(_("Copy Link Loc_ation"));
92 }
93 
contextMenuItemTagOpenImageInNewWindow()94 String contextMenuItemTagOpenImageInNewWindow()
95 {
96     return String::fromUTF8(_("Open _Image in New Window"));
97 }
98 
contextMenuItemTagDownloadImageToDisk()99 String contextMenuItemTagDownloadImageToDisk()
100 {
101     return String::fromUTF8(_("Sa_ve Image As"));
102 }
103 
contextMenuItemTagCopyImageToClipboard()104 String contextMenuItemTagCopyImageToClipboard()
105 {
106     return String::fromUTF8(_("Cop_y Image"));
107 }
108 
contextMenuItemTagOpenFrameInNewWindow()109 String contextMenuItemTagOpenFrameInNewWindow()
110 {
111     return String::fromUTF8(_("Open _Frame in New Window"));
112 }
113 
contextMenuItemTagCopy()114 String contextMenuItemTagCopy()
115 {
116     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_COPY));
117     return stockLabel;
118 }
119 
contextMenuItemTagDelete()120 String contextMenuItemTagDelete()
121 {
122     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_DELETE));
123     return stockLabel;
124 }
125 
contextMenuItemTagSelectAll()126 String contextMenuItemTagSelectAll()
127 {
128 #if GTK_CHECK_VERSION(2,10,0)
129     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_SELECT_ALL));
130 #else
131     static String stockLabel = String::fromUTF8(_("Select _All"));
132 #endif
133     return stockLabel;
134 }
135 
contextMenuItemTagUnicode()136 String contextMenuItemTagUnicode()
137 {
138     return String::fromUTF8(_("_Insert Unicode Control Character"));
139 }
140 
contextMenuItemTagInputMethods()141 String contextMenuItemTagInputMethods()
142 {
143     return String::fromUTF8(_("Input _Methods"));
144 }
145 
contextMenuItemTagGoBack()146 String contextMenuItemTagGoBack()
147 {
148     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_GO_BACK));
149     return stockLabel;
150 }
151 
contextMenuItemTagGoForward()152 String contextMenuItemTagGoForward()
153 {
154     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_GO_FORWARD));
155     return stockLabel;
156 }
157 
contextMenuItemTagStop()158 String contextMenuItemTagStop()
159 {
160     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_STOP));
161     return stockLabel;
162 }
163 
contextMenuItemTagReload()164 String contextMenuItemTagReload()
165 {
166     return String::fromUTF8(_("_Reload"));
167 }
168 
contextMenuItemTagCut()169 String contextMenuItemTagCut()
170 {
171     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_CUT));
172     return stockLabel;
173 }
174 
contextMenuItemTagPaste()175 String contextMenuItemTagPaste()
176 {
177     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_PASTE));
178     return stockLabel;
179 }
180 
contextMenuItemTagNoGuessesFound()181 String contextMenuItemTagNoGuessesFound()
182 {
183     return String::fromUTF8(_("No Guesses Found"));
184 }
185 
contextMenuItemTagIgnoreSpelling()186 String contextMenuItemTagIgnoreSpelling()
187 {
188     return String::fromUTF8(_("_Ignore Spelling"));
189 }
190 
contextMenuItemTagLearnSpelling()191 String contextMenuItemTagLearnSpelling()
192 {
193     return String::fromUTF8(_("_Learn Spelling"));
194 }
195 
contextMenuItemTagSearchWeb()196 String contextMenuItemTagSearchWeb()
197 {
198     return String::fromUTF8(_("_Search the Web"));
199 }
200 
contextMenuItemTagLookUpInDictionary()201 String contextMenuItemTagLookUpInDictionary()
202 {
203     return String::fromUTF8(_("_Look Up in Dictionary"));
204 }
205 
contextMenuItemTagOpenLink()206 String contextMenuItemTagOpenLink()
207 {
208     return String::fromUTF8(_("_Open Link"));
209 }
210 
contextMenuItemTagIgnoreGrammar()211 String contextMenuItemTagIgnoreGrammar()
212 {
213     return String::fromUTF8(_("Ignore _Grammar"));
214 }
215 
contextMenuItemTagSpellingMenu()216 String contextMenuItemTagSpellingMenu()
217 {
218     return String::fromUTF8(_("Spelling and _Grammar"));
219 }
220 
contextMenuItemTagShowSpellingPanel(bool show)221 String contextMenuItemTagShowSpellingPanel(bool show)
222 {
223     return String::fromUTF8(show ? _("_Show Spelling and Grammar") : _("_Hide Spelling and Grammar"));
224 }
225 
contextMenuItemTagCheckSpelling()226 String contextMenuItemTagCheckSpelling()
227 {
228     return String::fromUTF8(_("_Check Document Now"));
229 }
230 
contextMenuItemTagCheckSpellingWhileTyping()231 String contextMenuItemTagCheckSpellingWhileTyping()
232 {
233     return String::fromUTF8(_("Check Spelling While _Typing"));
234 }
235 
contextMenuItemTagCheckGrammarWithSpelling()236 String contextMenuItemTagCheckGrammarWithSpelling()
237 {
238     return String::fromUTF8(_("Check _Grammar With Spelling"));
239 }
240 
contextMenuItemTagFontMenu()241 String contextMenuItemTagFontMenu()
242 {
243     return String::fromUTF8(_("_Font"));
244 }
245 
contextMenuItemTagBold()246 String contextMenuItemTagBold()
247 {
248     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_BOLD));
249     return stockLabel;
250 }
251 
contextMenuItemTagItalic()252 String contextMenuItemTagItalic()
253 {
254     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_ITALIC));
255     return stockLabel;
256 }
257 
contextMenuItemTagUnderline()258 String contextMenuItemTagUnderline()
259 {
260     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_UNDERLINE));
261     return stockLabel;
262 }
263 
contextMenuItemTagOutline()264 String contextMenuItemTagOutline()
265 {
266     return String::fromUTF8(_("_Outline"));
267 }
268 
contextMenuItemTagInspectElement()269 String contextMenuItemTagInspectElement()
270 {
271     return String::fromUTF8(_("Inspect _Element"));
272 }
273 
searchMenuNoRecentSearchesText()274 String searchMenuNoRecentSearchesText()
275 {
276     return String::fromUTF8(_("No recent searches"));
277 }
278 
searchMenuRecentSearchesText()279 String searchMenuRecentSearchesText()
280 {
281     return String::fromUTF8(_("Recent searches"));
282 }
283 
searchMenuClearRecentSearchesText()284 String searchMenuClearRecentSearchesText()
285 {
286     return String::fromUTF8(_("_Clear recent searches"));
287 }
288 
AXDefinitionListTermText()289 String AXDefinitionListTermText()
290 {
291     return String::fromUTF8(_("term"));
292 }
293 
AXDefinitionListDefinitionText()294 String AXDefinitionListDefinitionText()
295 {
296     return String::fromUTF8(_("definition"));
297 }
298 
AXButtonActionVerb()299 String AXButtonActionVerb()
300 {
301     return String::fromUTF8(_("press"));
302 }
303 
AXRadioButtonActionVerb()304 String AXRadioButtonActionVerb()
305 {
306     return String::fromUTF8(_("select"));
307 }
308 
AXTextFieldActionVerb()309 String AXTextFieldActionVerb()
310 {
311     return String::fromUTF8(_("activate"));
312 }
313 
AXCheckedCheckBoxActionVerb()314 String AXCheckedCheckBoxActionVerb()
315 {
316     return String::fromUTF8(_("uncheck"));
317 }
318 
AXUncheckedCheckBoxActionVerb()319 String AXUncheckedCheckBoxActionVerb()
320 {
321     return String::fromUTF8(_("check"));
322 }
323 
AXLinkActionVerb()324 String AXLinkActionVerb()
325 {
326     return String::fromUTF8(_("jump"));
327 }
328 
multipleFileUploadText(unsigned numberOfFiles)329 String multipleFileUploadText(unsigned numberOfFiles)
330 {
331     // FIXME: If this file gets localized, this should really be localized as one string with a wildcard for the number.
332     return String::number(numberOfFiles) + String::fromUTF8(_(" files"));
333 }
334 
unknownFileSizeText()335 String unknownFileSizeText()
336 {
337     return String::fromUTF8(_("Unknown"));
338 }
339 
imageTitle(const String & filename,const IntSize & size)340 String imageTitle(const String& filename, const IntSize& size)
341 {
342     notImplemented();
343     return String();
344 }
345 
346 }
347