+2007-01-03 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by John.
+
+ Call into WebKit to get localized strings for all of the context
+ menu item titles.
+
+ * page/mac/WebCoreViewFactory.h:
+ * platform/ContextMenu.cpp:
+ (WebCore::createAndAppendFontSubMenu):
+ (WebCore::createAndAppendSpellingAndGrammarSubMenu):
+ (WebCore::createAndAppendSpellingSubMenu):
+ (WebCore::createAndAppendSpeechSubMenu):
+ (WebCore::createAndAppendWritingDirectionSubMenu):
+ (WebCore::ContextMenu::populate):
+ (WebCore::ContextMenu::checkOrEnableIfNeeded):
+ * platform/LocalizedStrings.h:
+ * platform/mac/LocalizedStringsMac.mm:
+ (WebCore::contextMenuItemTagOpenLinkInNewWindow):
+ (WebCore::contextMenuItemTagDownloadLinkToDisk):
+ (WebCore::contextMenuItemTagCopyLinkToClipboard):
+ (WebCore::contextMenuItemTagOpenImageInNewWindow):
+ (WebCore::contextMenuItemTagDownloadImageToDisk):
+ (WebCore::contextMenuItemTagCopyImageToClipboard):
+ (WebCore::contextMenuItemTagOpenFrameInNewWindow):
+ (WebCore::contextMenuItemTagCopy):
+ (WebCore::contextMenuItemTagGoBack):
+ (WebCore::contextMenuItemTagGoForward):
+ (WebCore::contextMenuItemTagStop):
+ (WebCore::contextMenuItemTagReload):
+ (WebCore::contextMenuItemTagCut):
+ (WebCore::contextMenuItemTagPaste):
+ (WebCore::contextMenuItemTagNoGuessesFound):
+ (WebCore::contextMenuItemTagIgnoreSpelling):
+ (WebCore::contextMenuItemTagLearnSpelling):
+ (WebCore::contextMenuItemTagSearchInSpotlight):
+ (WebCore::contextMenuItemTagSearchWeb):
+ (WebCore::contextMenuItemTagLookUpInDictionary):
+ (WebCore::contextMenuItemTagOpenLink):
+ (WebCore::contextMenuItemTagIgnoreGrammar):
+ (WebCore::contextMenuItemTagSpellingMenu):
+ (WebCore::contextMenuItemTagShowSpellingPanel):
+ (WebCore::contextMenuItemTagCheckSpelling):
+ (WebCore::contextMenuItemTagCheckSpellingWhileTyping):
+ (WebCore::contextMenuItemTagCheckGrammarWithSpelling):
+ (WebCore::contextMenuItemTagFontMenu):
+ (WebCore::contextMenuItemTagShowFonts):
+ (WebCore::contextMenuItemTagBold):
+ (WebCore::contextMenuItemTagItalic):
+ (WebCore::contextMenuItemTagUnderline):
+ (WebCore::contextMenuItemTagOutline):
+ (WebCore::contextMenuItemTagStyles):
+ (WebCore::contextMenuItemTagShowColors):
+ (WebCore::contextMenuItemTagSpeechMenu):
+ (WebCore::contextMenuItemTagStartSpeaking):
+ (WebCore::contextMenuItemTagStopSpeaking):
+ (WebCore::contextMenuItemTagWritingDirectionMenu):
+ (WebCore::contextMenuItemTagDefaultDirection):
+ (WebCore::contextMenuItemTagLeftToRight):
+ (WebCore::contextMenuItemTagRightToLeft):
+
2007-01-03 Brady Eidson <beidson@apple.com>
Reviewed by Darin and Geoff
- (NSString *)fileButtonChooseFileLabel;
- (NSString *)fileButtonNoFileSelectedLabel;
+// Context menu item titles
+- (NSString *)contextMenuItemTagOpenLinkInNewWindow;
+- (NSString *)contextMenuItemTagDownloadLinkToDisk;
+- (NSString *)contextMenuItemTagCopyLinkToClipboard;
+- (NSString *)contextMenuItemTagOpenImageInNewWindow;
+- (NSString *)contextMenuItemTagDownloadImageToDisk;
+- (NSString *)contextMenuItemTagCopyImageToClipboard;
+- (NSString *)contextMenuItemTagOpenFrameInNewWindow;
+- (NSString *)contextMenuItemTagCopy;
+- (NSString *)contextMenuItemTagGoBack;
+- (NSString *)contextMenuItemTagGoForward;
+- (NSString *)contextMenuItemTagStop;
+- (NSString *)contextMenuItemTagReload;
+- (NSString *)contextMenuItemTagCut;
+- (NSString *)contextMenuItemTagPaste;
+- (NSString *)contextMenuItemTagNoGuessesFound;
+- (NSString *)contextMenuItemTagIgnoreSpelling;
+- (NSString *)contextMenuItemTagLearnSpelling;
+- (NSString *)contextMenuItemTagSearchInSpotlight;
+- (NSString *)contextMenuItemTagSearchWeb;
+- (NSString *)contextMenuItemTagLookUpInDictionary;
+- (NSString *)contextMenuItemTagOpenLink;
+- (NSString *)contextMenuItemTagIgnoreGrammar;
+- (NSString *)contextMenuItemTagSpellingMenu;
+- (NSString *)contextMenuItemTagShowSpellingPanel:(bool)show;
+- (NSString *)contextMenuItemTagCheckSpelling;
+- (NSString *)contextMenuItemTagCheckSpellingWhileTyping;
+- (NSString *)contextMenuItemTagCheckGrammarWithSpelling;
+- (NSString *)contextMenuItemTagFontMenu;
+- (NSString *)contextMenuItemTagShowFonts;
+- (NSString *)contextMenuItemTagBold;
+- (NSString *)contextMenuItemTagItalic;
+- (NSString *)contextMenuItemTagUnderline;
+- (NSString *)contextMenuItemTagOutline;
+- (NSString *)contextMenuItemTagStyles;
+- (NSString *)contextMenuItemTagShowColors;
+- (NSString *)contextMenuItemTagSpeechMenu;
+- (NSString *)contextMenuItemTagStartSpeaking;
+- (NSString *)contextMenuItemTagStopSpeaking;
+- (NSString *)contextMenuItemTagWritingDirectionMenu;
+- (NSString *)contextMenuItemTagDefaultDirection;
+- (NSString *)contextMenuItemTagLeftToRight;
+- (NSString *)contextMenuItemTagRightToLeft;
+
- (NSMenu *)cellMenuForSearchField;
- (NSString *)defaultLanguageCode;
#include "Frame.h"
#include "FrameLoader.h"
#include "KURL.h"
+#include "LocalizedStrings.h"
#include "Node.h"
#include "Page.h"
#include "ResourceRequest.h"
{
ContextMenu* fontMenu = new ContextMenu(result);
#if PLATFORM(MAC)
- ContextMenuItem showFonts(ActionType, ContextMenuItemTagShowFonts, "Show Fonts");
+ ContextMenuItem showFonts(ActionType, ContextMenuItemTagShowFonts, contextMenuItemTagShowFonts());
#endif
- ContextMenuItem bold(ActionType, ContextMenuItemTagBold, "Bold");
- ContextMenuItem italic(ActionType, ContextMenuItemTagItalic, "Italic");
- ContextMenuItem underline(ActionType, ContextMenuItemTagUnderline, "Underline");
- ContextMenuItem outline(ActionType, ContextMenuItemTagOutline, "Outline");
+ ContextMenuItem bold(ActionType, ContextMenuItemTagBold, contextMenuItemTagBold());
+ ContextMenuItem italic(ActionType, ContextMenuItemTagItalic, contextMenuItemTagItalic());
+ ContextMenuItem underline(ActionType, ContextMenuItemTagUnderline, contextMenuItemTagUnderline());
+ ContextMenuItem outline(ActionType, ContextMenuItemTagOutline, contextMenuItemTagOutline());
#if PLATFORM(MAC)
- ContextMenuItem styles(ActionType, ContextMenuItemTagStyles, "Styles...");
- ContextMenuItem showColors(ActionType, ContextMenuItemTagShowColors, "Show Colors");
+ ContextMenuItem styles(ActionType, ContextMenuItemTagStyles, contextMenuItemTagStyles());
+ ContextMenuItem showColors(ActionType, ContextMenuItemTagShowColors, contextMenuItemTagShowColors());
#endif
#if PLATFORM(MAC)
static void createAndAppendSpellingAndGrammarSubMenu(const HitTestResult& result, ContextMenuItem& spellingAndGrammarMenuItem)
{
ContextMenu* spellingAndGrammarMenu = new ContextMenu(result);
- ContextMenuItem showSpellingPanel(ActionType, ContextMenuItemTagShowSpellingPanel, "Show Spelling and Grammar");
- ContextMenuItem checkSpelling(ActionType, ContextMenuItemTagCheckSpelling, "Check Document Now");
- ContextMenuItem checkAsYouType(ActionType, ContextMenuItemTagCheckSpellingWhileTyping, "Check Spelling While Typing");
- ContextMenuItem grammarWithSpelling(ActionType, ContextMenuItemTagCheckGrammarWithSpelling, "Check Grammar With Spelling");
+ ContextMenuItem showSpellingPanel(ActionType, ContextMenuItemTagShowSpellingPanel,
+ contextMenuItemTagShowSpellingPanel(true));
+ ContextMenuItem checkSpelling(ActionType, ContextMenuItemTagCheckSpelling,
+ contextMenuItemTagCheckSpelling());
+ ContextMenuItem checkAsYouType(ActionType, ContextMenuItemTagCheckSpellingWhileTyping,
+ contextMenuItemTagCheckSpellingWhileTyping());
+ ContextMenuItem grammarWithSpelling(ActionType, ContextMenuItemTagCheckGrammarWithSpelling,
+ contextMenuItemTagCheckGrammarWithSpelling());
spellingAndGrammarMenu->appendItem(showSpellingPanel);
spellingAndGrammarMenu->appendItem(checkSpelling);
static void createAndAppendSpellingSubMenu(const HitTestResult& result, ContextMenuItem& spellingMenuItem)
{
ContextMenu* spellingMenu = new ContextMenu(result);
- ContextMenuItem showSpellingPanel(ActionType, ContextMenuItemTagShowSpellingPanel, "Spelling...");
- ContextMenuItem checkSpelling(ActionType, ContextMenuItemTagCheckSpelling, "Check Spelling");
- ContextMenuItem checkAsYouType(ActionType, ContextMenuItemTagCheckSpellingWhileTyping, "Check Spelling as You Type");
+ ContextMenuItem showSpellingPanel(ActionType, ContextMenuItemTagShowSpellingPanel,
+ contextMenuItemTagShowSpellingPanel(true));
+ ContextMenuItem checkSpelling(ActionType, ContextMenuItemTagCheckSpelling,
+ contextMenuItemTagCheckSpelling());
+ ContextMenuItem checkAsYouType(ActionType, ContextMenuItemTagCheckSpellingWhileTyping,
+ contextMenuItemTagCheckSpellingWhileTyping());
spellingMenu->appendItem(showSpellingPanel);
spellingMenu->appendItem(checkSpelling);
static void createAndAppendSpeechSubMenu(const HitTestResult& result, ContextMenuItem& speechMenuItem)
{
ContextMenu* speechMenu = new ContextMenu(result);
- ContextMenuItem start(ActionType, ContextMenuItemTagStartSpeaking, "Start Speaking");
- ContextMenuItem stop(ActionType, ContextMenuItemTagStartSpeaking, "Stop Speaking");
+ ContextMenuItem start(ActionType, ContextMenuItemTagStartSpeaking, contextMenuItemTagStartSpeaking());
+ ContextMenuItem stop(ActionType, ContextMenuItemTagStartSpeaking, contextMenuItemTagStartSpeaking());
speechMenu->appendItem(start);
speechMenu->appendItem(stop);
static void createAndAppendWritingDirectionSubMenu(const HitTestResult& result, ContextMenuItem& writingDirectionMenuItem)
{
ContextMenu* writingDirectionMenu = new ContextMenu(result);
- ContextMenuItem defaultItem(ActionType, ContextMenuItemTagDefaultDirection, "Default");
- ContextMenuItem ltr(ActionType, ContextMenuItemTagLeftToRight, "Left to Right");
- ContextMenuItem rtl(ActionType, ContextMenuItemTagRightToLeft, "Right to Left");
+ ContextMenuItem defaultItem(ActionType, ContextMenuItemTagDefaultDirection,
+ contextMenuItemTagDefaultDirection());
+ ContextMenuItem ltr(ActionType, ContextMenuItemTagLeftToRight, contextMenuItemTagLeftToRight());
+ ContextMenuItem rtl(ActionType, ContextMenuItemTagRightToLeft, contextMenuItemTagRightToLeft());
writingDirectionMenu->appendItem(defaultItem);
writingDirectionMenu->appendItem(ltr);
void ContextMenu::populate()
{
- ContextMenuItem OpenLinkItem(ActionType, ContextMenuItemTagOpenLink, "Open Link");
- ContextMenuItem OpenLinkInNewWindowItem(ActionType, ContextMenuItemTagOpenLinkInNewWindow, "Open Link in New Window");
- ContextMenuItem DownloadFileItem(ActionType, ContextMenuItemTagDownloadLinkToDisk, "Download Linked File");
- ContextMenuItem CopyLinkItem(ActionType, ContextMenuItemTagCopyLinkToClipboard, "Copy Link");
- ContextMenuItem OpenImageInNewWindowItem(ActionType, ContextMenuItemTagOpenImageInNewWindow, "Open Image in New Window");
- ContextMenuItem DownloadImageItem(ActionType, ContextMenuItemTagDownloadImageToDisk, "Download Image");
- ContextMenuItem CopyImageItem(ActionType, ContextMenuItemTagCopyImageToClipboard, "Copy Image");
+ ContextMenuItem OpenLinkItem(ActionType, ContextMenuItemTagOpenLink, contextMenuItemTagOpenLink());
+ ContextMenuItem OpenLinkInNewWindowItem(ActionType, ContextMenuItemTagOpenLinkInNewWindow,
+ contextMenuItemTagOpenLinkInNewWindow());
+ ContextMenuItem DownloadFileItem(ActionType, ContextMenuItemTagDownloadLinkToDisk,
+ contextMenuItemTagDownloadLinkToDisk());
+ ContextMenuItem CopyLinkItem(ActionType, ContextMenuItemTagCopyLinkToClipboard,
+ contextMenuItemTagCopyLinkToClipboard());
+ ContextMenuItem OpenImageInNewWindowItem(ActionType, ContextMenuItemTagOpenImageInNewWindow,
+ contextMenuItemTagOpenImageInNewWindow());
+ ContextMenuItem DownloadImageItem(ActionType, ContextMenuItemTagDownloadImageToDisk,
+ contextMenuItemTagDownloadImageToDisk());
+ ContextMenuItem CopyImageItem(ActionType, ContextMenuItemTagCopyImageToClipboard,
+ contextMenuItemTagCopyImageToClipboard());
#if PLATFORM(MAC)
- ContextMenuItem SearchSpotlightItem(ActionType, ContextMenuItemTagSearchInSpotlight, "Search in Spotlight");
+ ContextMenuItem SearchSpotlightItem(ActionType, ContextMenuItemTagSearchInSpotlight,
+ contextMenuItemTagSearchInSpotlight());
#endif
- ContextMenuItem SearchWebItem(ActionType, ContextMenuItemTagSearchWeb, "Search in Google");
- ContextMenuItem LookInDictionaryItem(ActionType, ContextMenuItemTagLookUpInDictionary, "Look Up in Dictionary");
- ContextMenuItem CopyItem(ActionType, ContextMenuItemTagCopy, "Copy");
- ContextMenuItem BackItem(ActionType, ContextMenuItemTagGoBack, "Back");
- ContextMenuItem ForwardItem(ActionType, ContextMenuItemTagGoForward, "Forward");
- ContextMenuItem StopItem(ActionType, ContextMenuItemTagStop, "Stop");
- ContextMenuItem ReloadItem(ActionType, ContextMenuItemTagReload, "Reload");
- ContextMenuItem OpenFrameItem(ActionType, ContextMenuItemTagOpenFrameInNewWindow, "Open Frame in New Window");
- ContextMenuItem NowGuessesItem(ActionType, ContextMenuItemTagNoGuessesFound, "No Guesses Found");
- ContextMenuItem IgnoreSpellingItem(ActionType, ContextMenuItemTagIgnoreSpelling, "Ignore Spelling");
- ContextMenuItem LearnSpellingItem(ActionType, ContextMenuItemTagLearnSpelling, "Learn Spelling");
- ContextMenuItem IgnoreGrammarItem(ActionType, ContextMenuItemTagIgnoreGrammar, "Ignore Grammar");
- ContextMenuItem CutItem(ActionType, ContextMenuItemTagCut, "Cut");
- ContextMenuItem PasteItem(ActionType, ContextMenuItemTagPaste, "Paste");
+ ContextMenuItem SearchWebItem(ActionType, ContextMenuItemTagSearchWeb, contextMenuItemTagSearchWeb());
+ ContextMenuItem LookInDictionaryItem(ActionType, ContextMenuItemTagLookUpInDictionary,
+ contextMenuItemTagLookUpInDictionary());
+ ContextMenuItem CopyItem(ActionType, ContextMenuItemTagCopy, contextMenuItemTagCopy());
+ ContextMenuItem BackItem(ActionType, ContextMenuItemTagGoBack, contextMenuItemTagGoBack());
+ ContextMenuItem ForwardItem(ActionType, ContextMenuItemTagGoForward, contextMenuItemTagGoForward());
+ ContextMenuItem StopItem(ActionType, ContextMenuItemTagStop, contextMenuItemTagStop());
+ ContextMenuItem ReloadItem(ActionType, ContextMenuItemTagReload, contextMenuItemTagReload());
+ ContextMenuItem OpenFrameItem(ActionType, ContextMenuItemTagOpenFrameInNewWindow,
+ contextMenuItemTagOpenFrameInNewWindow());
+ ContextMenuItem NowGuessesItem(ActionType, ContextMenuItemTagNoGuessesFound,
+ contextMenuItemTagNoGuessesFound());
+ ContextMenuItem IgnoreSpellingItem(ActionType, ContextMenuItemTagIgnoreSpelling,
+ contextMenuItemTagIgnoreSpelling());
+ ContextMenuItem LearnSpellingItem(ActionType, ContextMenuItemTagLearnSpelling,
+ contextMenuItemTagLearnSpelling());
+ ContextMenuItem IgnoreGrammarItem(ActionType, ContextMenuItemTagIgnoreGrammar,
+ contextMenuItemTagIgnoreGrammar());
+ ContextMenuItem CutItem(ActionType, ContextMenuItemTagCut, contextMenuItemTagCut());
+ ContextMenuItem PasteItem(ActionType, ContextMenuItemTagPaste, contextMenuItemTagPaste());
HitTestResult result = hitTestResult();
if (!inPasswordField) {
appendItem(*separatorItem());
#ifndef BUILDING_ON_TIGER
- ContextMenuItem SpellingAndGrammarMenuItem(SubmenuType, ContextMenuItemTagSpellingMenu, "Spelling and Grammar");
+ ContextMenuItem SpellingAndGrammarMenuItem(SubmenuType, ContextMenuItemTagSpellingMenu,
+ contextMenuItemTagSpellingMenu());
createAndAppendSpellingAndGrammarSubMenu(m_hitTestResult, SpellingAndGrammarMenuItem);
appendItem(SpellingAndGrammarMenuItem);
#else
- ContextMenuItem SpellingMenuItem(SubmenuType, ContextMenuItemTagSpellingMenu, "Spelling");
+ ContextMenuItem SpellingMenuItem(SubmenuType, ContextMenuItemTagSpellingMenu,
+ contextMenuItemTagSpellingMenu());
createAndAppendSpellingSubMenu(m_hitTestResult, SpellingMenuItem);
appendItem(SpellingMenuItem);
#endif
- ContextMenuItem FontMenuItem(SubmenuType, ContextMenuItemTagFontMenu, "Font");
+ ContextMenuItem FontMenuItem(SubmenuType, ContextMenuItemTagFontMenu,
+ contextMenuItemTagFontMenu());
createAndAppendFontSubMenu(m_hitTestResult, FontMenuItem);
appendItem(FontMenuItem);
#if PLATFORM(MAC)
- ContextMenuItem SpeechMenuItem(SubmenuType, ContextMenuItemTagSpeechMenu, "Speech");
+ ContextMenuItem SpeechMenuItem(SubmenuType, ContextMenuItemTagSpeechMenu,
+ contextMenuItemTagSpeechMenu());
createAndAppendSpeechSubMenu(m_hitTestResult, SpeechMenuItem);
appendItem(SpeechMenuItem);
#endif
- ContextMenuItem WritingDirectionMenuItem(SubmenuType, ContextMenuItemTagWritingDirectionMenu, "Writing Direction");
+ ContextMenuItem WritingDirectionMenuItem(SubmenuType, ContextMenuItemTagWritingDirectionMenu,
+ contextMenuItemTagWritingDirectionMenu());
createAndAppendWritingDirectionSubMenu(m_hitTestResult, WritingDirectionMenuItem);
appendItem(WritingDirectionMenuItem);
}
case ContextMenuItemTagShowSpellingPanel:
#ifndef BUILDING_ON_TIGER
if (frame->editor()->spellingPanelIsShowing())
- item.setTitle(String("Hide Spelling and Grammar")); // With UI_STRING this also sends "menu item title" as a parameter
+ item.setTitle(contextMenuItemTagWritingDirectionMenu(false));
else
- item.setTitle(String("Show Spelling and Grammar")); // With UI_STRING this also sends "menu item title" as a parameter
+ item.setTitle(contextMenuItemTagWritingDirectionMenu(true));
#endif
shouldEnable = frame->editor()->canEdit();
break;
String submitButtonDefaultLabel();
String fileButtonChooseFileLabel();
String fileButtonNoFileSelectedLabel();
+ String contextMenuItemTagOpenLinkInNewWindow();
+ String contextMenuItemTagDownloadLinkToDisk();
+ String contextMenuItemTagCopyLinkToClipboard();
+ String contextMenuItemTagOpenImageInNewWindow();
+ String contextMenuItemTagDownloadImageToDisk();
+ String contextMenuItemTagCopyImageToClipboard();
+ String contextMenuItemTagOpenFrameInNewWindow();
+ String contextMenuItemTagCopy();
+ String contextMenuItemTagGoBack();
+ String contextMenuItemTagGoForward();
+ String contextMenuItemTagStop();
+ String contextMenuItemTagReload();
+ String contextMenuItemTagCut();
+ String contextMenuItemTagPaste();
+ String contextMenuItemTagNoGuessesFound();
+ String contextMenuItemTagIgnoreSpelling();
+ String contextMenuItemTagLearnSpelling();
+ String contextMenuItemTagSearchWeb();
+ String contextMenuItemTagLookUpInDictionary();
+ String contextMenuItemTagOpenLink();
+ String contextMenuItemTagIgnoreGrammar();
+ String contextMenuItemTagSpellingMenu();
+ String contextMenuItemTagShowSpellingPanel(bool show);
+ String contextMenuItemTagCheckSpelling();
+ String contextMenuItemTagCheckSpellingWhileTyping();
+ String contextMenuItemTagCheckGrammarWithSpelling();
+ String contextMenuItemTagFontMenu();
+ String contextMenuItemTagBold();
+ String contextMenuItemTagItalic();
+ String contextMenuItemTagUnderline();
+ String contextMenuItemTagOutline();
+ String contextMenuItemTagWritingDirectionMenu();
+ String contextMenuItemTagDefaultDirection();
+ String contextMenuItemTagLeftToRight();
+ String contextMenuItemTagRightToLeft();
+#if PLATFORM(MAC)
+ String contextMenuItemTagSearchInSpotlight();
+ String contextMenuItemTagShowFonts();
+ String contextMenuItemTagStyles();
+ String contextMenuItemTagShowColors();
+ String contextMenuItemTagSpeechMenu();
+ String contextMenuItemTagStartSpeaking();
+ String contextMenuItemTagStopSpeaking();
+#endif
}
return String();
}
+String contextMenuItemTagOpenLinkInNewWindow()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenLinkInNewWindow];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagDownloadLinkToDisk()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDownloadLinkToDisk];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagCopyLinkToClipboard()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopyLinkToClipboard];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagOpenImageInNewWindow()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenImageInNewWindow];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagDownloadImageToDisk()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDownloadImageToDisk];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagCopyImageToClipboard()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopyImageToClipboard];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagOpenFrameInNewWindow()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenFrameInNewWindow];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagCopy()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopy];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagGoBack()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagGoBack];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagGoForward()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagGoForward];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagStop()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStop];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagReload()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagReload];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagCut()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCut];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagPaste()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagPaste];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagNoGuessesFound()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagNoGuessesFound];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagIgnoreSpelling()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagIgnoreSpelling];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagLearnSpelling()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLearnSpelling];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagSearchInSpotlight()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSearchInSpotlight];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagSearchWeb()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSearchWeb];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagLookUpInDictionary()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLookUpInDictionary];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagOpenLink()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenLink];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagIgnoreGrammar()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagIgnoreGrammar];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagSpellingMenu()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSpellingMenu];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagShowSpellingPanel(bool show)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:show];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagCheckSpelling()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckSpelling];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagCheckSpellingWhileTyping()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckSpellingWhileTyping];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagCheckGrammarWithSpelling()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckGrammarWithSpelling];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagFontMenu()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagFontMenu];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagShowFonts()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowFonts];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagBold()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagBold];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagItalic()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagItalic];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagUnderline()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagUnderline];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagOutline()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOutline];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagStyles()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStyles];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagShowColors()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowColors];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagSpeechMenu()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSpeechMenu];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagStartSpeaking()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStartSpeaking];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagStopSpeaking()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStopSpeaking];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagWritingDirectionMenu()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagWritingDirectionMenu];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagDefaultDirection()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDefaultDirection];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagLeftToRight()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLeftToRight];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
+String contextMenuItemTagRightToLeft()
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ return [[WebCoreViewFactory sharedFactory] contextMenuItemTagRightToLeft];
+ END_BLOCK_OBJC_EXCEPTIONS;
+ return String();
+}
+
}
+2007-01-03 Beth Dakin <bdakin@apple.com>
+
+ Reviewed by John.
+
+ Make localized strings for all of the context menu item titles that
+ are accessible to WebCore.
+
+ * English.lproj/Localizable.strings:
+ * WebCoreSupport/WebViewFactory.m:
+ (-[WebViewFactory contextMenuItemTagOpenLinkInNewWindow]):
+ (-[WebViewFactory contextMenuItemTagDownloadLinkToDisk]):
+ (-[WebViewFactory contextMenuItemTagCopyLinkToClipboard]):
+ (-[WebViewFactory contextMenuItemTagOpenImageInNewWindow]):
+ (-[WebViewFactory contextMenuItemTagDownloadImageToDisk]):
+ (-[WebViewFactory contextMenuItemTagCopyImageToClipboard]):
+ (-[WebViewFactory contextMenuItemTagOpenFrameInNewWindow]):
+ (-[WebViewFactory contextMenuItemTagCopy]):
+ (-[WebViewFactory contextMenuItemTagGoBack]):
+ (-[WebViewFactory contextMenuItemTagGoForward]):
+ (-[WebViewFactory contextMenuItemTagStop]):
+ (-[WebViewFactory contextMenuItemTagReload]):
+ (-[WebViewFactory contextMenuItemTagCut]):
+ (-[WebViewFactory contextMenuItemTagPaste]):
+ (-[WebViewFactory contextMenuItemTagNoGuessesFound]):
+ (-[WebViewFactory contextMenuItemTagIgnoreSpelling]):
+ (-[WebViewFactory contextMenuItemTagLearnSpelling]):
+ (-[WebViewFactory contextMenuItemTagSearchInSpotlight]):
+ (-[WebViewFactory contextMenuItemTagSearchWeb]):
+ (-[WebViewFactory contextMenuItemTagLookUpInDictionary]):
+ (-[WebViewFactory contextMenuItemTagOpenLink]):
+ (-[WebViewFactory contextMenuItemTagIgnoreGrammar]):
+ (-[WebViewFactory contextMenuItemTagSpellingMenu]):
+ (-[WebViewFactory contextMenuItemTagShowSpellingPanel:]):
+ (-[WebViewFactory contextMenuItemTagCheckSpelling]):
+ (-[WebViewFactory contextMenuItemTagCheckSpellingWhileTyping]):
+ (-[WebViewFactory contextMenuItemTagCheckGrammarWithSpelling]):
+ (-[WebViewFactory contextMenuItemTagFontMenu]):
+ (-[WebViewFactory contextMenuItemTagShowFonts]):
+ (-[WebViewFactory contextMenuItemTagBold]):
+ (-[WebViewFactory contextMenuItemTagItalic]):
+ (-[WebViewFactory contextMenuItemTagUnderline]):
+ (-[WebViewFactory contextMenuItemTagOutline]):
+ (-[WebViewFactory contextMenuItemTagStyles]):
+ (-[WebViewFactory contextMenuItemTagShowColors]):
+ (-[WebViewFactory contextMenuItemTagSpeechMenu]):
+ (-[WebViewFactory contextMenuItemTagStartSpeaking]):
+ (-[WebViewFactory contextMenuItemTagStopSpeaking]):
+ (-[WebViewFactory contextMenuItemTagWritingDirectionMenu]):
+ (-[WebViewFactory contextMenuItemTagDefaultDirection]):
+ (-[WebViewFactory contextMenuItemTagLeftToRight]):
+ (-[WebViewFactory contextMenuItemTagRightToLeft]):
+
2007-01-03 Brady Eidson <beidson@apple.com>
Reviewed by John Sullivan
return [NSUserDefaults _webkit_preferredLanguageCode];
}
+- (NSString *)contextMenuItemTagOpenLinkInNewWindow
+{
+ return UI_STRING("Open Link in New Window", "Open in New Window context menu item");
+}
+
+- (NSString *)contextMenuItemTagDownloadLinkToDisk
+{
+ return UI_STRING("Download Linked File", "Download Linked File context menu item");
+}
+
+- (NSString *)contextMenuItemTagCopyLinkToClipboard
+{
+ return UI_STRING("Copy Link", "Copy Link context menu item");
+}
+
+- (NSString *)contextMenuItemTagOpenImageInNewWindow
+{
+ return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item");
+}
+
+- (NSString *)contextMenuItemTagDownloadImageToDisk
+{
+ return UI_STRING("Download Image", "Download Image context menu item");
+}
+
+- (NSString *)contextMenuItemTagCopyImageToClipboard
+{
+ return UI_STRING("Copy Image", "Copy Image context menu item");
+}
+
+- (NSString *)contextMenuItemTagOpenFrameInNewWindow
+{
+ return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
+}
+
+- (NSString *)contextMenuItemTagCopy
+{
+ return UI_STRING("Copy", "Copy context menu item");
+}
+
+- (NSString *)contextMenuItemTagGoBack
+{
+ return UI_STRING("Back", "Back context menu item");
+}
+
+- (NSString *)contextMenuItemTagGoForward
+{
+ return UI_STRING("Forward", "Forward context menu item");
+}
+
+- (NSString *)contextMenuItemTagStop
+{
+ return UI_STRING("Stop", "Stop context menu item");
+}
+
+- (NSString *)contextMenuItemTagReload
+{
+ return UI_STRING("Reload", "Reload context menu item");
+}
+
+- (NSString *)contextMenuItemTagCut
+{
+ return UI_STRING("Cut", "Cut context menu item");
+}
+
+- (NSString *)contextMenuItemTagPaste
+{
+ return UI_STRING("Paste", "Paste context menu item");
+}
+
+- (NSString *)contextMenuItemTagNoGuessesFound
+{
+ return UI_STRING("No Guesses Found", "No Guesses Found context menu item");
+}
+
+- (NSString *)contextMenuItemTagIgnoreSpelling
+{
+ return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item");
+}
+
+- (NSString *)contextMenuItemTagLearnSpelling
+{
+ return UI_STRING("Learn Spelling", "Learn Spelling context menu item");
+}
+
+- (NSString *)contextMenuItemTagSearchInSpotlight
+{
+ return UI_STRING("Search in Spotlight", "Search in Spotlight context menu item");
+}
+
+- (NSString *)contextMenuItemTagSearchWeb
+{
+ return UI_STRING("Search in Google", "Search in Google context menu item");
+}
+
+- (NSString *)contextMenuItemTagLookUpInDictionary
+{
+ return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
+}
+
+- (NSString *)contextMenuItemTagOpenLink
+{
+ return UI_STRING("Open Link", "Open Link context menu item");
+}
+
+- (NSString *)contextMenuItemTagIgnoreGrammar
+{
+ return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item");
+}
+
+- (NSString *)contextMenuItemTagSpellingMenu
+{
+#ifndef BUILDING_ON_TIGER
+ return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item");
+#else
+ return UI_STRING("Spelling", "Spelling context sub-menu item");
+#endif
+}
+
+- (NSString *)contextMenuItemTagShowSpellingPanel:(bool)show
+{
+#ifndef BUILDING_ON_TIGER
+ if (show)
+ return UI_STRING("Show Spelling and Grammar", "menu item title");
+ return UI_STRING("Hide Spelling and Grammar", "menu item title");
+#else
+ return UI_STRING("Spelling...", "menu item title");
+#endif
+}
+
+- (NSString *)contextMenuItemTagCheckSpelling
+{
+#ifndef BUILDING_ON_TIGER
+ return UI_STRING("Check Document Now", "Check spelling context menu item");
+#else
+ return UI_STRING("Check Spelling", "Check spelling context menu item");
+#endif
+}
+
+- (NSString *)contextMenuItemTagCheckSpellingWhileTyping
+{
+#ifndef BUILDING_ON_TIGER
+ return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item");
+#else
+ return UI_STRING("Check Spelling as You Type", "Check spelling while typing context menu item");
+#endif
+}
+
+- (NSString *)contextMenuItemTagCheckGrammarWithSpelling
+{
+ return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item");
+}
+
+- (NSString *)contextMenuItemTagFontMenu
+{
+ return UI_STRING("Font", "Font context sub-menu item");
+}
+
+- (NSString *)contextMenuItemTagShowFonts
+{
+ return UI_STRING("Show Fonts", "Show fonts context menu item");
+}
+
+- (NSString *)contextMenuItemTagBold
+{
+ return UI_STRING("Bold", "Bold context menu item");
+}
+
+- (NSString *)contextMenuItemTagItalic
+{
+ return UI_STRING("Italic", "Italic context menu item");
+}
+
+- (NSString *)contextMenuItemTagUnderline
+{
+ return UI_STRING("Underline", "Underline context menu item");
+}
+
+- (NSString *)contextMenuItemTagOutline
+{
+ return UI_STRING("Outline", "Outline context menu item");
+}
+
+- (NSString *)contextMenuItemTagStyles
+{
+ return UI_STRING("Styles...", "Styles context menu item");
+}
+
+- (NSString *)contextMenuItemTagShowColors
+{
+ return UI_STRING("Show colors", "Show colors context menu item");
+}
+
+- (NSString *)contextMenuItemTagSpeechMenu
+{
+ return UI_STRING("Speech", "Speech context sub-menu item");
+}
+
+- (NSString *)contextMenuItemTagStartSpeaking
+{
+ return UI_STRING("Start Speaking", "Start speaking context menu item");
+}
+
+- (NSString *)contextMenuItemTagStopSpeaking
+{
+ return UI_STRING("Stop Speaking", "Stop speaking context menu item");
+}
+
+- (NSString *)contextMenuItemTagWritingDirectionMenu
+{
+ return UI_STRING("Writing Direction", "Writing direction context sub-menu item");
+}
+
+- (NSString *)contextMenuItemTagDefaultDirection
+{
+ return UI_STRING("Default", "Default writing direction context menu item");
+}
+
+- (NSString *)contextMenuItemTagLeftToRight
+{
+ return UI_STRING("Left to Right", "Left to Right context menu item");
+}
+
+- (NSString *)contextMenuItemTagRightToLeft
+{
+ return UI_STRING("Right to Left", "Right to Left context menu item");
+}
+
- (BOOL)objectIsTextMarker:(id)object
{
return object != nil && CFGetTypeID(object) == WKGetAXTextMarkerTypeID();