Changeset 63904 in webkit


Ignore:
Timestamp:
Jul 22, 2010 11:18:26 AM (14 years ago)
Author:
weinig@apple.com
Message:

Patch for https://bugs.webkit.org/show_bug.cgi?id=42836
Add localized strings stubs for WebKit2.

Reviewed by Anders Carlsson.

WebCore:

  • Convert WebKit (mac) to use a LocalizationStrategy rather than the WebCoreViewFactory for localized strings.

Gets us below 200 tests failing in WebKitTestRunner.

  • WebCore.exp.in:
  • WebCore.xcodeproj/project.pbxproj:
  • page/mac/WebCoreViewFactory.h:
  • platform/LocalizationStrategy.h: Added.

(WebCore::LocalizationStrategy::~LocalizationStrategy):

  • platform/PlatformStrategies.h:

(WebCore::PlatformStrategies::pluginStrategy):
(WebCore::PlatformStrategies::localizationStrategy):
(WebCore::PlatformStrategies::PlatformStrategies):
(WebCore::PlatformStrategies::~PlatformStrategies):

  • platform/mac/LocalizedStringsMac.mm:

WebKit/mac:

  • Convert WebKit (mac) to use a LocalizationStrategy rather than the WebCoreViewFactory for localized strings.

Gets us below 200 tests failing in WebKitTestRunner.

  • WebCoreSupport/WebContextMenuClient.mm:

(fixMenusReceivedFromOldClients): Use LocalizedStrings rather than the factory.

  • WebCoreSupport/WebPlatformStrategies.h:
  • WebCoreSupport/WebPlatformStrategies.mm:
  • WebCoreSupport/WebViewFactory.mm:

WebKit2:

Gets us below 200 tests failing in WebKitTestRunner.

  • WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
  • WebProcess/WebCoreSupport/WebPlatformStrategies.h:
Location:
trunk
Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r63902 r63904  
     12010-07-22  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Patch for https://bugs.webkit.org/show_bug.cgi?id=42836
     6        Add localized strings stubs for WebKit2.
     7
     8        - Convert WebKit (mac) to use a LocalizationStrategy rather than the WebCoreViewFactory
     9          for localized strings.
     10
     11        Gets us below 200 tests failing in WebKitTestRunner.
     12
     13        * WebCore.exp.in:
     14        * WebCore.xcodeproj/project.pbxproj:
     15        * page/mac/WebCoreViewFactory.h:
     16        * platform/LocalizationStrategy.h: Added.
     17        (WebCore::LocalizationStrategy::~LocalizationStrategy):
     18        * platform/PlatformStrategies.h:
     19        (WebCore::PlatformStrategies::pluginStrategy):
     20        (WebCore::PlatformStrategies::localizationStrategy):
     21        (WebCore::PlatformStrategies::PlatformStrategies):
     22        (WebCore::PlatformStrategies::~PlatformStrategies):
     23        * platform/mac/LocalizedStringsMac.mm:
     24
    1252010-07-22  Andras Becsi  <abecsi@webkit.org>
    226
  • trunk/WebCore/WebCore.exp.in

    r63888 r63904  
    451451__ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv
    452452__ZN7WebCore22applicationIsAppleMailEv
     453__ZN7WebCore22contextMenuItemTagBoldEv
    453454__ZN7WebCore22counterValueForElementEPNS_7ElementE
    454455__ZN7WebCore22createFragmentFromTextEPNS_5RangeERKNS_6StringE
     
    462463__ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE
    463464__ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
     465__ZN7WebCore24contextMenuItemTagItalicEv
     466__ZN7WebCore24contextMenuItemTagStylesEv
    464467__ZN7WebCore24createFragmentFromMarkupEPNS_8DocumentERKNS_6StringES4_NS_27FragmentScriptingPermissionE
    465468__ZN7WebCore24decodeURLEscapeSequencesERKNS_6StringE
     
    475478__ZN7WebCore25PluginMainThreadScheduler16unregisterPluginEP4_NPP
    476479__ZN7WebCore25PluginMainThreadScheduler9schedulerEv
     480__ZN7WebCore25contextMenuItemTagOutlineEv
    477481__ZN7WebCore26CSSMutableStyleDeclarationC1Ev
    478482__ZN7WebCore26NetscapePlugInStreamLoader6createEPNS_5FrameEPNS_32NetscapePlugInStreamLoaderClientE
     483__ZN7WebCore26contextMenuItemTagFontMenuEv
     484__ZN7WebCore26contextMenuItemTagOpenLinkEv
    479485__ZN7WebCore26usesTestModeFocusRingColorEv
    480486__ZN7WebCore27CSSComputedStyleDeclarationC1EN3WTF10PassRefPtrINS_4NodeEEEbRKNS_6StringE
    481487__ZN7WebCore27applicationIsAdobeInstallerEv
     488__ZN7WebCore27contextMenuItemTagShowFontsEv
     489__ZN7WebCore27contextMenuItemTagUnderlineEv
     490__ZN7WebCore28contextMenuItemTagCapitalizeEv
     491__ZN7WebCore28contextMenuItemTagShowColorsEv
     492__ZN7WebCore28contextMenuItemTagSmartLinksEv
     493__ZN7WebCore28contextMenuItemTagSpeechMenuEv
     494__ZN7WebCore29contextMenuItemTagLeftToRightEv
     495__ZN7WebCore29contextMenuItemTagRightToLeftEv
     496__ZN7WebCore29contextMenuItemTagSmartDashesEv
     497__ZN7WebCore29contextMenuItemTagSmartQuotesEv
    482498__ZN7WebCore29isCharacterSmartReplaceExemptEib
    483499__ZN7WebCore29setUsesTestModeFocusRingColorEb
     500__ZN7WebCore30contextMenuItemTagSpellingMenuEv
     501__ZN7WebCore30contextMenuItemTagStopSpeakingEv
    484502__ZN7WebCore31CrossOriginPreflightResultCache5emptyEv
    485503__ZN7WebCore31CrossOriginPreflightResultCache6sharedEv
    486504__ZN7WebCore31applicationIsMicrosoftMessengerEv
     505__ZN7WebCore31contextMenuItemTagCheckSpellingEv
     506__ZN7WebCore31contextMenuItemTagIgnoreGrammarEv
     507__ZN7WebCore31contextMenuItemTagMakeLowerCaseEv
     508__ZN7WebCore31contextMenuItemTagMakeUpperCaseEv
     509__ZN7WebCore31contextMenuItemTagStartSpeakingEv
     510__ZN7WebCore32contextMenuItemTagInspectElementEv
     511__ZN7WebCore32contextMenuItemTagSmartCopyPasteEv
    487512__ZN7WebCore32plainTextToMallocAllocatedBufferEPKNS_5RangeERjb
     513__ZN7WebCore33contextMenuItemTagTextReplacementEv
    488514__ZN7WebCore33setDefaultThreadViolationBehaviorENS_23ThreadViolationBehaviorENS_20ThreadViolationRoundE
     515__ZN7WebCore34contextMenuItemTagDefaultDirectionEv
     516__ZN7WebCore35contextMenuItemTagShowSpellingPanelEb
     517__ZN7WebCore35contextMenuItemTagShowSubstitutionsEb
     518__ZN7WebCore35contextMenuItemTagSubstitutionsMenuEv
    489519__ZN7WebCore36InitializeLoggingChannelsIfNecessaryEv
     520__ZN7WebCore37contextMenuItemTagTransformationsMenuEv
     521__ZN7WebCore38contextMenuItemTagWritingDirectionMenuEv
    490522__ZN7WebCore3macERKNS_10CredentialE
    491523__ZN7WebCore3macERKNS_23AuthenticationChallengeE
     524__ZN7WebCore42contextMenuItemTagCheckGrammarWithSpellingEv
     525__ZN7WebCore42contextMenuItemTagCheckSpellingWhileTypingEv
     526__ZN7WebCore46contextMenuItemTagCorrectSpellingAutomaticallyEv
    492527__ZN7WebCore4Font11setCodePathENS0_8CodePathE
    493528__ZN7WebCore4Font18shouldUseSmoothingEv
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r63863 r63904  
    24512451                934F71440D5A6F5300018D69 /* AuthenticationChallenge.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F71430D5A6F5300018D69 /* AuthenticationChallenge.h */; settings = {ATTRIBUTES = (Private, ); }; };
    24522452                934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934FE9E40B5CA539003E4A73 /* FileChooser.cpp */; };
    2453                 935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 935207BD09BD410A00F2038D /* LocalizedStrings.h */; };
     2453                935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 935207BD09BD410A00F2038D /* LocalizedStrings.h */; settings = {ATTRIBUTES = (Private, ); }; };
    24542454                935207C009BD412100F2038D /* LocalizedStringsMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935207BF09BD412000F2038D /* LocalizedStringsMac.mm */; };
    24552455                9352084509BD43B900F2038D /* Language.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9352084409BD43B900F2038D /* Language.mm */; };
     
    45044504                BC5A86B50C3367E800EEA649 /* JSDOMSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */; };
    45054505                BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */; };
     4506                BC5CFCA911F793320099ED09 /* LocalizationStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5CFCA811F793320099ED09 /* LocalizationStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
    45064507                BC5EB5DB0E81B7EA00B25965 /* BorderValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB5DA0E81B7EA00B25965 /* BorderValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
    45074508                BC5EB5DD0E81B8DD00B25965 /* OutlineValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5EB5DC0E81B8DD00B25965 /* OutlineValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    1012610127                BC5A86B30C3367E800EEA649 /* JSDOMSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMSelection.cpp; sourceTree = "<group>"; };
    1012710128                BC5A86B40C3367E800EEA649 /* JSDOMSelection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMSelection.h; sourceTree = "<group>"; };
     10129                BC5CFCA811F793320099ED09 /* LocalizationStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizationStrategy.h; sourceTree = "<group>"; };
    1012810130                BC5EB5DA0E81B7EA00B25965 /* BorderValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BorderValue.h; path = style/BorderValue.h; sourceTree = "<group>"; };
    1012910131                BC5EB5DC0E81B8DD00B25965 /* OutlineValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OutlineValue.h; path = style/OutlineValue.h; sourceTree = "<group>"; };
     
    1622316225                                A7AD2F860EC89D07008AB002 /* LinkHash.h */,
    1622416226                                935207BD09BD410A00F2038D /* LocalizedStrings.h */,
     16227                                BC5CFCA811F793320099ED09 /* LocalizationStrategy.h */,
    1622516228                                A8239DFE09B3CF8A00B60641 /* Logging.cpp */,
    1622616229                                A8239DFF09B3CF8A00B60641 /* Logging.h */,
     
    1983919842                                CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
    1984019843                                8C6EA61A11EF7E0400FD8EE3 /* RuntimeEnabledFeatures.h in Headers */,
     19844                                BC5CFCA911F793320099ED09 /* LocalizationStrategy.h in Headers */,
    1984119845                                5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */,
    1984219846                        );
  • trunk/WebCore/page/mac/WebCoreViewFactory.h

    r61444 r63904  
    11/*
    2  * Copyright (C) 2003, 2005, 2009 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2003, 2005, 2009, 2010 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929@protocol WebCoreViewFactory
    3030
    31 - (NSString *)inputElementAltText;
    32 - (NSString *)resetButtonDefaultLabel;
    33 - (NSString *)searchableIndexIntroduction;
    34 - (NSString *)submitButtonDefaultLabel;
    35 - (NSString *)fileButtonChooseFileLabel;
    36 - (NSString *)fileButtonNoFileSelectedLabel;
    37 - (NSString *)copyImageUnknownFileLabel;
    38 
    39 #if ENABLE(CONTEXT_MENUS)
    40 // Context menu item titles
    41 - (NSString *)contextMenuItemTagOpenLinkInNewWindow;
    42 - (NSString *)contextMenuItemTagDownloadLinkToDisk;
    43 - (NSString *)contextMenuItemTagCopyLinkToClipboard;
    44 - (NSString *)contextMenuItemTagOpenImageInNewWindow;
    45 - (NSString *)contextMenuItemTagDownloadImageToDisk;
    46 - (NSString *)contextMenuItemTagCopyImageToClipboard;
    47 - (NSString *)contextMenuItemTagOpenFrameInNewWindow;
    48 - (NSString *)contextMenuItemTagCopy;
    49 - (NSString *)contextMenuItemTagGoBack;
    50 - (NSString *)contextMenuItemTagGoForward;
    51 - (NSString *)contextMenuItemTagStop;
    52 - (NSString *)contextMenuItemTagReload;
    53 - (NSString *)contextMenuItemTagCut;
    54 - (NSString *)contextMenuItemTagPaste;
    55 - (NSString *)contextMenuItemTagNoGuessesFound;
    56 - (NSString *)contextMenuItemTagIgnoreSpelling;
    57 - (NSString *)contextMenuItemTagLearnSpelling;
    58 - (NSString *)contextMenuItemTagSearchInSpotlight;
    59 - (NSString *)contextMenuItemTagSearchWeb;
    60 - (NSString *)contextMenuItemTagLookUpInDictionary;
    61 - (NSString *)contextMenuItemTagOpenLink;
    62 - (NSString *)contextMenuItemTagIgnoreGrammar;
    63 - (NSString *)contextMenuItemTagSpellingMenu;
    64 - (NSString *)contextMenuItemTagShowSpellingPanel:(bool)show;
    65 - (NSString *)contextMenuItemTagCheckSpelling;
    66 - (NSString *)contextMenuItemTagCheckSpellingWhileTyping;
    67 - (NSString *)contextMenuItemTagCheckGrammarWithSpelling;
    68 - (NSString *)contextMenuItemTagFontMenu;
    69 - (NSString *)contextMenuItemTagShowFonts;
    70 - (NSString *)contextMenuItemTagBold;
    71 - (NSString *)contextMenuItemTagItalic;
    72 - (NSString *)contextMenuItemTagUnderline;
    73 - (NSString *)contextMenuItemTagOutline;
    74 - (NSString *)contextMenuItemTagStyles;
    75 - (NSString *)contextMenuItemTagShowColors;
    76 - (NSString *)contextMenuItemTagSpeechMenu;
    77 - (NSString *)contextMenuItemTagStartSpeaking;
    78 - (NSString *)contextMenuItemTagStopSpeaking;
    79 - (NSString *)contextMenuItemTagWritingDirectionMenu;
    80 - (NSString *)contextMenuItemTagTextDirectionMenu;
    81 - (NSString *)contextMenuItemTagDefaultDirection;
    82 - (NSString *)contextMenuItemTagLeftToRight;
    83 - (NSString *)contextMenuItemTagRightToLeft;
    84 - (NSString *)contextMenuItemTagCorrectSpellingAutomatically;
    85 - (NSString *)contextMenuItemTagSubstitutionsMenu;
    86 - (NSString *)contextMenuItemTagShowSubstitutions:(bool)show;
    87 - (NSString *)contextMenuItemTagSmartCopyPaste;
    88 - (NSString *)contextMenuItemTagSmartQuotes;
    89 - (NSString *)contextMenuItemTagSmartDashes;
    90 - (NSString *)contextMenuItemTagSmartLinks;
    91 - (NSString *)contextMenuItemTagTextReplacement;
    92 - (NSString *)contextMenuItemTagTransformationsMenu;
    93 - (NSString *)contextMenuItemTagMakeUpperCase;
    94 - (NSString *)contextMenuItemTagMakeLowerCase;
    95 - (NSString *)contextMenuItemTagCapitalize;
    96 - (NSString *)contextMenuItemTagChangeBack:(NSString *)replacedString;
    97 - (NSString *)contextMenuItemTagInspectElement;
    98 #endif // ENABLE(CONTEXT_MENUS)
    99 
    100 - (NSString *)searchMenuNoRecentSearchesText;
    101 - (NSString *)searchMenuRecentSearchesText;
    102 - (NSString *)searchMenuClearRecentSearchesText;
    103 
    10431- (NSString *)defaultLanguageCode;
    105 
    106 - (NSString *)imageTitleForFilename:(NSString *)filename width:(int)width height:(int)height;
    10732
    10833- (BOOL)objectIsTextMarker:(id)object;
     
    12247- (void)unregisterUniqueIdForUIElement:(id)element;
    12348
    124 - (NSString *)AXWebAreaText;
    125 - (NSString *)AXLinkText;
    126 - (NSString *)AXListMarkerText;
    127 - (NSString *)AXImageMapText;
    128 - (NSString *)AXHeadingText;
    129 - (NSString *)AXDefinitionListTermText;
    130 - (NSString *)AXDefinitionListDefinitionText;
    131 - (NSString *)AXARIAContentGroupText:(NSString *)ariaType;
    132 
    133 - (NSString *)AXButtonActionVerb;
    134 - (NSString *)AXRadioButtonActionVerb;
    135 - (NSString *)AXTextFieldActionVerb;
    136 - (NSString *)AXCheckedCheckBoxActionVerb;
    137 - (NSString *)AXUncheckedCheckBoxActionVerb;
    138 - (NSString *)AXLinkActionVerb;
    139 - (NSString *)AXMenuListPopupActionVerb;
    140 - (NSString *)AXMenuListActionVerb;
    141 
    142 - (NSString *)missingPluginText;
    143 - (NSString *)crashedPluginText;
    144 
    145 - (NSString *)multipleFileUploadTextForNumberOfFiles:(unsigned)numberOfFiles;
    146 // FTP Directory Related
    147 - (NSString *)unknownFileSizeText;
    148 
    149 - (NSString *)mediaElementLoadingStateText;
    150 - (NSString *)mediaElementLiveBroadcastStateText;
    151 - (NSString*)localizedMediaControlElementString:(NSString*)name;
    152 - (NSString*)localizedMediaControlElementHelpText:(NSString*)name;
    153 - (NSString*)localizedMediaTimeDescription:(float)time;
    154 
    155 - (NSString *)validationMessageValueMissingText;
    156 - (NSString *)validationMessageTypeMismatchText;
    157 - (NSString *)validationMessagePatternMismatchText;
    158 - (NSString *)validationMessageTooLongText;
    159 - (NSString *)validationMessageRangeUnderflowText;
    160 - (NSString *)validationMessageRangeOverflowText;
    161 - (NSString *)validationMessageStepMismatchText;
    162 
    16349@end
    16450
  • trunk/WebCore/platform/PlatformStrategies.h

    r61438 r63904  
    3232
    3333class PluginStrategy;
     34class LocalizationStrategy;
    3435
    3536class PlatformStrategies {
     
    3940        if (!m_pluginStrategy)
    4041            m_pluginStrategy = createPluginStrategy();
     42        return m_pluginStrategy;
     43    }
    4144
    42         return m_pluginStrategy;
     45    LocalizationStrategy* localizationStrategy()
     46    {
     47        if (!m_localizationStrategy)
     48            m_localizationStrategy = createLocalizationStrategy();
     49        return m_localizationStrategy;
    4350    }
    4451
     
    4855    {
    4956    }
    50     virtual ~PlatformStrategies() { }
    5157
    52 private:   
     58    virtual ~PlatformStrategies()
     59    {
     60    }
     61
     62private:
    5363    virtual PluginStrategy* createPluginStrategy() = 0;
     64    virtual LocalizationStrategy* createLocalizationStrategy() = 0;
    5465
    5566    PluginStrategy* m_pluginStrategy;
     67    LocalizationStrategy* m_localizationStrategy;
    5668};
    5769
  • trunk/WebCore/platform/mac/LocalizedStringsMac.mm

    r57095 r63904  
    11/*
    2  * Copyright (C) 2003, 2006, 2009 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2003, 2006, 2009, 2010 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2727#import "LocalizedStrings.h"
    2828
    29 #import "BlockExceptions.h"
    3029#import "IntSize.h"
     30#import "LocalizationStrategy.h"
     31#import "PlatformStrategies.h"
    3132#import "PlatformString.h"
    32 #import "WebCoreViewFactory.h"
    3333
    3434namespace WebCore {
     
    3636String inputElementAltText()
    3737{
    38     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    39     return [[WebCoreViewFactory sharedFactory] inputElementAltText];
    40     END_BLOCK_OBJC_EXCEPTIONS;
    41     return String();
     38    return platformStrategies()->localizationStrategy()->inputElementAltText();
    4239}
    4340
    4441String resetButtonDefaultLabel()
    4542{
    46     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    47     return [[WebCoreViewFactory sharedFactory] resetButtonDefaultLabel];
    48     END_BLOCK_OBJC_EXCEPTIONS;
    49     return String();
     43    return platformStrategies()->localizationStrategy()->resetButtonDefaultLabel();
    5044}
    5145
    5246String searchableIndexIntroduction()
    5347{
    54     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    55     return [[WebCoreViewFactory sharedFactory] searchableIndexIntroduction];
    56     END_BLOCK_OBJC_EXCEPTIONS;
    57     return String();
     48    return platformStrategies()->localizationStrategy()->searchableIndexIntroduction();
    5849}
    5950
    6051String submitButtonDefaultLabel()
    6152{
    62     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    63     return [[WebCoreViewFactory sharedFactory] submitButtonDefaultLabel];
    64     END_BLOCK_OBJC_EXCEPTIONS;
    65     return String();
     53    return platformStrategies()->localizationStrategy()->submitButtonDefaultLabel();
    6654}
    6755
    6856String fileButtonChooseFileLabel()
    6957{
    70     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    71     return [[WebCoreViewFactory sharedFactory] fileButtonChooseFileLabel];
    72     END_BLOCK_OBJC_EXCEPTIONS;
    73     return String();
     58    return platformStrategies()->localizationStrategy()->fileButtonChooseFileLabel();
    7459}
    7560
    7661String fileButtonNoFileSelectedLabel()
    7762{
    78     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    79     return [[WebCoreViewFactory sharedFactory] fileButtonNoFileSelectedLabel];
    80     END_BLOCK_OBJC_EXCEPTIONS;
    81     return String();
     63    return platformStrategies()->localizationStrategy()->fileButtonNoFileSelectedLabel();
    8264}
    8365
    8466String copyImageUnknownFileLabel()
    8567{
    86     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    87     return [[WebCoreViewFactory sharedFactory] copyImageUnknownFileLabel];
    88     END_BLOCK_OBJC_EXCEPTIONS;
    89     return String();
     68    return platformStrategies()->localizationStrategy()->copyImageUnknownFileLabel();
    9069}
    9170
     
    9372String contextMenuItemTagOpenLinkInNewWindow()
    9473{
    95     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    96     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenLinkInNewWindow];
    97     END_BLOCK_OBJC_EXCEPTIONS;
    98     return String();
     74    return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenLinkInNewWindow();
    9975}
    10076
    10177String contextMenuItemTagDownloadLinkToDisk()
    10278{
    103     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    104     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDownloadLinkToDisk];
    105     END_BLOCK_OBJC_EXCEPTIONS;
    106     return String();
     79    return platformStrategies()->localizationStrategy()->contextMenuItemTagDownloadLinkToDisk();
    10780}
    10881
    10982String contextMenuItemTagCopyLinkToClipboard()
    11083{
    111     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    112     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopyLinkToClipboard];
    113     END_BLOCK_OBJC_EXCEPTIONS;
    114     return String();
     84    return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyLinkToClipboard();
    11585}
    11686
    11787String contextMenuItemTagOpenImageInNewWindow()
    11888{
    119     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    120     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenImageInNewWindow];
    121     END_BLOCK_OBJC_EXCEPTIONS;
    122     return String();
     89    return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenImageInNewWindow();
    12390}
    12491
    12592String contextMenuItemTagDownloadImageToDisk()
    12693{
    127     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    128     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDownloadImageToDisk];
    129     END_BLOCK_OBJC_EXCEPTIONS;
    130     return String();
     94    return platformStrategies()->localizationStrategy()->contextMenuItemTagDownloadImageToDisk();
    13195}
    13296
    13397String contextMenuItemTagCopyImageToClipboard()
    13498{
    135     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    136     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopyImageToClipboard];
    137     END_BLOCK_OBJC_EXCEPTIONS;
    138     return String();
     99    return platformStrategies()->localizationStrategy()->contextMenuItemTagCopyImageToClipboard();
    139100}
    140101
    141102String contextMenuItemTagOpenFrameInNewWindow()
    142103{
    143     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    144     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenFrameInNewWindow];
    145     END_BLOCK_OBJC_EXCEPTIONS;
    146     return String();
     104    return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenFrameInNewWindow();
    147105}
    148106
    149107String contextMenuItemTagCopy()
    150108{
    151     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    152     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCopy];
    153     END_BLOCK_OBJC_EXCEPTIONS;
    154     return String();
     109    return platformStrategies()->localizationStrategy()->contextMenuItemTagCopy();
    155110}
    156111
    157112String contextMenuItemTagGoBack()
    158113{
    159     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    160     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagGoBack];
    161     END_BLOCK_OBJC_EXCEPTIONS;
    162     return String();
     114    return platformStrategies()->localizationStrategy()->contextMenuItemTagGoBack();
    163115}
    164116
    165117String contextMenuItemTagGoForward()
    166118{
    167     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    168     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagGoForward];
    169     END_BLOCK_OBJC_EXCEPTIONS;
    170     return String();
     119    return platformStrategies()->localizationStrategy()->contextMenuItemTagGoForward();
    171120}
    172121
    173122String contextMenuItemTagStop()
    174123{
    175     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    176     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStop];
    177     END_BLOCK_OBJC_EXCEPTIONS;
    178     return String();
     124    return platformStrategies()->localizationStrategy()->contextMenuItemTagStop();
    179125}
    180126
    181127String contextMenuItemTagReload()
    182128{
    183     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    184     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagReload];
    185     END_BLOCK_OBJC_EXCEPTIONS;
    186     return String();
     129    return platformStrategies()->localizationStrategy()->contextMenuItemTagReload();
    187130}
    188131
    189132String contextMenuItemTagCut()
    190133{
    191     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    192     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCut];
    193     END_BLOCK_OBJC_EXCEPTIONS;
    194     return String();
     134    return platformStrategies()->localizationStrategy()->contextMenuItemTagCut();
    195135}
    196136
    197137String contextMenuItemTagPaste()
    198138{
    199     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    200     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagPaste];
    201     END_BLOCK_OBJC_EXCEPTIONS;
    202     return String();
     139    return platformStrategies()->localizationStrategy()->contextMenuItemTagPaste();
    203140}
    204141
    205142String contextMenuItemTagNoGuessesFound()
    206143{
    207     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    208     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagNoGuessesFound];
    209     END_BLOCK_OBJC_EXCEPTIONS;
    210     return String();
     144    return platformStrategies()->localizationStrategy()->contextMenuItemTagNoGuessesFound();
    211145}
    212146
    213147String contextMenuItemTagIgnoreSpelling()
    214148{
    215     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    216     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagIgnoreSpelling];
    217     END_BLOCK_OBJC_EXCEPTIONS;
    218     return String();
     149    return platformStrategies()->localizationStrategy()->contextMenuItemTagIgnoreSpelling();
    219150}
    220151
    221152String contextMenuItemTagLearnSpelling()
    222153{
    223     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    224     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLearnSpelling];
    225     END_BLOCK_OBJC_EXCEPTIONS;
    226     return String();
     154    return platformStrategies()->localizationStrategy()->contextMenuItemTagLearnSpelling();
    227155}
    228156
    229157String contextMenuItemTagSearchInSpotlight()
    230158{
    231     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    232     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSearchInSpotlight];
    233     END_BLOCK_OBJC_EXCEPTIONS;
    234     return String();
     159    return platformStrategies()->localizationStrategy()->contextMenuItemTagSearchInSpotlight();
    235160}
    236161
    237162String contextMenuItemTagSearchWeb()
    238163{
    239     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    240     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSearchWeb];
    241     END_BLOCK_OBJC_EXCEPTIONS;
    242     return String();
     164    return platformStrategies()->localizationStrategy()->contextMenuItemTagSearchWeb();
    243165}
    244166
    245167String contextMenuItemTagLookUpInDictionary()
    246168{
    247     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    248     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLookUpInDictionary];
    249     END_BLOCK_OBJC_EXCEPTIONS;
    250     return String();
     169    return platformStrategies()->localizationStrategy()->contextMenuItemTagLookUpInDictionary();
    251170}
    252171
    253172String contextMenuItemTagOpenLink()
    254173{
    255     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    256     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOpenLink];
    257     END_BLOCK_OBJC_EXCEPTIONS;
    258     return String();
     174    return platformStrategies()->localizationStrategy()->contextMenuItemTagOpenLink();
    259175}
    260176
    261177String contextMenuItemTagIgnoreGrammar()
    262178{
    263     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    264     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagIgnoreGrammar];
    265     END_BLOCK_OBJC_EXCEPTIONS;
    266     return String();
     179    return platformStrategies()->localizationStrategy()->contextMenuItemTagIgnoreGrammar();
    267180}
    268181
    269182String contextMenuItemTagSpellingMenu()
    270183{
    271     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    272     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSpellingMenu];
    273     END_BLOCK_OBJC_EXCEPTIONS;
    274     return String();
     184    return platformStrategies()->localizationStrategy()->contextMenuItemTagSpellingMenu();
    275185}
    276186
    277187String contextMenuItemTagShowSpellingPanel(bool show)
    278188{
    279     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    280     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:show];
    281     END_BLOCK_OBJC_EXCEPTIONS;
    282     return String();
     189    return platformStrategies()->localizationStrategy()->contextMenuItemTagShowSpellingPanel(show);
    283190}
    284191
    285192String contextMenuItemTagCheckSpelling()
    286193{
    287     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    288     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckSpelling];
    289     END_BLOCK_OBJC_EXCEPTIONS;
    290     return String();
     194    return platformStrategies()->localizationStrategy()->contextMenuItemTagCheckSpelling();
    291195}
    292196
    293197String contextMenuItemTagCheckSpellingWhileTyping()
    294198{
    295     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    296     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckSpellingWhileTyping];
    297     END_BLOCK_OBJC_EXCEPTIONS;
    298     return String();
     199    return platformStrategies()->localizationStrategy()->contextMenuItemTagCheckSpellingWhileTyping();
    299200}
    300201
    301202String contextMenuItemTagCheckGrammarWithSpelling()
    302203{
    303     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    304     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCheckGrammarWithSpelling];
    305     END_BLOCK_OBJC_EXCEPTIONS;
    306     return String();
     204    return platformStrategies()->localizationStrategy()->contextMenuItemTagCheckGrammarWithSpelling();
    307205}
    308206
    309207String contextMenuItemTagFontMenu()
    310208{
    311     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    312     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagFontMenu];
    313     END_BLOCK_OBJC_EXCEPTIONS;
    314     return String();
     209    return platformStrategies()->localizationStrategy()->contextMenuItemTagFontMenu();
    315210}
    316211
    317212String contextMenuItemTagShowFonts()
    318213{
    319     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    320     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowFonts];
    321     END_BLOCK_OBJC_EXCEPTIONS;
    322     return String();
     214    return platformStrategies()->localizationStrategy()->contextMenuItemTagShowFonts();
    323215}
    324216
    325217String contextMenuItemTagBold()
    326218{
    327     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    328     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagBold];
    329     END_BLOCK_OBJC_EXCEPTIONS;
    330     return String();
     219    return platformStrategies()->localizationStrategy()->contextMenuItemTagBold();
    331220}
    332221
    333222String contextMenuItemTagItalic()
    334223{
    335     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    336     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagItalic];
    337     END_BLOCK_OBJC_EXCEPTIONS;
    338     return String();
     224    return platformStrategies()->localizationStrategy()->contextMenuItemTagItalic();
    339225}
    340226
    341227String contextMenuItemTagUnderline()
    342228{
    343     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    344     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagUnderline];
    345     END_BLOCK_OBJC_EXCEPTIONS;
    346     return String();
     229    return platformStrategies()->localizationStrategy()->contextMenuItemTagUnderline();
    347230}
    348231
    349232String contextMenuItemTagOutline()
    350233{
    351     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    352     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagOutline];
    353     END_BLOCK_OBJC_EXCEPTIONS;
    354     return String();
     234    return platformStrategies()->localizationStrategy()->contextMenuItemTagOutline();
    355235}
    356236
    357237String contextMenuItemTagStyles()
    358238{
    359     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    360     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStyles];
    361     END_BLOCK_OBJC_EXCEPTIONS;
    362     return String();
     239    return platformStrategies()->localizationStrategy()->contextMenuItemTagStyles();
    363240}
    364241
    365242String contextMenuItemTagShowColors()
    366243{
    367     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    368     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowColors];
    369     END_BLOCK_OBJC_EXCEPTIONS;
    370     return String();
     244    return platformStrategies()->localizationStrategy()->contextMenuItemTagShowColors();
    371245}
    372246
    373247String contextMenuItemTagSpeechMenu()
    374248{
    375     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    376     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSpeechMenu];
    377     END_BLOCK_OBJC_EXCEPTIONS;
    378     return String();
     249    return platformStrategies()->localizationStrategy()->contextMenuItemTagSpeechMenu();
    379250}
    380251
    381252String contextMenuItemTagStartSpeaking()
    382253{
    383     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    384     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStartSpeaking];
    385     END_BLOCK_OBJC_EXCEPTIONS;
    386     return String();
     254    return platformStrategies()->localizationStrategy()->contextMenuItemTagStartSpeaking();
    387255}
    388256
    389257String contextMenuItemTagStopSpeaking()
    390258{
    391     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    392     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagStopSpeaking];
    393     END_BLOCK_OBJC_EXCEPTIONS;
    394     return String();
     259    return platformStrategies()->localizationStrategy()->contextMenuItemTagStopSpeaking();
    395260}
    396261
    397262String contextMenuItemTagWritingDirectionMenu()
    398263{
    399     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    400     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagWritingDirectionMenu];
    401     END_BLOCK_OBJC_EXCEPTIONS;
    402     return String();
     264    return platformStrategies()->localizationStrategy()->contextMenuItemTagWritingDirectionMenu();
    403265}
    404266
    405267String contextMenuItemTagTextDirectionMenu()
    406268{
    407     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    408     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagTextDirectionMenu];
    409     END_BLOCK_OBJC_EXCEPTIONS;
    410     return String();
     269    return platformStrategies()->localizationStrategy()->contextMenuItemTagTextDirectionMenu();
    411270}
    412271
    413272String contextMenuItemTagDefaultDirection()
    414273{
    415     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    416     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagDefaultDirection];
    417     END_BLOCK_OBJC_EXCEPTIONS;
    418     return String();
     274    return platformStrategies()->localizationStrategy()->contextMenuItemTagDefaultDirection();
    419275}
    420276
    421277String contextMenuItemTagLeftToRight()
    422278{
    423     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    424     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagLeftToRight];
    425     END_BLOCK_OBJC_EXCEPTIONS;
    426     return String();
     279    return platformStrategies()->localizationStrategy()->contextMenuItemTagLeftToRight();
    427280}
    428281
    429282String contextMenuItemTagRightToLeft()
    430283{
    431     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    432     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagRightToLeft];
    433     END_BLOCK_OBJC_EXCEPTIONS;
    434     return String();
     284    return platformStrategies()->localizationStrategy()->contextMenuItemTagRightToLeft();
    435285}
    436286
    437287String contextMenuItemTagCorrectSpellingAutomatically()
    438288{
    439     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    440     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCorrectSpellingAutomatically];
    441     END_BLOCK_OBJC_EXCEPTIONS;
    442     return String();
     289    return platformStrategies()->localizationStrategy()->contextMenuItemTagCorrectSpellingAutomatically();
    443290}
    444291
    445292String contextMenuItemTagSubstitutionsMenu()
    446293{
    447     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    448     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSubstitutionsMenu];
    449     END_BLOCK_OBJC_EXCEPTIONS;
    450     return String();
     294    return platformStrategies()->localizationStrategy()->contextMenuItemTagSubstitutionsMenu();
    451295}
    452296
    453297String contextMenuItemTagShowSubstitutions(bool show)
    454298{
    455     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    456     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagShowSubstitutions:show];
    457     END_BLOCK_OBJC_EXCEPTIONS;
    458     return String();
     299    return platformStrategies()->localizationStrategy()->contextMenuItemTagShowSubstitutions(show);
    459300}
    460301
    461302String contextMenuItemTagSmartCopyPaste()
    462303{
    463     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    464     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartCopyPaste];
    465     END_BLOCK_OBJC_EXCEPTIONS;
    466     return String();
     304    return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartCopyPaste();
    467305}
    468306
    469307String contextMenuItemTagSmartQuotes()
    470308{
    471     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    472     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartQuotes];
    473     END_BLOCK_OBJC_EXCEPTIONS;
    474     return String();
     309    return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartQuotes();
    475310}
    476311
    477312String contextMenuItemTagSmartDashes()
    478313{
    479     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    480     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartDashes];
    481     END_BLOCK_OBJC_EXCEPTIONS;
    482     return String();
     314    return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartDashes();
    483315}
    484316
    485317String contextMenuItemTagSmartLinks()
    486318{
    487     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    488     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagSmartLinks];
    489     END_BLOCK_OBJC_EXCEPTIONS;
    490     return String();
     319    return platformStrategies()->localizationStrategy()->contextMenuItemTagSmartLinks();
    491320}
    492321
    493322String contextMenuItemTagTextReplacement()
    494323{
    495     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    496     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagTextReplacement];
    497     END_BLOCK_OBJC_EXCEPTIONS;
    498     return String();
     324    return platformStrategies()->localizationStrategy()->contextMenuItemTagTextReplacement();
    499325}
    500326
    501327String contextMenuItemTagTransformationsMenu()
    502328{
    503     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    504     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagTransformationsMenu];
    505     END_BLOCK_OBJC_EXCEPTIONS;
    506     return String();
     329    return platformStrategies()->localizationStrategy()->contextMenuItemTagTransformationsMenu();
    507330}
    508331
    509332String contextMenuItemTagMakeUpperCase()
    510333{
    511     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    512     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagMakeUpperCase];
    513     END_BLOCK_OBJC_EXCEPTIONS;
    514     return String();
     334    return platformStrategies()->localizationStrategy()->contextMenuItemTagMakeUpperCase();
    515335}
    516336
    517337String contextMenuItemTagMakeLowerCase()
    518338{
    519     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    520     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagMakeLowerCase];
    521     END_BLOCK_OBJC_EXCEPTIONS;
    522     return String();
     339    return platformStrategies()->localizationStrategy()->contextMenuItemTagMakeLowerCase();
    523340}
    524341
    525342String contextMenuItemTagCapitalize()
    526343{
    527     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    528     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagCapitalize];
    529     END_BLOCK_OBJC_EXCEPTIONS;
    530     return String();
     344    return platformStrategies()->localizationStrategy()->contextMenuItemTagCapitalize();
    531345}
    532346
    533347String contextMenuItemTagChangeBack(const String& replacedString)
    534348{
    535     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    536     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagChangeBack:replacedString];
    537     END_BLOCK_OBJC_EXCEPTIONS;
    538     return replacedString;
     349    return platformStrategies()->localizationStrategy()->contextMenuItemTagChangeBack(replacedString);
    539350}
    540351   
    541352String contextMenuItemTagInspectElement()
    542353{
    543     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    544     return [[WebCoreViewFactory sharedFactory] contextMenuItemTagInspectElement];
    545     END_BLOCK_OBJC_EXCEPTIONS;
    546     return String();
    547 }
     354    return platformStrategies()->localizationStrategy()->contextMenuItemTagInspectElement();
     355}
     356
    548357#endif // ENABLE(CONTEXT_MENUS)
    549358
    550359String searchMenuNoRecentSearchesText()
    551360{
    552     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    553     return [[WebCoreViewFactory sharedFactory] searchMenuNoRecentSearchesText];
    554     END_BLOCK_OBJC_EXCEPTIONS;
    555     return String();
     361    return platformStrategies()->localizationStrategy()->searchMenuNoRecentSearchesText();
    556362}
    557363
    558364String searchMenuRecentSearchesText ()
    559365{
    560     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    561     return [[WebCoreViewFactory sharedFactory] searchMenuRecentSearchesText];
    562     END_BLOCK_OBJC_EXCEPTIONS;
    563     return String();
     366    return platformStrategies()->localizationStrategy()->searchMenuRecentSearchesText ();
    564367}
    565368
    566369String searchMenuClearRecentSearchesText()
    567370{
    568     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    569     return [[WebCoreViewFactory sharedFactory] searchMenuClearRecentSearchesText];
    570     END_BLOCK_OBJC_EXCEPTIONS;
    571     return String();
     371    return platformStrategies()->localizationStrategy()->searchMenuClearRecentSearchesText();
    572372}
    573373
    574374String AXWebAreaText()
    575375{
    576     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    577     return [[WebCoreViewFactory sharedFactory] AXWebAreaText];
    578     END_BLOCK_OBJC_EXCEPTIONS;
    579     return String();
     376    return platformStrategies()->localizationStrategy()->AXWebAreaText();
    580377}
    581378
    582379String AXLinkText()
    583380{
    584     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    585     return [[WebCoreViewFactory sharedFactory] AXLinkText];
    586     END_BLOCK_OBJC_EXCEPTIONS;
    587     return String();
     381    return platformStrategies()->localizationStrategy()->AXLinkText();
    588382}
    589383
    590384String AXListMarkerText()
    591385{
    592     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    593     return [[WebCoreViewFactory sharedFactory] AXListMarkerText];
    594     END_BLOCK_OBJC_EXCEPTIONS;
    595     return String();
     386    return platformStrategies()->localizationStrategy()->AXListMarkerText();
    596387}
    597388
    598389String AXImageMapText()
    599390{
    600     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    601     return [[WebCoreViewFactory sharedFactory] AXImageMapText];
    602     END_BLOCK_OBJC_EXCEPTIONS;
    603     return String();
     391    return platformStrategies()->localizationStrategy()->AXImageMapText();
    604392}
    605393
    606394String AXHeadingText()
    607395{
    608     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    609     return [[WebCoreViewFactory sharedFactory] AXHeadingText];
    610     END_BLOCK_OBJC_EXCEPTIONS;
    611     return String();
     396    return platformStrategies()->localizationStrategy()->AXHeadingText();
    612397}
    613398
    614399String AXDefinitionListTermText()
    615400{
    616     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    617     return [[WebCoreViewFactory sharedFactory] AXDefinitionListTermText];
    618     END_BLOCK_OBJC_EXCEPTIONS;
    619     return String();
    620 }
    621    
     401    return platformStrategies()->localizationStrategy()->AXDefinitionListTermText();
     402}
     403
    622404String AXDefinitionListDefinitionText()
    623405{
    624     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    625     return [[WebCoreViewFactory sharedFactory] AXDefinitionListDefinitionText];
    626     END_BLOCK_OBJC_EXCEPTIONS;
    627     return String();
    628 }
    629    
     406    return platformStrategies()->localizationStrategy()->AXDefinitionListDefinitionText();
     407}
     408
    630409String AXARIAContentGroupText(const String& ariaType)
    631410{
    632     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    633     return [[WebCoreViewFactory sharedFactory] AXARIAContentGroupText:ariaType];
    634     END_BLOCK_OBJC_EXCEPTIONS;
    635     return String();       
     411    return platformStrategies()->localizationStrategy()->AXARIAContentGroupText(ariaType);
    636412}
    637413   
    638414String AXButtonActionVerb()
    639415{
    640     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    641     return [[WebCoreViewFactory sharedFactory] AXButtonActionVerb];
    642     END_BLOCK_OBJC_EXCEPTIONS;
    643     return String();
     416    return platformStrategies()->localizationStrategy()->AXButtonActionVerb();
    644417}
    645418
    646419String AXRadioButtonActionVerb()
    647420{
    648     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    649     return [[WebCoreViewFactory sharedFactory] AXRadioButtonActionVerb];
    650     END_BLOCK_OBJC_EXCEPTIONS;
    651     return String();
     421    return platformStrategies()->localizationStrategy()->AXRadioButtonActionVerb();
    652422}
    653423
    654424String AXTextFieldActionVerb()
    655425{
    656     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    657     return [[WebCoreViewFactory sharedFactory] AXTextFieldActionVerb];
    658     END_BLOCK_OBJC_EXCEPTIONS;
    659     return String();
     426    return platformStrategies()->localizationStrategy()->AXTextFieldActionVerb();
    660427}
    661428
    662429String AXCheckedCheckBoxActionVerb()
    663430{
    664     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    665     return [[WebCoreViewFactory sharedFactory] AXCheckedCheckBoxActionVerb];
    666     END_BLOCK_OBJC_EXCEPTIONS;
    667     return String();
     431    return platformStrategies()->localizationStrategy()->AXCheckedCheckBoxActionVerb();
    668432}
    669433
    670434String AXUncheckedCheckBoxActionVerb()
    671435{
    672     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    673     return [[WebCoreViewFactory sharedFactory] AXUncheckedCheckBoxActionVerb];
    674     END_BLOCK_OBJC_EXCEPTIONS;
    675     return String();
     436    return platformStrategies()->localizationStrategy()->AXUncheckedCheckBoxActionVerb();
    676437}
    677438
    678439String AXLinkActionVerb()
    679440{
    680     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    681     return [[WebCoreViewFactory sharedFactory] AXLinkActionVerb];
    682     END_BLOCK_OBJC_EXCEPTIONS;
    683     return String();
     441    return platformStrategies()->localizationStrategy()->AXLinkActionVerb();
    684442}
    685443
    686444String AXMenuListPopupActionVerb()
    687445{
    688     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    689     return [[WebCoreViewFactory sharedFactory] AXMenuListPopupActionVerb];
    690     END_BLOCK_OBJC_EXCEPTIONS;
    691     return String();
     446    return platformStrategies()->localizationStrategy()->AXMenuListPopupActionVerb();
    692447}
    693448
    694449String AXMenuListActionVerb()
    695450{
    696     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    697     return [[WebCoreViewFactory sharedFactory] AXMenuListActionVerb];
    698     END_BLOCK_OBJC_EXCEPTIONS;
    699     return String();
     451    return platformStrategies()->localizationStrategy()->AXMenuListActionVerb();
    700452}
    701453
    702454String missingPluginText()
    703455{
    704     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    705     return [[WebCoreViewFactory sharedFactory] missingPluginText];
    706     END_BLOCK_OBJC_EXCEPTIONS;
    707     return String();
     456    return platformStrategies()->localizationStrategy()->missingPluginText();
    708457}
    709458
    710459String crashedPluginText()
    711460{
    712     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    713     return [[WebCoreViewFactory sharedFactory] crashedPluginText];
    714     END_BLOCK_OBJC_EXCEPTIONS;
    715     return String();
     461    return platformStrategies()->localizationStrategy()->crashedPluginText();
    716462}
    717463
    718464String multipleFileUploadText(unsigned numberOfFiles)
    719465{
    720     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    721     return [[WebCoreViewFactory sharedFactory] multipleFileUploadTextForNumberOfFiles:numberOfFiles];
    722     END_BLOCK_OBJC_EXCEPTIONS;
    723     return String();
     466    return platformStrategies()->localizationStrategy()->multipleFileUploadText(numberOfFiles);
    724467}
    725468
    726469String unknownFileSizeText()
    727470{
    728     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    729     return [[WebCoreViewFactory sharedFactory] unknownFileSizeText];
    730     END_BLOCK_OBJC_EXCEPTIONS;
    731     return String();
     471    return platformStrategies()->localizationStrategy()->unknownFileSizeText();
    732472}
    733473
    734474String imageTitle(const String& filename, const IntSize& size)
    735475{
    736     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    737     return [[WebCoreViewFactory sharedFactory] imageTitleForFilename:filename width:size.width() height:size.height()];
    738     END_BLOCK_OBJC_EXCEPTIONS;
    739     return String();
     476    return platformStrategies()->localizationStrategy()->imageTitle(filename, size);
    740477}
    741478
    742479String mediaElementLoadingStateText()
    743480{
    744     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    745     return [[WebCoreViewFactory sharedFactory] mediaElementLoadingStateText];
    746     END_BLOCK_OBJC_EXCEPTIONS;
    747     return String();
     481    return platformStrategies()->localizationStrategy()->mediaElementLoadingStateText();
    748482}
    749483
    750484String mediaElementLiveBroadcastStateText()
    751485{
    752     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    753     return [[WebCoreViewFactory sharedFactory] mediaElementLiveBroadcastStateText];
    754     END_BLOCK_OBJC_EXCEPTIONS;
    755     return String();
     486    return platformStrategies()->localizationStrategy()->mediaElementLiveBroadcastStateText();
    756487}
    757488
    758489String localizedMediaControlElementString(const String& controlName)
    759490{
    760     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    761     return [[WebCoreViewFactory sharedFactory] localizedMediaControlElementString:controlName];
    762     END_BLOCK_OBJC_EXCEPTIONS;
    763     return String();
     491    return platformStrategies()->localizationStrategy()->localizedMediaControlElementString(controlName);
    764492}
    765493
    766494String localizedMediaControlElementHelpText(const String& controlName)
    767495{
    768     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    769     return [[WebCoreViewFactory sharedFactory] localizedMediaControlElementHelpText:controlName];
    770     END_BLOCK_OBJC_EXCEPTIONS;
    771     return String();
     496    return platformStrategies()->localizationStrategy()->localizedMediaControlElementHelpText(controlName);
    772497}
    773498
    774499String localizedMediaTimeDescription(float time)
    775500{
    776     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    777     return [[WebCoreViewFactory sharedFactory] localizedMediaTimeDescription:time];
    778     END_BLOCK_OBJC_EXCEPTIONS;
    779     return String();
     501    return platformStrategies()->localizationStrategy()->localizedMediaTimeDescription(time);
    780502}
    781503
    782504String validationMessageValueMissingText()
    783505{
    784     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    785     return [[WebCoreViewFactory sharedFactory] validationMessageValueMissingText];
    786     END_BLOCK_OBJC_EXCEPTIONS;
    787     return String();
     506    return platformStrategies()->localizationStrategy()->validationMessageValueMissingText();
    788507}
    789508
    790509String validationMessageTypeMismatchText()
    791510{
    792     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    793     return [[WebCoreViewFactory sharedFactory] validationMessageTypeMismatchText];
    794     END_BLOCK_OBJC_EXCEPTIONS;
    795     return String();
     511    return platformStrategies()->localizationStrategy()->validationMessageTypeMismatchText();
    796512}
    797513
    798514String validationMessagePatternMismatchText()
    799515{
    800     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    801     return [[WebCoreViewFactory sharedFactory] validationMessagePatternMismatchText];
    802     END_BLOCK_OBJC_EXCEPTIONS;
    803     return String();
     516    return platformStrategies()->localizationStrategy()->validationMessagePatternMismatchText();
    804517}
    805518
    806519String validationMessageTooLongText()
    807520{
    808     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    809     return [[WebCoreViewFactory sharedFactory] validationMessageTooLongText];
    810     END_BLOCK_OBJC_EXCEPTIONS;
    811     return String();
     521    return platformStrategies()->localizationStrategy()->validationMessageTooLongText();
    812522}
    813523
    814524String validationMessageRangeUnderflowText()
    815525{
    816     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    817     return [[WebCoreViewFactory sharedFactory] validationMessageRangeUnderflowText];
    818     END_BLOCK_OBJC_EXCEPTIONS;
    819     return String();
     526    return platformStrategies()->localizationStrategy()->validationMessageRangeUnderflowText();
    820527}
    821528
    822529String validationMessageRangeOverflowText()
    823530{
    824     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    825     return [[WebCoreViewFactory sharedFactory] validationMessageRangeOverflowText];
    826     END_BLOCK_OBJC_EXCEPTIONS;
    827     return String();
     531    return platformStrategies()->localizationStrategy()->validationMessageRangeOverflowText();
    828532}
    829533
    830534String validationMessageStepMismatchText()
    831535{
    832     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    833     return [[WebCoreViewFactory sharedFactory] validationMessageStepMismatchText];
    834     END_BLOCK_OBJC_EXCEPTIONS;
    835     return String();
    836 }
    837 
    838 }
     536    return platformStrategies()->localizationStrategy()->validationMessageStepMismatchText();
     537}
     538
     539} // namespace WebCore
  • trunk/WebKit/mac/ChangeLog

    r63863 r63904  
     12010-07-22  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Patch for https://bugs.webkit.org/show_bug.cgi?id=42836
     6        Add localized strings stubs for WebKit2.
     7
     8        - Convert WebKit (mac) to use a LocalizationStrategy rather than the WebCoreViewFactory
     9          for localized strings.
     10
     11        Gets us below 200 tests failing in WebKitTestRunner.
     12
     13        * WebCoreSupport/WebContextMenuClient.mm:
     14        (fixMenusReceivedFromOldClients): Use LocalizedStrings rather than the factory.
     15        * WebCoreSupport/WebPlatformStrategies.h:
     16        * WebCoreSupport/WebPlatformStrategies.mm:
     17        * WebCoreSupport/WebViewFactory.mm:
     18
    1192010-07-21  Brady Eidson  <beidson@apple.com>
    220
  • trunk/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm

    r60882 r63904  
    4444#import <WebCore/ContextMenu.h>
    4545#import <WebCore/KURL.h>
     46#import <WebCore/LocalizedStrings.h>
    4647#import <WebCore/RuntimeApplicationChecks.h>
    4748#import <WebKit/DOMPrivate.h>
     
    169170            // Restore the specific tag for items on which we temporarily set WebMenuItemTagOther to match old behavior.
    170171            NSString *title = [item title];
    171             if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagOpenLink]])
     172            if ([title isEqualToString:contextMenuItemTagOpenLink()])
    172173                modernTag = WebMenuItemTagOpenLink;
    173             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagIgnoreGrammar]])
     174            else if ([title isEqualToString:contextMenuItemTagIgnoreGrammar()])
    174175                modernTag = WebMenuItemTagIgnoreGrammar;
    175             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSpellingMenu]])
     176            else if ([title isEqualToString:contextMenuItemTagSpellingMenu()])
    176177                modernTag = WebMenuItemTagSpellingMenu;
    177             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:true]]
    178                      || [title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSpellingPanel:false]])
     178            else if ([title isEqualToString:contextMenuItemTagShowSpellingPanel(true)]
     179                     || [title isEqualToString:contextMenuItemTagShowSpellingPanel(false)])
    179180                modernTag = WebMenuItemTagShowSpellingPanel;
    180             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckSpelling]])
     181            else if ([title isEqualToString:contextMenuItemTagCheckSpelling()])
    181182                modernTag = WebMenuItemTagCheckSpelling;
    182             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckSpellingWhileTyping]])
     183            else if ([title isEqualToString:contextMenuItemTagCheckSpellingWhileTyping()])
    183184                modernTag = WebMenuItemTagCheckSpellingWhileTyping;
    184             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCheckGrammarWithSpelling]])
     185            else if ([title isEqualToString:contextMenuItemTagCheckGrammarWithSpelling()])
    185186                modernTag = WebMenuItemTagCheckGrammarWithSpelling;
    186             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagFontMenu]])
     187            else if ([title isEqualToString:contextMenuItemTagFontMenu()])
    187188                modernTag = WebMenuItemTagFontMenu;
    188             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowFonts]])
     189            else if ([title isEqualToString:contextMenuItemTagShowFonts()])
    189190                modernTag = WebMenuItemTagShowFonts;
    190             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagBold]])
     191            else if ([title isEqualToString:contextMenuItemTagBold()])
    191192                modernTag = WebMenuItemTagBold;
    192             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagItalic]])
     193            else if ([title isEqualToString:contextMenuItemTagItalic()])
    193194                modernTag = WebMenuItemTagItalic;
    194             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagUnderline]])
     195            else if ([title isEqualToString:contextMenuItemTagUnderline()])
    195196                modernTag = WebMenuItemTagUnderline;
    196             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagOutline]])
     197            else if ([title isEqualToString:contextMenuItemTagOutline()])
    197198                modernTag = WebMenuItemTagOutline;
    198             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStyles]])
     199            else if ([title isEqualToString:contextMenuItemTagStyles()])
    199200                modernTag = WebMenuItemTagStyles;
    200             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowColors]])
     201            else if ([title isEqualToString:contextMenuItemTagShowColors()])
    201202                modernTag = WebMenuItemTagShowColors;
    202             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSpeechMenu]])
     203            else if ([title isEqualToString:contextMenuItemTagSpeechMenu()])
    203204                modernTag = WebMenuItemTagSpeechMenu;
    204             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStartSpeaking]])
     205            else if ([title isEqualToString:contextMenuItemTagStartSpeaking()])
    205206                modernTag = WebMenuItemTagStartSpeaking;
    206             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagStopSpeaking]])
     207            else if ([title isEqualToString:contextMenuItemTagStopSpeaking()])
    207208                modernTag = WebMenuItemTagStopSpeaking;
    208             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagWritingDirectionMenu]])
     209            else if ([title isEqualToString:contextMenuItemTagWritingDirectionMenu()])
    209210                modernTag = WebMenuItemTagWritingDirectionMenu;
    210             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagDefaultDirection]])
     211            else if ([title isEqualToString:contextMenuItemTagDefaultDirection()])
    211212                modernTag = WebMenuItemTagDefaultDirection;
    212             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagLeftToRight]])
     213            else if ([title isEqualToString:contextMenuItemTagLeftToRight()])
    213214                modernTag = WebMenuItemTagLeftToRight;
    214             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagRightToLeft]])
     215            else if ([title isEqualToString:contextMenuItemTagRightToLeft()])
    215216                modernTag = WebMenuItemTagRightToLeft;
    216             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagInspectElement]])
     217            else if ([title isEqualToString:contextMenuItemTagInspectElement()])
    217218                modernTag = WebMenuItemTagInspectElement;
    218             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCorrectSpellingAutomatically]])
     219            else if ([title isEqualToString:contextMenuItemTagCorrectSpellingAutomatically()])
    219220                modernTag = WebMenuItemTagCorrectSpellingAutomatically;
    220             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSubstitutionsMenu]])
     221            else if ([title isEqualToString:contextMenuItemTagSubstitutionsMenu()])
    221222                modernTag = WebMenuItemTagSubstitutionsMenu;
    222             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSubstitutions:true]]
    223                      || [title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagShowSubstitutions:false]])
     223            else if ([title isEqualToString:contextMenuItemTagShowSubstitutions(true)]
     224                     || [title isEqualToString:contextMenuItemTagShowSubstitutions(false)])
    224225                modernTag = WebMenuItemTagShowSubstitutions;
    225             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartCopyPaste]])
     226            else if ([title isEqualToString:contextMenuItemTagSmartCopyPaste()])
    226227                modernTag = WebMenuItemTagSmartCopyPaste;
    227             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartQuotes]])
     228            else if ([title isEqualToString:contextMenuItemTagSmartQuotes()])
    228229                modernTag = WebMenuItemTagSmartQuotes;
    229             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartDashes]])
     230            else if ([title isEqualToString:contextMenuItemTagSmartDashes()])
    230231                modernTag = WebMenuItemTagSmartDashes;
    231             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagSmartLinks]])
     232            else if ([title isEqualToString:contextMenuItemTagSmartLinks()])
    232233                modernTag = WebMenuItemTagSmartLinks;
    233             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagTextReplacement]])
     234            else if ([title isEqualToString:contextMenuItemTagTextReplacement()])
    234235                modernTag = WebMenuItemTagTextReplacement;
    235             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagTransformationsMenu]])
     236            else if ([title isEqualToString:contextMenuItemTagTransformationsMenu()])
    236237                modernTag = WebMenuItemTagTransformationsMenu;
    237             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagMakeUpperCase]])
     238            else if ([title isEqualToString:contextMenuItemTagMakeUpperCase()])
    238239                modernTag = WebMenuItemTagMakeUpperCase;
    239             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagMakeLowerCase]])
     240            else if ([title isEqualToString:contextMenuItemTagMakeLowerCase()])
    240241                modernTag = WebMenuItemTagMakeLowerCase;
    241             else if ([title isEqualToString:[[WebViewFactory sharedFactory] contextMenuItemTagCapitalize]])
     242            else if ([title isEqualToString:contextMenuItemTagCapitalize()])
    242243                modernTag = WebMenuItemTagCapitalize;
    243244            else {
  • trunk/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h

    r61444 r63904  
    2929#include <WebCore/PlatformStrategies.h>
    3030#include <WebCore/PluginStrategy.h>
     31#include <WebCore/LocalizationStrategy.h>
    3132
    32 class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy {
     33class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy {
    3334public:
    3435    static void initialize();
     
    3940    // WebCore::PlatformStrategies
    4041    virtual WebCore::PluginStrategy* createPluginStrategy();
     42    virtual WebCore::LocalizationStrategy* createLocalizationStrategy();
    4143
    4244    // WebCore::PluginStrategy
    4345    virtual void refreshPlugins();
    4446    virtual void getPluginInfo(Vector<WebCore::PluginInfo>&);
     47
     48    // WebCore::LocalizationStrategy   
     49    virtual WebCore::String inputElementAltText();
     50    virtual WebCore::String resetButtonDefaultLabel();
     51    virtual WebCore::String searchableIndexIntroduction();
     52    virtual WebCore::String submitButtonDefaultLabel();
     53    virtual WebCore::String fileButtonChooseFileLabel();
     54    virtual WebCore::String fileButtonNoFileSelectedLabel();
     55    virtual WebCore::String copyImageUnknownFileLabel();
     56#if ENABLE(CONTEXT_MENUS)
     57    virtual WebCore::String contextMenuItemTagOpenLinkInNewWindow();
     58    virtual WebCore::String contextMenuItemTagDownloadLinkToDisk();
     59    virtual WebCore::String contextMenuItemTagCopyLinkToClipboard();
     60    virtual WebCore::String contextMenuItemTagOpenImageInNewWindow();
     61    virtual WebCore::String contextMenuItemTagDownloadImageToDisk();
     62    virtual WebCore::String contextMenuItemTagCopyImageToClipboard();
     63    virtual WebCore::String contextMenuItemTagOpenFrameInNewWindow();
     64    virtual WebCore::String contextMenuItemTagCopy();
     65    virtual WebCore::String contextMenuItemTagGoBack();
     66    virtual WebCore::String contextMenuItemTagGoForward();
     67    virtual WebCore::String contextMenuItemTagStop();
     68    virtual WebCore::String contextMenuItemTagReload();
     69    virtual WebCore::String contextMenuItemTagCut();
     70    virtual WebCore::String contextMenuItemTagPaste();
     71    virtual WebCore::String contextMenuItemTagNoGuessesFound();
     72    virtual WebCore::String contextMenuItemTagIgnoreSpelling();
     73    virtual WebCore::String contextMenuItemTagLearnSpelling();
     74    virtual WebCore::String contextMenuItemTagSearchWeb();
     75    virtual WebCore::String contextMenuItemTagLookUpInDictionary();
     76    virtual WebCore::String contextMenuItemTagOpenLink();
     77    virtual WebCore::String contextMenuItemTagIgnoreGrammar();
     78    virtual WebCore::String contextMenuItemTagSpellingMenu();
     79    virtual WebCore::String contextMenuItemTagShowSpellingPanel(bool show);
     80    virtual WebCore::String contextMenuItemTagCheckSpelling();
     81    virtual WebCore::String contextMenuItemTagCheckSpellingWhileTyping();
     82    virtual WebCore::String contextMenuItemTagCheckGrammarWithSpelling();
     83    virtual WebCore::String contextMenuItemTagFontMenu();
     84    virtual WebCore::String contextMenuItemTagBold();
     85    virtual WebCore::String contextMenuItemTagItalic();
     86    virtual WebCore::String contextMenuItemTagUnderline();
     87    virtual WebCore::String contextMenuItemTagOutline();
     88    virtual WebCore::String contextMenuItemTagWritingDirectionMenu();
     89    virtual WebCore::String contextMenuItemTagTextDirectionMenu();
     90    virtual WebCore::String contextMenuItemTagDefaultDirection();
     91    virtual WebCore::String contextMenuItemTagLeftToRight();
     92    virtual WebCore::String contextMenuItemTagRightToLeft();
     93    virtual WebCore::String contextMenuItemTagSearchInSpotlight();
     94    virtual WebCore::String contextMenuItemTagShowFonts();
     95    virtual WebCore::String contextMenuItemTagStyles();
     96    virtual WebCore::String contextMenuItemTagShowColors();
     97    virtual WebCore::String contextMenuItemTagSpeechMenu();
     98    virtual WebCore::String contextMenuItemTagStartSpeaking();
     99    virtual WebCore::String contextMenuItemTagStopSpeaking();
     100    virtual WebCore::String contextMenuItemTagCorrectSpellingAutomatically();
     101    virtual WebCore::String contextMenuItemTagSubstitutionsMenu();
     102    virtual WebCore::String contextMenuItemTagShowSubstitutions(bool show);
     103    virtual WebCore::String contextMenuItemTagSmartCopyPaste();
     104    virtual WebCore::String contextMenuItemTagSmartQuotes();
     105    virtual WebCore::String contextMenuItemTagSmartDashes();
     106    virtual WebCore::String contextMenuItemTagSmartLinks();
     107    virtual WebCore::String contextMenuItemTagTextReplacement();
     108    virtual WebCore::String contextMenuItemTagTransformationsMenu();
     109    virtual WebCore::String contextMenuItemTagMakeUpperCase();
     110    virtual WebCore::String contextMenuItemTagMakeLowerCase();
     111    virtual WebCore::String contextMenuItemTagCapitalize();
     112    virtual WebCore::String contextMenuItemTagChangeBack(const WebCore::String& replacedString);
     113    virtual WebCore::String contextMenuItemTagInspectElement();
     114#endif // ENABLE(CONTEXT_MENUS)
     115    virtual WebCore::String searchMenuNoRecentSearchesText();
     116    virtual WebCore::String searchMenuRecentSearchesText();
     117    virtual WebCore::String searchMenuClearRecentSearchesText();
     118    virtual WebCore::String AXWebAreaText();
     119    virtual WebCore::String AXLinkText();
     120    virtual WebCore::String AXListMarkerText();
     121    virtual WebCore::String AXImageMapText();
     122    virtual WebCore::String AXHeadingText();
     123    virtual WebCore::String AXDefinitionListTermText();
     124    virtual WebCore::String AXDefinitionListDefinitionText();
     125    virtual WebCore::String AXARIAContentGroupText(const WebCore::String& ariaType);
     126    virtual WebCore::String AXButtonActionVerb();
     127    virtual WebCore::String AXRadioButtonActionVerb();
     128    virtual WebCore::String AXTextFieldActionVerb();
     129    virtual WebCore::String AXCheckedCheckBoxActionVerb();
     130    virtual WebCore::String AXUncheckedCheckBoxActionVerb();
     131    virtual WebCore::String AXMenuListActionVerb();
     132    virtual WebCore::String AXMenuListPopupActionVerb();
     133    virtual WebCore::String AXLinkActionVerb();
     134    virtual WebCore::String missingPluginText();
     135    virtual WebCore::String crashedPluginText();
     136    virtual WebCore::String multipleFileUploadText(unsigned numberOfFiles);
     137    virtual WebCore::String unknownFileSizeText();
     138    virtual WebCore::String imageTitle(const WebCore::String& filename, const WebCore::IntSize& size);
     139    virtual WebCore::String mediaElementLoadingStateText();
     140    virtual WebCore::String mediaElementLiveBroadcastStateText();
     141    virtual WebCore::String localizedMediaControlElementString(const WebCore::String&);
     142    virtual WebCore::String localizedMediaControlElementHelpText(const WebCore::String&);
     143    virtual WebCore::String localizedMediaTimeDescription(float);
     144    virtual WebCore::String validationMessageValueMissingText();
     145    virtual WebCore::String validationMessageTypeMismatchText();
     146    virtual WebCore::String validationMessagePatternMismatchText();
     147    virtual WebCore::String validationMessageTooLongText();
     148    virtual WebCore::String validationMessageRangeUnderflowText();
     149    virtual WebCore::String validationMessageRangeOverflowText();
     150    virtual WebCore::String validationMessageStepMismatchText();
    45151};
    46152
  • trunk/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm

    r61581 r63904  
    2626#import "WebPlatformStrategies.h"
    2727
     28#import "WebLocalizableStrings.h"
    2829#import "WebPluginDatabase.h"
    2930#import "WebPluginPackage.h"
    3031#import <WebCore/BlockExceptions.h>
     32#import <WebCore/IntSize.h>
    3133#import <wtf/StdLibExtras.h>
    3234
     
    5052
    5153PluginStrategy* WebPlatformStrategies::createPluginStrategy()
     54{
     55    return this;
     56}
     57
     58LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy()
    5259{
    5360    return this;
     
    7380}
    7481
    75 
     82// LocalizationStrategy   
     83
     84String WebPlatformStrategies::inputElementAltText()
     85{
     86    return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value");
     87}
     88
     89String WebPlatformStrategies::resetButtonDefaultLabel()
     90{
     91    return UI_STRING("Reset", "default label for Reset buttons in forms on web pages");
     92}
     93
     94String WebPlatformStrategies::searchableIndexIntroduction()
     95{
     96    return UI_STRING("This is a searchable index. Enter search keywords: ",
     97        "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'");
     98}
     99
     100String WebPlatformStrategies::submitButtonDefaultLabel()
     101{
     102    return UI_STRING("Submit", "default label for Submit buttons in forms on web pages");
     103}
     104
     105String WebPlatformStrategies::fileButtonChooseFileLabel()
     106{
     107    return UI_STRING("Choose File", "title for file button used in HTML forms");
     108}
     109
     110String WebPlatformStrategies::fileButtonNoFileSelectedLabel()
     111{
     112    return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected");
     113}
     114
     115String WebPlatformStrategies::copyImageUnknownFileLabel()
     116{
     117    return UI_STRING("unknown", "Unknown filename");
     118}
     119
     120#if ENABLE(CONTEXT_MENUS)
     121
     122String WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow()
     123{
     124    return UI_STRING("Open Link in New Window", "Open in New Window context menu item");
     125}
     126
     127String WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk()
     128{
     129    return UI_STRING("Download Linked File", "Download Linked File context menu item");
     130}
     131
     132String WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard()
     133{
     134    return UI_STRING("Copy Link", "Copy Link context menu item");
     135}
     136
     137String WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow()
     138{
     139    return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item");
     140}
     141
     142String WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk()
     143{
     144    return UI_STRING("Download Image", "Download Image context menu item");
     145}
     146
     147String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
     148{
     149    return UI_STRING("Copy Image", "Copy Image context menu item");
     150}
     151
     152String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow()
     153{
     154    return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
     155}
     156
     157String WebPlatformStrategies::contextMenuItemTagCopy()
     158{
     159    return UI_STRING("Copy", "Copy context menu item");
     160}
     161
     162String WebPlatformStrategies::contextMenuItemTagGoBack()
     163{
     164    return UI_STRING("Back", "Back context menu item");
     165}
     166
     167String WebPlatformStrategies::contextMenuItemTagGoForward()
     168{
     169    return UI_STRING("Forward", "Forward context menu item");
     170}
     171
     172String WebPlatformStrategies::contextMenuItemTagStop()
     173{
     174    return UI_STRING("Stop", "Stop context menu item");
     175}
     176
     177String WebPlatformStrategies::contextMenuItemTagReload()
     178{
     179    return UI_STRING("Reload", "Reload context menu item");
     180}
     181
     182String WebPlatformStrategies::contextMenuItemTagCut()
     183{
     184    return UI_STRING("Cut", "Cut context menu item");
     185}
     186
     187String WebPlatformStrategies::contextMenuItemTagPaste()
     188{
     189    return UI_STRING("Paste", "Paste context menu item");
     190}
     191
     192String WebPlatformStrategies::contextMenuItemTagNoGuessesFound()
     193{
     194    return UI_STRING("No Guesses Found", "No Guesses Found context menu item");
     195}
     196
     197String WebPlatformStrategies::contextMenuItemTagIgnoreSpelling()
     198{
     199    return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item");
     200}
     201
     202String WebPlatformStrategies::contextMenuItemTagLearnSpelling()
     203{
     204    return UI_STRING("Learn Spelling", "Learn Spelling context menu item");
     205}
     206
     207String WebPlatformStrategies::contextMenuItemTagSearchWeb()
     208{
     209    return UI_STRING("Search in Google", "Search in Google context menu item");
     210}
     211
     212String WebPlatformStrategies::contextMenuItemTagLookUpInDictionary()
     213{
     214    return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
     215}
     216
     217String WebPlatformStrategies::contextMenuItemTagOpenLink()
     218{
     219    return UI_STRING("Open Link", "Open Link context menu item");
     220}
     221
     222String WebPlatformStrategies::contextMenuItemTagIgnoreGrammar()
     223{
     224    return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item");
     225}
     226
     227String WebPlatformStrategies::contextMenuItemTagSpellingMenu()
     228{
     229#ifndef BUILDING_ON_TIGER
     230    return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item");
     231#else
     232    return UI_STRING("Spelling", "Spelling context sub-menu item");
     233#endif
     234}
     235
     236String WebPlatformStrategies::contextMenuItemTagShowSpellingPanel(bool show)
     237{
     238#ifndef BUILDING_ON_TIGER
     239    if (show)
     240        return UI_STRING("Show Spelling and Grammar", "menu item title");
     241    return UI_STRING("Hide Spelling and Grammar", "menu item title");
     242#else
     243    return UI_STRING("Spelling...", "menu item title");
     244#endif
     245}
     246
     247String WebPlatformStrategies::contextMenuItemTagCheckSpelling()
     248{
     249#ifndef BUILDING_ON_TIGER
     250    return UI_STRING("Check Document Now", "Check spelling context menu item");
     251#else
     252    return UI_STRING("Check Spelling", "Check spelling context menu item");
     253#endif
     254}
     255
     256String WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping()
     257{
     258#ifndef BUILDING_ON_TIGER
     259    return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item");
     260#else
     261    return UI_STRING("Check Spelling as You Type", "Check spelling while typing context menu item");
     262#endif
     263}
     264
     265String WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling()
     266{
     267    return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item");
     268}
     269
     270String WebPlatformStrategies::contextMenuItemTagFontMenu()
     271{
     272    return UI_STRING("Font", "Font context sub-menu item");
     273}
     274
     275String WebPlatformStrategies::contextMenuItemTagBold()
     276{
     277    return UI_STRING("Bold", "Bold context menu item");
     278}
     279
     280String WebPlatformStrategies::contextMenuItemTagItalic()
     281{
     282    return UI_STRING("Italic", "Italic context menu item");
     283}
     284
     285String WebPlatformStrategies::contextMenuItemTagUnderline()
     286{
     287    return UI_STRING("Underline", "Underline context menu item");
     288}
     289
     290String WebPlatformStrategies::contextMenuItemTagOutline()
     291{
     292    return UI_STRING("Outline", "Outline context menu item");
     293}
     294
     295String WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu()
     296{
     297#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
     298    return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item");
     299#else
     300    return UI_STRING("Writing Direction", "Writing direction context sub-menu item");
     301#endif
     302}
     303
     304String WebPlatformStrategies::contextMenuItemTagTextDirectionMenu()
     305{
     306    return UI_STRING("Selection Direction", "Selection direction context sub-menu item");
     307}
     308
     309String WebPlatformStrategies::contextMenuItemTagDefaultDirection()
     310{
     311    return UI_STRING("Default", "Default writing direction context menu item");
     312}
     313
     314String WebPlatformStrategies::contextMenuItemTagLeftToRight()
     315{
     316    return UI_STRING("Left to Right", "Left to Right context menu item");
     317}
     318
     319String WebPlatformStrategies::contextMenuItemTagRightToLeft()
     320{
     321    return UI_STRING("Right to Left", "Right to Left context menu item");
     322}
     323
     324#if PLATFORM(MAC)
     325
     326String WebPlatformStrategies::contextMenuItemTagSearchInSpotlight()
     327{
     328    return UI_STRING("Search in Spotlight", "Search in Spotlight context menu item");
     329}
     330
     331String WebPlatformStrategies::contextMenuItemTagShowFonts()
     332{
     333    return UI_STRING("Show Fonts", "Show fonts context menu item");
     334}
     335
     336String WebPlatformStrategies::contextMenuItemTagStyles()
     337{
     338    return UI_STRING("Styles...", "Styles context menu item");
     339}
     340
     341String WebPlatformStrategies::contextMenuItemTagShowColors()
     342{
     343    return UI_STRING("Show Colors", "Show colors context menu item");
     344}
     345
     346String WebPlatformStrategies::contextMenuItemTagSpeechMenu()
     347{
     348    return UI_STRING("Speech", "Speech context sub-menu item");
     349}
     350
     351String WebPlatformStrategies::contextMenuItemTagStartSpeaking()
     352{
     353    return UI_STRING("Start Speaking", "Start speaking context menu item");
     354}
     355
     356String WebPlatformStrategies::contextMenuItemTagStopSpeaking()
     357{
     358    return UI_STRING("Stop Speaking", "Stop speaking context menu item");
     359}
     360
     361String WebPlatformStrategies::contextMenuItemTagCorrectSpellingAutomatically()
     362{
     363    return UI_STRING("Correct Spelling Automatically", "Correct Spelling Automatically context menu item");
     364}
     365
     366String WebPlatformStrategies::contextMenuItemTagSubstitutionsMenu()
     367{
     368    return UI_STRING("Substitutions", "Substitutions context sub-menu item");
     369}
     370
     371String WebPlatformStrategies::contextMenuItemTagShowSubstitutions(bool show)
     372{
     373    if (show)
     374        return UI_STRING("Show Substitutions", "menu item title");
     375    return UI_STRING("Hide Substitutions", "menu item title");
     376}
     377
     378String WebPlatformStrategies::contextMenuItemTagSmartCopyPaste()
     379{
     380    return UI_STRING("Smart Copy/Paste", "Smart Copy/Paste context menu item");
     381}
     382
     383String WebPlatformStrategies::contextMenuItemTagSmartQuotes()
     384{
     385    return UI_STRING("Smart Quotes", "Smart Quotes context menu item");
     386}
     387
     388String WebPlatformStrategies::contextMenuItemTagSmartDashes()
     389{
     390    return UI_STRING("Smart Dashes", "Smart Dashes context menu item");
     391}
     392
     393String WebPlatformStrategies::contextMenuItemTagSmartLinks()
     394{
     395    return UI_STRING("Smart Links", "Smart Links context menu item");
     396}
     397
     398String WebPlatformStrategies::contextMenuItemTagTextReplacement()
     399{
     400    return UI_STRING("Text Replacement", "Text Replacement context menu item");
     401}
     402
     403String WebPlatformStrategies::contextMenuItemTagTransformationsMenu()
     404{
     405    return UI_STRING("Transformations", "Transformations context sub-menu item");
     406}
     407
     408String WebPlatformStrategies::contextMenuItemTagMakeUpperCase()
     409{
     410    return UI_STRING("Make Upper Case", "Make Upper Case context menu item");
     411}
     412
     413String WebPlatformStrategies::contextMenuItemTagMakeLowerCase()
     414{
     415    return UI_STRING("Make Lower Case", "Make Lower Case context menu item");
     416}
     417
     418String WebPlatformStrategies::contextMenuItemTagCapitalize()
     419{
     420    return UI_STRING("Capitalize", "Capitalize context menu item");
     421}
     422
     423String WebPlatformStrategies::contextMenuItemTagChangeBack(const String& replacedString)
     424{
     425    static NSString *formatString = nil;
     426#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
     427    static bool lookedUpString = false;
     428    if (!lookedUpString) {
     429        formatString = [[[NSBundle bundleForClass:[NSSpellChecker class]] localizedStringForKey:@"Change Back to \\U201C%@\\U201D" value:nil table:@"MenuCommands"] retain];
     430        lookedUpString = true;
     431    }
     432#endif
     433    if (!formatString)
     434        return replacedString;
     435    return [NSString stringWithFormat:formatString, (NSString *)replacedString];
     436}
     437
     438#endif
     439
     440String WebPlatformStrategies::contextMenuItemTagInspectElement()
     441{
     442    return UI_STRING("Inspect Element", "Inspect Element context menu item");
     443}
     444
     445#endif // ENABLE(CONTEXT_MENUS)
     446
     447String WebPlatformStrategies::searchMenuNoRecentSearchesText()
     448{
     449    return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed");
     450}
     451
     452String WebPlatformStrategies::searchMenuRecentSearchesText()
     453{
     454    return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title");
     455}
     456
     457String WebPlatformStrategies::searchMenuClearRecentSearchesText()
     458{
     459    return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents");
     460}
     461
     462String WebPlatformStrategies::AXWebAreaText()
     463{
     464    return UI_STRING("HTML content", "accessibility role description for web area");
     465}
     466
     467String WebPlatformStrategies::AXLinkText()
     468{
     469    return UI_STRING("link", "accessibility role description for link");
     470}
     471
     472String WebPlatformStrategies::AXListMarkerText()
     473{
     474    return UI_STRING("list marker", "accessibility role description for list marker");
     475}
     476
     477String WebPlatformStrategies::AXImageMapText()
     478{
     479    return UI_STRING("image map", "accessibility role description for image map");
     480}
     481
     482String WebPlatformStrategies::AXHeadingText()
     483{
     484    return UI_STRING("heading", "accessibility role description for headings");
     485}
     486
     487String WebPlatformStrategies::AXDefinitionListTermText()
     488{
     489    return UI_STRING("term", "term word of a definition");
     490}
     491
     492String WebPlatformStrategies::AXDefinitionListDefinitionText()
     493{
     494    return UI_STRING("definition", "definition phrase");
     495}
     496
     497String WebPlatformStrategies::AXARIAContentGroupText(const String& ariaType)
     498{
     499    if (ariaType == "ARIAApplicationAlert")
     500        return UI_STRING("alert", "An ARIA accessibility group that acts as an alert.");
     501    if (ariaType == "ARIAApplicationAlertDialog")
     502        return UI_STRING("alert dialog", "An ARIA accessibility group that acts as an alert dialog.");
     503    if (ariaType == "ARIAApplicationDialog")
     504        return UI_STRING("dialog", "An ARIA accessibility group that acts as an dialog.");
     505    if (ariaType == "ARIAApplicationLog")
     506        return UI_STRING("log", "An ARIA accessibility group that acts as a console log.");
     507    if (ariaType == "ARIAApplicationMarquee")
     508        return UI_STRING("marquee", "An ARIA accessibility group that acts as a marquee.");   
     509    if (ariaType == "ARIAApplicationStatus")
     510        return UI_STRING("application status", "An ARIA accessibility group that acts as a status update.");   
     511    if (ariaType == "ARIAApplicationTimer")
     512        return UI_STRING("timer", "An ARIA accessibility group that acts as an updating timer.");   
     513    if (ariaType == "ARIADocument")
     514        return UI_STRING("document", "An ARIA accessibility group that acts as a document.");   
     515    if (ariaType == "ARIADocumentArticle")
     516        return UI_STRING("article", "An ARIA accessibility group that acts as an article.");   
     517    if (ariaType == "ARIADocumentNote")
     518        return UI_STRING("note", "An ARIA accessibility group that acts as a note in a document.");   
     519    if (ariaType == "ARIADocumentRegion")
     520        return UI_STRING("region", "An ARIA accessibility group that acts as a distinct region in a document.");   
     521    if (ariaType == "ARIALandmarkApplication")
     522        return UI_STRING("application", "An ARIA accessibility group that acts as an application.");   
     523    if (ariaType == "ARIALandmarkBanner")
     524        return UI_STRING("banner", "An ARIA accessibility group that acts as a banner.");   
     525    if (ariaType == "ARIALandmarkComplementary")
     526        return UI_STRING("complementary", "An ARIA accessibility group that acts as a region of complementary information.");   
     527    if (ariaType == "ARIALandmarkContentInfo")
     528        return UI_STRING("content", "An ARIA accessibility group that contains content.");   
     529    if (ariaType == "ARIALandmarkMain")
     530        return UI_STRING("main", "An ARIA accessibility group that is the main portion of the website.");   
     531    if (ariaType == "ARIALandmarkNavigation")
     532        return UI_STRING("navigation", "An ARIA accessibility group that contains the main navigation elements of a website.");   
     533    if (ariaType == "ARIALandmarkSearch")
     534        return UI_STRING("search", "An ARIA accessibility group that contains a search feature of a website.");   
     535    if (ariaType == "ARIAUserInterfaceTooltip")
     536        return UI_STRING("tooltip", "An ARIA accessibility group that acts as a tooltip.");   
     537    if (ariaType == "ARIATabPanel")
     538        return UI_STRING("tab panel", "An ARIA accessibility group that contains the content of a tab.");
     539    if (ariaType == "ARIADocumentMath")
     540        return UI_STRING("math", "An ARIA accessibility group that contains mathematical symbols.");
     541    return String();
     542}
     543
     544String WebPlatformStrategies::AXButtonActionVerb()
     545{
     546    return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility");
     547}
     548
     549String WebPlatformStrategies::AXRadioButtonActionVerb()
     550{
     551    return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility");
     552}
     553
     554String WebPlatformStrategies::AXTextFieldActionVerb()
     555{
     556    return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility");
     557}
     558
     559String WebPlatformStrategies::AXCheckedCheckBoxActionVerb()
     560{
     561    return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility");
     562}
     563
     564String WebPlatformStrategies::AXUncheckedCheckBoxActionVerb()
     565{
     566    return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility");
     567}
     568
     569String WebPlatformStrategies::AXMenuListActionVerb()
     570{
     571    return String();
     572}
     573
     574String WebPlatformStrategies::AXMenuListPopupActionVerb()
     575{
     576    return String();
     577}
     578
     579String WebPlatformStrategies::AXLinkActionVerb()
     580{
     581    return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility");
     582}
     583
     584String WebPlatformStrategies::missingPluginText()
     585{
     586    return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing");
     587}
     588
     589String WebPlatformStrategies::crashedPluginText()
     590{
     591    return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed");
     592}
     593
     594String WebPlatformStrategies::multipleFileUploadText(unsigned numberOfFiles)
     595{
     596    return [NSString stringWithFormat:UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles];
     597}
     598
     599String WebPlatformStrategies::unknownFileSizeText()
     600{
     601    return UI_STRING("Unknown", "Unknown filesize FTP directory listing item");
     602}
     603
     604String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size)
     605{
     606    return [NSString stringWithFormat:UI_STRING("%@ %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), (NSString *)filename, size.width(), size.height()];
     607}
     608
     609String WebPlatformStrategies::mediaElementLoadingStateText()
     610{
     611    return UI_STRING("Loading...", "Media controller status message when the media is loading");
     612}
     613
     614String WebPlatformStrategies::mediaElementLiveBroadcastStateText()
     615{
     616    return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast");
     617}
     618
     619String WebPlatformStrategies::localizedMediaControlElementString(const String& name)
     620{
     621    if (name == "AudioElement")
     622        return UI_STRING("audio element controller", "accessibility role description for audio element controller");
     623    if (name == "VideoElement")
     624        return UI_STRING("video element controller", "accessibility role description for video element controller");
     625    if (name == "MuteButton")
     626        return UI_STRING("mute", "accessibility role description for mute button");
     627    if (name == "UnMuteButton")
     628        return UI_STRING("unmute", "accessibility role description for turn mute off button");
     629    if (name == "PlayButton")
     630        return UI_STRING("play", "accessibility role description for play button");
     631    if (name == "PauseButton")
     632        return UI_STRING("pause", "accessibility role description for pause button");
     633    if (name == "Slider")
     634        return UI_STRING("movie time", "accessibility role description for timeline slider");
     635    if (name == "SliderThumb")
     636        return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb");
     637    if (name == "RewindButton")
     638        return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button");
     639    if (name == "ReturnToRealtimeButton")
     640        return UI_STRING("return to realtime", "accessibility role description for return to real time button");
     641    if (name == "CurrentTimeDisplay")
     642        return UI_STRING("elapsed time", "accessibility role description for elapsed time display");
     643    if (name == "TimeRemainingDisplay")
     644        return UI_STRING("remaining time", "accessibility role description for time remaining display");
     645    if (name == "StatusDisplay")
     646        return UI_STRING("status", "accessibility role description for movie status");
     647    if (name == "FullscreenButton")
     648        return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button");
     649    if (name == "SeekForwardButton")
     650        return UI_STRING("fast forward", "accessibility role description for fast forward button");
     651    if (name == "SeekBackButton")
     652        return UI_STRING("fast reverse", "accessibility role description for fast reverse button");
     653    if (name == "ShowClosedCaptionsButton")
     654        return UI_STRING("show closed captions", "accessibility role description for show closed captions button");
     655    if (name == "HideClosedCaptionsButton")
     656        return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button");
     657
     658    // FIXME: the ControlsPanel container should never be visible in the accessibility hierarchy.
     659    if (name == "ControlsPanel")
     660        return String();
     661
     662    ASSERT_NOT_REACHED();
     663    return String();
     664}
     665
     666String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name)
     667{
     668    if (name == "AudioElement")
     669        return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller");
     670    if (name == "VideoElement")
     671        return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller");
     672    if (name == "MuteButton")
     673        return UI_STRING("mute audio tracks", "accessibility help text for mute button");
     674    if (name == "UnMuteButton")
     675        return UI_STRING("unmute audio tracks", "accessibility help text for un mute button");
     676    if (name == "PlayButton")
     677        return UI_STRING("begin playback", "accessibility help text for play button");
     678    if (name == "PauseButton")
     679        return UI_STRING("pause playback", "accessibility help text for pause button");
     680    if (name == "Slider")
     681        return UI_STRING("movie time scrubber", "accessibility help text for timeline slider");
     682    if (name == "SliderThumb")
     683        return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb");
     684    if (name == "RewindButton")
     685        return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button");
     686    if (name == "ReturnToRealtimeButton")
     687        return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button");
     688    if (name == "CurrentTimeDisplay")
     689        return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display");
     690    if (name == "TimeRemainingDisplay")
     691        return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display");
     692    if (name == "StatusDisplay")
     693        return UI_STRING("current movie status", "accessibility help text for movie status display");
     694    if (name == "SeekBackButton")
     695        return UI_STRING("seek quickly back", "accessibility help text for fast rewind button");
     696    if (name == "SeekForwardButton")
     697        return UI_STRING("seek quickly forward", "accessibility help text for fast forward button");
     698    if (name == "FullscreenButton")
     699        return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button");
     700    if (name == "ShowClosedCaptionsButton")
     701        return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button");
     702    if (name == "HideClosedCaptionsButton")
     703        return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button");
     704
     705    ASSERT_NOT_REACHED();
     706    return String();
     707}
     708
     709String WebPlatformStrategies::localizedMediaTimeDescription(float time)
     710{
     711    if (!isfinite(time))
     712        return UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value");
     713
     714    int seconds = (int)fabsf(time);
     715    int days = seconds / (60 * 60 * 24);
     716    int hours = seconds / (60 * 60);
     717    int minutes = (seconds / 60) % 60;
     718    seconds %= 60;
     719
     720    if (days)
     721        return [NSString stringWithFormat:UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds];
     722    else if (hours)
     723        return [NSString stringWithFormat:UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds];
     724    else if (minutes)
     725        return [NSString stringWithFormat:UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds];
     726
     727    return [NSString stringWithFormat:UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds];
     728}
     729
     730String WebPlatformStrategies::validationMessageValueMissingText()
     731{
     732    return UI_STRING("value missing", "Validation message for required form control elements that have no value");
     733}
     734
     735String WebPlatformStrategies::validationMessageTypeMismatchText()
     736{
     737    return UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type");
     738}
     739
     740String WebPlatformStrategies::validationMessagePatternMismatchText()
     741{
     742    return UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern");
     743}
     744
     745String WebPlatformStrategies::validationMessageTooLongText()
     746{
     747    return UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length");
     748}
     749
     750String WebPlatformStrategies::validationMessageRangeUnderflowText()
     751{
     752    return UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum");
     753}
     754
     755String WebPlatformStrategies::validationMessageRangeOverflowText()
     756{
     757    return UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum");
     758}
     759
     760String WebPlatformStrategies::validationMessageStepMismatchText()
     761{
     762    return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute");
     763}
     764
  • trunk/WebKit/mac/WebCoreSupport/WebViewFactory.mm

    r61444 r63904  
    3232#import <WebKit/WebViewInternal.h>
    3333#import <WebKit/WebHTMLViewInternal.h>
    34 #import <WebKit/WebLocalizableStrings.h>
    3534#import <WebKit/WebNSUserDefaultsExtras.h>
    3635#import <WebKit/WebNSObjectExtras.h>
     
    6564}
    6665
    67 - (NSString *)inputElementAltText
    68 {
    69     return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value");
    70 }
    71 
    72 - (NSString *)resetButtonDefaultLabel
    73 {
    74     return UI_STRING("Reset", "default label for Reset buttons in forms on web pages");
    75 }
    76 
    77 - (NSString *)searchableIndexIntroduction
    78 {
    79     return UI_STRING("This is a searchable index. Enter search keywords: ",
    80         "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'");
    81 }
    82 
    83 - (NSString *)submitButtonDefaultLabel
    84 {
    85     return UI_STRING("Submit", "default label for Submit buttons in forms on web pages");
    86 }
    87 
    88 - (NSString *)fileButtonChooseFileLabel
    89 {
    90     return UI_STRING("Choose File", "title for file button used in HTML forms");
    91 }
    92 
    93 - (NSString *)fileButtonNoFileSelectedLabel
    94 {
    95     return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected");
    96 }
    97 
    98 - (NSString *)copyImageUnknownFileLabel
    99 {
    100     return UI_STRING("unknown", "Unknown filename");
    101 }
    102 
    103 - (NSString *)searchMenuNoRecentSearchesText
    104 {
    105     return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed");
    106 }
    107 
    108 - (NSString *)searchMenuRecentSearchesText
    109 {
    110     return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title");
    111 }
    112 
    113 - (NSString *)searchMenuClearRecentSearchesText
    114 {
    115     return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents");
    116 }
    117 
    11866- (NSString *)defaultLanguageCode
    11967{
    12068    return [NSUserDefaults _webkit_preferredLanguageCode];
    121 }
    122 
    123 - (NSString *)contextMenuItemTagOpenLinkInNewWindow
    124 {
    125     return UI_STRING("Open Link in New Window", "Open in New Window context menu item");
    126 }
    127 
    128 - (NSString *)contextMenuItemTagDownloadLinkToDisk
    129 {
    130     return UI_STRING("Download Linked File", "Download Linked File context menu item");
    131 }
    132 
    133 - (NSString *)contextMenuItemTagCopyLinkToClipboard
    134 {
    135     return UI_STRING("Copy Link", "Copy Link context menu item");
    136 }
    137 
    138 - (NSString *)contextMenuItemTagOpenImageInNewWindow
    139 {
    140     return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item");
    141 }
    142 
    143 - (NSString *)contextMenuItemTagDownloadImageToDisk
    144 {
    145     return UI_STRING("Download Image", "Download Image context menu item");
    146 }
    147 
    148 - (NSString *)contextMenuItemTagCopyImageToClipboard
    149 {
    150     return UI_STRING("Copy Image", "Copy Image context menu item");
    151 }
    152 
    153 - (NSString *)contextMenuItemTagOpenFrameInNewWindow
    154 {
    155     return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
    156 }
    157 
    158 - (NSString *)contextMenuItemTagCopy
    159 {
    160     return UI_STRING("Copy", "Copy context menu item");
    161 }
    162 
    163 - (NSString *)contextMenuItemTagGoBack
    164 {
    165     return UI_STRING("Back", "Back context menu item");
    166 }
    167 
    168 - (NSString *)contextMenuItemTagGoForward
    169 {
    170     return UI_STRING("Forward", "Forward context menu item");
    171 }
    172 
    173 - (NSString *)contextMenuItemTagStop
    174 {
    175     return UI_STRING("Stop", "Stop context menu item");
    176 }
    177 
    178 - (NSString *)contextMenuItemTagReload
    179 {
    180     return UI_STRING("Reload", "Reload context menu item");
    181 }
    182 
    183 - (NSString *)contextMenuItemTagCut
    184 {
    185     return UI_STRING("Cut", "Cut context menu item");
    186 }
    187 
    188 - (NSString *)contextMenuItemTagPaste
    189 {
    190     return UI_STRING("Paste", "Paste context menu item");
    191 }
    192 
    193 - (NSString *)contextMenuItemTagNoGuessesFound
    194 {
    195     return UI_STRING("No Guesses Found", "No Guesses Found context menu item");
    196 }
    197 
    198 - (NSString *)contextMenuItemTagIgnoreSpelling
    199 {
    200     return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item");
    201 }
    202 
    203 - (NSString *)contextMenuItemTagLearnSpelling
    204 {
    205     return UI_STRING("Learn Spelling", "Learn Spelling context menu item");
    206 }
    207 
    208 - (NSString *)contextMenuItemTagSearchInSpotlight
    209 {
    210     return UI_STRING("Search in Spotlight", "Search in Spotlight context menu item");
    211 }
    212 
    213 - (NSString *)contextMenuItemTagSearchWeb
    214 {
    215     return UI_STRING("Search in Google", "Search in Google context menu item");
    216 }
    217 
    218 - (NSString *)contextMenuItemTagLookUpInDictionary
    219 {
    220     return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
    221 }
    222 
    223 - (NSString *)contextMenuItemTagOpenLink
    224 {
    225     return UI_STRING("Open Link", "Open Link context menu item");
    226 }
    227 
    228 - (NSString *)contextMenuItemTagIgnoreGrammar
    229 {
    230     return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item");
    231 }
    232 
    233 - (NSString *)contextMenuItemTagSpellingMenu
    234 {
    235 #ifndef BUILDING_ON_TIGER
    236     return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item");
    237 #else
    238     return UI_STRING("Spelling", "Spelling context sub-menu item");
    239 #endif
    240 }
    241 
    242 - (NSString *)contextMenuItemTagShowSpellingPanel:(bool)show
    243 {
    244 #ifndef BUILDING_ON_TIGER
    245     if (show)
    246         return UI_STRING("Show Spelling and Grammar", "menu item title");
    247     return UI_STRING("Hide Spelling and Grammar", "menu item title");
    248 #else
    249     return UI_STRING("Spelling...", "menu item title");
    250 #endif
    251 }
    252 
    253 - (NSString *)contextMenuItemTagCheckSpelling
    254 {
    255 #ifndef BUILDING_ON_TIGER
    256     return UI_STRING("Check Document Now", "Check spelling context menu item");
    257 #else
    258     return UI_STRING("Check Spelling", "Check spelling context menu item");
    259 #endif
    260 }
    261 
    262 - (NSString *)contextMenuItemTagCheckSpellingWhileTyping
    263 {
    264 #ifndef BUILDING_ON_TIGER
    265     return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item");
    266 #else
    267     return UI_STRING("Check Spelling as You Type", "Check spelling while typing context menu item");
    268 #endif
    269 }
    270 
    271 - (NSString *)contextMenuItemTagCheckGrammarWithSpelling
    272 {
    273     return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item");
    274 }
    275 
    276 - (NSString *)contextMenuItemTagFontMenu
    277 {
    278     return UI_STRING("Font", "Font context sub-menu item");
    279 }
    280 
    281 - (NSString *)contextMenuItemTagShowFonts
    282 {
    283     return UI_STRING("Show Fonts", "Show fonts context menu item");
    284 }
    285 
    286 - (NSString *)contextMenuItemTagBold
    287 {
    288     return UI_STRING("Bold", "Bold context menu item");
    289 }
    290 
    291 - (NSString *)contextMenuItemTagItalic
    292 {
    293     return UI_STRING("Italic", "Italic context menu item");
    294 }
    295 
    296 - (NSString *)contextMenuItemTagUnderline
    297 {
    298     return UI_STRING("Underline", "Underline context menu item");
    299 }
    300 
    301 - (NSString *)contextMenuItemTagOutline
    302 {
    303     return UI_STRING("Outline", "Outline context menu item");
    304 }
    305 
    306 - (NSString *)contextMenuItemTagStyles
    307 {
    308     return UI_STRING("Styles...", "Styles context menu item");
    309 }
    310 
    311 - (NSString *)contextMenuItemTagShowColors
    312 {
    313     return UI_STRING("Show Colors", "Show colors context menu item");
    314 }
    315 
    316 - (NSString *)contextMenuItemTagSpeechMenu
    317 {
    318     return UI_STRING("Speech", "Speech context sub-menu item");
    319 }
    320 
    321 - (NSString *)contextMenuItemTagStartSpeaking
    322 {
    323     return UI_STRING("Start Speaking", "Start speaking context menu item");
    324 }
    325 
    326 - (NSString *)contextMenuItemTagStopSpeaking
    327 {
    328     return UI_STRING("Stop Speaking", "Stop speaking context menu item");
    329 }
    330 
    331 - (NSString *)contextMenuItemTagWritingDirectionMenu
    332 {
    333 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
    334     return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item");
    335 #else
    336     return UI_STRING("Writing Direction", "Writing direction context sub-menu item");
    337 #endif
    338 }
    339 
    340 - (NSString *)contextMenuItemTagTextDirectionMenu
    341 {
    342     return UI_STRING("Selection Direction", "Selection direction context sub-menu item");
    343 }
    344 
    345 - (NSString *)contextMenuItemTagDefaultDirection
    346 {
    347     return UI_STRING("Default", "Default writing direction context menu item");
    348 }
    349 
    350 - (NSString *)contextMenuItemTagLeftToRight
    351 {
    352     return UI_STRING("Left to Right", "Left to Right context menu item");
    353 }
    354 
    355 - (NSString *)contextMenuItemTagRightToLeft
    356 {
    357     return UI_STRING("Right to Left", "Right to Left context menu item");
    358 }
    359 
    360 - (NSString *)contextMenuItemTagCorrectSpellingAutomatically
    361 {
    362     return UI_STRING("Correct Spelling Automatically", "Correct Spelling Automatically context menu item");
    363 }
    364 
    365 - (NSString *)contextMenuItemTagSubstitutionsMenu
    366 {
    367     return UI_STRING("Substitutions", "Substitutions context sub-menu item");
    368 }
    369 
    370 - (NSString *)contextMenuItemTagShowSubstitutions:(bool)show
    371 {
    372     if (show)
    373         return UI_STRING("Show Substitutions", "menu item title");
    374     return UI_STRING("Hide Substitutions", "menu item title");
    375 }
    376 
    377 - (NSString *)contextMenuItemTagSmartCopyPaste
    378 {
    379     return UI_STRING("Smart Copy/Paste", "Smart Copy/Paste context menu item");
    380 }
    381 
    382 - (NSString *)contextMenuItemTagSmartQuotes
    383 {
    384     return UI_STRING("Smart Quotes", "Smart Quotes context menu item");
    385 }
    386 
    387 - (NSString *)contextMenuItemTagSmartDashes
    388 {
    389     return UI_STRING("Smart Dashes", "Smart Dashes context menu item");
    390 }
    391 
    392 - (NSString *)contextMenuItemTagSmartLinks
    393 {
    394     return UI_STRING("Smart Links", "Smart Links context menu item");
    395 }
    396 
    397 - (NSString *)contextMenuItemTagTextReplacement
    398 {
    399     return UI_STRING("Text Replacement", "Text Replacement context menu item");
    400 }
    401 
    402 - (NSString *)contextMenuItemTagTransformationsMenu
    403 {
    404     return UI_STRING("Transformations", "Transformations context sub-menu item");
    405 }
    406 
    407 - (NSString *)contextMenuItemTagMakeUpperCase
    408 {
    409     return UI_STRING("Make Upper Case", "Make Upper Case context menu item");
    410 }
    411 
    412 - (NSString *)contextMenuItemTagMakeLowerCase
    413 {
    414     return UI_STRING("Make Lower Case", "Make Lower Case context menu item");
    415 }
    416 
    417 - (NSString *)contextMenuItemTagCapitalize
    418 {
    419     return UI_STRING("Capitalize", "Capitalize context menu item");
    420 }
    421 
    422 - (NSString *)contextMenuItemTagChangeBack:(NSString *)replacedString
    423 {
    424     static NSString *formatString = nil;
    425 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
    426     static bool lookedUpString = false;
    427     if (!lookedUpString) {
    428         formatString = [[[NSBundle bundleForClass:[NSSpellChecker class]] localizedStringForKey:@"Change Back to \\U201C%@\\U201D" value:nil table:@"MenuCommands"] retain];
    429         lookedUpString = true;
    430     }
    431 #endif
    432     return formatString ? [NSString stringWithFormat:formatString, replacedString] : replacedString;
    433 }
    434 
    435 - (NSString *)contextMenuItemTagInspectElement
    436 {
    437     return UI_STRING("Inspect Element", "Inspect Element context menu item");
    43869}
    43970
     
    508139}
    509140
    510 - (NSString *)AXWebAreaText
    511 {
    512     return UI_STRING("HTML content", "accessibility role description for web area");
    513 }
    514 
    515 - (NSString *)AXLinkText
    516 {
    517     return UI_STRING("link", "accessibility role description for link");
    518 }
    519 
    520 - (NSString *)AXListMarkerText
    521 {
    522     return UI_STRING("list marker", "accessibility role description for list marker");
    523 }
    524 
    525 - (NSString *)AXImageMapText
    526 {
    527     return UI_STRING("image map", "accessibility role description for image map");
    528 }
    529 
    530 - (NSString *)AXHeadingText
    531 {
    532     return UI_STRING("heading", "accessibility role description for headings");
    533 }
    534 
    535 - (NSString *)AXDefinitionListTermText
    536 {
    537     return UI_STRING("term", "term word of a definition");
    538 }
    539 
    540 - (NSString *)AXDefinitionListDefinitionText
    541 {
    542     return UI_STRING("definition", "definition phrase");
    543 }
    544 
    545 - (NSString *)AXARIAContentGroupText:(NSString *)ariaType
    546 {
    547     if ([ariaType isEqualToString:@"ARIAApplicationAlert"])
    548         return UI_STRING("alert", "An ARIA accessibility group that acts as an alert.");
    549     if ([ariaType isEqualToString:@"ARIAApplicationAlertDialog"])
    550         return UI_STRING("alert dialog", "An ARIA accessibility group that acts as an alert dialog.");
    551     if ([ariaType isEqualToString:@"ARIAApplicationDialog"])
    552         return UI_STRING("dialog", "An ARIA accessibility group that acts as an dialog.");
    553     if ([ariaType isEqualToString:@"ARIAApplicationLog"])
    554         return UI_STRING("log", "An ARIA accessibility group that acts as a console log.");
    555     if ([ariaType isEqualToString:@"ARIAApplicationMarquee"])
    556         return UI_STRING("marquee", "An ARIA accessibility group that acts as a marquee.");   
    557     if ([ariaType isEqualToString:@"ARIAApplicationStatus"])
    558         return UI_STRING("application status", "An ARIA accessibility group that acts as a status update.");   
    559     if ([ariaType isEqualToString:@"ARIAApplicationTimer"])
    560         return UI_STRING("timer", "An ARIA accessibility group that acts as an updating timer.");   
    561     if ([ariaType isEqualToString:@"ARIADocument"])
    562         return UI_STRING("document", "An ARIA accessibility group that acts as a document.");   
    563     if ([ariaType isEqualToString:@"ARIADocumentArticle"])
    564         return UI_STRING("article", "An ARIA accessibility group that acts as an article.");   
    565     if ([ariaType isEqualToString:@"ARIADocumentNote"])
    566         return UI_STRING("note", "An ARIA accessibility group that acts as a note in a document.");   
    567     if ([ariaType isEqualToString:@"ARIADocumentRegion"])
    568         return UI_STRING("region", "An ARIA accessibility group that acts as a distinct region in a document.");   
    569     if ([ariaType isEqualToString:@"ARIALandmarkApplication"])
    570         return UI_STRING("application", "An ARIA accessibility group that acts as an application.");   
    571     if ([ariaType isEqualToString:@"ARIALandmarkBanner"])
    572         return UI_STRING("banner", "An ARIA accessibility group that acts as a banner.");   
    573     if ([ariaType isEqualToString:@"ARIALandmarkComplementary"])
    574         return UI_STRING("complementary", "An ARIA accessibility group that acts as a region of complementary information.");   
    575     if ([ariaType isEqualToString:@"ARIALandmarkContentInfo"])
    576         return UI_STRING("content", "An ARIA accessibility group that contains content.");   
    577     if ([ariaType isEqualToString:@"ARIALandmarkMain"])
    578         return UI_STRING("main", "An ARIA accessibility group that is the main portion of the website.");   
    579     if ([ariaType isEqualToString:@"ARIALandmarkNavigation"])
    580         return UI_STRING("navigation", "An ARIA accessibility group that contains the main navigation elements of a website.");   
    581     if ([ariaType isEqualToString:@"ARIALandmarkSearch"])
    582         return UI_STRING("search", "An ARIA accessibility group that contains a search feature of a website.");   
    583     if ([ariaType isEqualToString:@"ARIAUserInterfaceTooltip"])
    584         return UI_STRING("tooltip", "An ARIA accessibility group that acts as a tooltip.");   
    585     if ([ariaType isEqualToString:@"ARIATabPanel"])
    586         return UI_STRING("tab panel", "An ARIA accessibility group that contains the content of a tab.");
    587     if ([ariaType isEqualToString:@"ARIADocumentMath"])
    588         return UI_STRING("math", "An ARIA accessibility group that contains mathematical symbols.");
    589     return nil;
    590 }
    591 
    592 - (NSString *)AXButtonActionVerb
    593 {
    594     return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility");
    595 }
    596 
    597 - (NSString *)AXRadioButtonActionVerb
    598 {
    599     return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility");
    600 }
    601 
    602 - (NSString *)AXTextFieldActionVerb
    603 {
    604     return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility");
    605 }
    606 
    607 - (NSString *)AXCheckedCheckBoxActionVerb
    608 {
    609     return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility");
    610 }
    611 
    612 - (NSString *)AXUncheckedCheckBoxActionVerb
    613 {
    614     return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility");
    615 }
    616 
    617 - (NSString *)AXLinkActionVerb
    618 {
    619     return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility");
    620 }
    621 
    622 - (NSString *)AXMenuListPopupActionVerb
    623 {
    624     return nil;
    625 }
    626 
    627 - (NSString *)AXMenuListActionVerb
    628 {
    629     return nil;
    630 }
    631 
    632 - (NSString *)missingPluginText
    633 {
    634     return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing");
    635 }
    636 
    637 - (NSString *)crashedPluginText
    638 {
    639     return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed");
    640 }
    641 
    642 - (NSString *)multipleFileUploadTextForNumberOfFiles:(unsigned)numberOfFiles
    643 {
    644     return [NSString stringWithFormat:UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles];
    645 }
    646 
    647 - (NSString *)unknownFileSizeText
    648 {
    649     return UI_STRING("Unknown", "Unknown filesize FTP directory listing item");
    650 }
    651 
    652 - (NSString*)imageTitleForFilename:(NSString*)filename width:(int)width height:(int)height
    653 {
    654     return [NSString stringWithFormat:UI_STRING("%@ %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filename, width, height];
    655 }
    656 
    657 - (NSString*)mediaElementLoadingStateText
    658 {
    659     return UI_STRING("Loading...", "Media controller status message when the media is loading");
    660 }
    661 
    662 - (NSString*)mediaElementLiveBroadcastStateText
    663 {
    664     return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast");
    665 }
    666 
    667 - (NSString*)localizedMediaControlElementString:(NSString*)name
    668 {
    669     if ([name isEqualToString:@"AudioElement"])
    670         return UI_STRING("audio element controller", "accessibility role description for audio element controller");
    671     if ([name isEqualToString:@"VideoElement"])
    672         return UI_STRING("video element controller", "accessibility role description for video element controller");
    673 
    674     // FIXME: the ControlsPanel container should never be visible in the accessibility hierarchy.
    675     if ([name isEqualToString:@"ControlsPanel"])
    676         return @"";
    677 
    678     if ([name isEqualToString:@"MuteButton"])
    679         return UI_STRING("mute", "accessibility role description for mute button");
    680     if ([name isEqualToString:@"UnMuteButton"])
    681         return UI_STRING("unmute", "accessibility role description for turn mute off button");
    682     if ([name isEqualToString:@"PlayButton"])
    683         return UI_STRING("play", "accessibility role description for play button");
    684     if ([name isEqualToString:@"PauseButton"])
    685         return UI_STRING("pause", "accessibility role description for pause button");
    686     if ([name isEqualToString:@"Slider"])
    687         return UI_STRING("movie time", "accessibility role description for timeline slider");
    688     if ([name isEqualToString:@"SliderThumb"])
    689         return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb");
    690     if ([name isEqualToString:@"RewindButton"])
    691         return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button");
    692     if ([name isEqualToString:@"ReturnToRealtimeButton"])
    693         return UI_STRING("return to realtime", "accessibility role description for return to real time button");
    694     if ([name isEqualToString:@"CurrentTimeDisplay"])
    695         return UI_STRING("elapsed time", "accessibility role description for elapsed time display");
    696     if ([name isEqualToString:@"TimeRemainingDisplay"])
    697         return UI_STRING("remaining time", "accessibility role description for time remaining display");
    698     if ([name isEqualToString:@"StatusDisplay"])
    699         return UI_STRING("status", "accessibility role description for movie status");
    700     if ([name isEqualToString:@"FullscreenButton"])
    701         return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button");
    702     if ([name isEqualToString:@"SeekForwardButton"])
    703         return UI_STRING("fast forward", "accessibility role description for fast forward button");
    704     if ([name isEqualToString:@"SeekBackButton"])
    705         return UI_STRING("fast reverse", "accessibility role description for fast reverse button");
    706     if ([name isEqualToString:@"ShowClosedCaptionsButton"])
    707         return UI_STRING("show closed captions", "accessibility role description for show closed captions button");
    708     if ([name isEqualToString:@"HideClosedCaptionsButton"])
    709         return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button");
    710 
    711     ASSERT_NOT_REACHED();
    712     return @"";
    713 }
    714 
    715 - (NSString*)localizedMediaControlElementHelpText:(NSString*)name
    716 {
    717     if ([name isEqualToString:@"AudioElement"])
    718         return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller");
    719     if ([name isEqualToString:@"VideoElement"])
    720         return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller");
    721 
    722     if ([name isEqualToString:@"MuteButton"])
    723         return UI_STRING("mute audio tracks", "accessibility help text for mute button");
    724     if ([name isEqualToString:@"UnMuteButton"])
    725         return UI_STRING("unmute audio tracks", "accessibility help text for un mute button");
    726     if ([name isEqualToString:@"PlayButton"])
    727         return UI_STRING("begin playback", "accessibility help text for play button");
    728     if ([name isEqualToString:@"PauseButton"])
    729         return UI_STRING("pause playback", "accessibility help text for pause button");
    730     if ([name isEqualToString:@"Slider"])
    731         return UI_STRING("movie time scrubber", "accessibility help text for timeline slider");
    732     if ([name isEqualToString:@"SliderThumb"])
    733         return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb");
    734     if ([name isEqualToString:@"RewindButton"])
    735         return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button");
    736     if ([name isEqualToString:@"ReturnToRealtimeButton"])
    737         return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button");
    738     if ([name isEqualToString:@"CurrentTimeDisplay"])
    739         return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display");
    740     if ([name isEqualToString:@"TimeRemainingDisplay"])
    741         return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display");
    742     if ([name isEqualToString:@"StatusDisplay"])
    743         return UI_STRING("current movie status", "accessibility help text for movie status display");
    744     if ([name isEqualToString:@"SeekBackButton"])
    745         return UI_STRING("seek quickly back", "accessibility help text for fast rewind button");
    746     if ([name isEqualToString:@"SeekForwardButton"])
    747         return UI_STRING("seek quickly forward", "accessibility help text for fast forward button");
    748     if ([name isEqualToString:@"FullscreenButton"])
    749         return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button");
    750     if ([name isEqualToString:@"ShowClosedCaptionsButton"])
    751         return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button");
    752     if ([name isEqualToString:@"HideClosedCaptionsButton"])
    753         return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button");
    754     ASSERT_NOT_REACHED();
    755     return @"";
    756 }
    757 
    758 - (NSString*)localizedMediaTimeDescription:(float)time
    759 {
    760     if (!isfinite(time))
    761         return UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value");
    762 
    763     int seconds = (int)fabsf(time);
    764     int days = seconds / (60 * 60 * 24);
    765     int hours = seconds / (60 * 60);
    766     int minutes = (seconds / 60) % 60;
    767     seconds %= 60;
    768 
    769     if (days)
    770         return [NSString stringWithFormat:UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds];
    771     else if (hours)
    772         return [NSString stringWithFormat:UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds];
    773     else if (minutes)
    774         return [NSString stringWithFormat:UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds];
    775 
    776     return [NSString stringWithFormat:UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds];
    777 }
    778 
    779 - (NSString *)validationMessageValueMissingText
    780 {
    781     return UI_STRING("value missing", "Validation message for required form control elements that have no value");
    782 }
    783 
    784 - (NSString *)validationMessageTypeMismatchText
    785 {
    786     return UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type");
    787 }
    788 
    789 - (NSString *)validationMessagePatternMismatchText
    790 {
    791     return UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern");
    792 }
    793 
    794 - (NSString *)validationMessageTooLongText
    795 {
    796     return UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length");
    797 }
    798 
    799 - (NSString *)validationMessageRangeUnderflowText
    800 {
    801     return UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum");
    802 }
    803 
    804 - (NSString *)validationMessageRangeOverflowText
    805 {
    806     return UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum");
    807 }
    808 
    809 - (NSString *)validationMessageStepMismatchText
    810 {
    811     return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute");
    812 }
    813 
    814141@end
  • trunk/WebKit2/ChangeLog

    r63903 r63904  
     12010-07-22  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Patch for https://bugs.webkit.org/show_bug.cgi?id=42836
     6        Add localized strings stubs for WebKit2.
     7
     8        Gets us below 200 tests failing in WebKitTestRunner.
     9
     10        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
     11        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
     12
    1132010-07-22  Andras Becsi  <abecsi@webkit.org>
    214
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

    r61725 r63904  
    2828#if USE(PLATFORM_STRATEGIES)
    2929
     30#include "NotImplemented.h"
    3031#include "PluginInfoStore.h"
    3132#include "WebCoreArgumentCoders.h"
    3233#include "WebProcess.h"
    3334#include "WebProcessProxyMessageKinds.h"
     35#include <wtf/MathExtras.h>
     36#include <wtf/text/CString.h>
     37
     38// FIXME: Implement localization.
     39#define UI_STRING(string, description) string
     40#define UI_STRING_KEY(string, key, description) string
    3441
    3542using namespace WebCore;
     
    5562    return this;
    5663}
     64
     65LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy()
     66{
     67    return this;
     68}
     69
     70// PluginStrategy
    5771
    5872void WebPlatformStrategies::populatePluginCache()
     
    88102}
    89103
     104// LocalizationStrategy   
     105
     106String WebPlatformStrategies::inputElementAltText()
     107{
     108    return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value");
     109}
     110
     111String WebPlatformStrategies::resetButtonDefaultLabel()
     112{
     113    return UI_STRING("Reset", "default label for Reset buttons in forms on web pages");
     114}
     115
     116String WebPlatformStrategies::searchableIndexIntroduction()
     117{
     118    return UI_STRING("This is a searchable index. Enter search keywords: ",
     119        "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'");
     120}
     121
     122String WebPlatformStrategies::submitButtonDefaultLabel()
     123{
     124    return UI_STRING("Submit", "default label for Submit buttons in forms on web pages");
     125}
     126
     127String WebPlatformStrategies::fileButtonChooseFileLabel()
     128{
     129    return UI_STRING("Choose File", "title for file button used in HTML forms");
     130}
     131
     132String WebPlatformStrategies::fileButtonNoFileSelectedLabel()
     133{
     134    return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected");
     135}
     136
     137String WebPlatformStrategies::copyImageUnknownFileLabel()
     138{
     139    return UI_STRING("unknown", "Unknown filename");
     140}
     141
     142#if ENABLE(CONTEXT_MENUS)
     143
     144String WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow()
     145{
     146    return UI_STRING("Open Link in New Window", "Open in New Window context menu item");
     147}
     148
     149String WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk()
     150{
     151    return UI_STRING("Download Linked File", "Download Linked File context menu item");
     152}
     153
     154String WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard()
     155{
     156    return UI_STRING("Copy Link", "Copy Link context menu item");
     157}
     158
     159String WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow()
     160{
     161    return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item");
     162}
     163
     164String WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk()
     165{
     166    return UI_STRING("Download Image", "Download Image context menu item");
     167}
     168
     169String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard()
     170{
     171    return UI_STRING("Copy Image", "Copy Image context menu item");
     172}
     173
     174String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow()
     175{
     176    return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item");
     177}
     178
     179String WebPlatformStrategies::contextMenuItemTagCopy()
     180{
     181    return UI_STRING("Copy", "Copy context menu item");
     182}
     183
     184String WebPlatformStrategies::contextMenuItemTagGoBack()
     185{
     186    return UI_STRING("Back", "Back context menu item");
     187}
     188
     189String WebPlatformStrategies::contextMenuItemTagGoForward()
     190{
     191    return UI_STRING("Forward", "Forward context menu item");
     192}
     193
     194String WebPlatformStrategies::contextMenuItemTagStop()
     195{
     196    return UI_STRING("Stop", "Stop context menu item");
     197}
     198
     199String WebPlatformStrategies::contextMenuItemTagReload()
     200{
     201    return UI_STRING("Reload", "Reload context menu item");
     202}
     203
     204String WebPlatformStrategies::contextMenuItemTagCut()
     205{
     206    return UI_STRING("Cut", "Cut context menu item");
     207}
     208
     209String WebPlatformStrategies::contextMenuItemTagPaste()
     210{
     211    return UI_STRING("Paste", "Paste context menu item");
     212}
     213
     214#if PLATFORM(GTK)
     215
     216String WebPlatformStrategies::contextMenuItemTagDelete()
     217{
     218    notImplemented();
     219    return "Delete";
     220}
     221
     222String WebPlatformStrategies::contextMenuItemTagSelectAll()
     223{
     224    notImplemented();
     225    return "Select All";
     226}
     227
     228String WebPlatformStrategies::contextMenuItemTagInputMethods()
     229{
     230    notImplemented();
     231    return "Input Methods";
     232}
     233
     234String WebPlatformStrategies::contextMenuItemTagUnicode()
     235{
     236    notImplemented();
     237    return "Unicode";
     238}
     239
     240#endif
     241
     242String WebPlatformStrategies::contextMenuItemTagNoGuessesFound()
     243{
     244    return UI_STRING("No Guesses Found", "No Guesses Found context menu item");
     245}
     246
     247String WebPlatformStrategies::contextMenuItemTagIgnoreSpelling()
     248{
     249    return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item");
     250}
     251
     252String WebPlatformStrategies::contextMenuItemTagLearnSpelling()
     253{
     254    return UI_STRING("Learn Spelling", "Learn Spelling context menu item");
     255}
     256
     257String WebPlatformStrategies::contextMenuItemTagSearchWeb()
     258{
     259    return UI_STRING("Search in Google", "Search in Google context menu item");
     260}
     261
     262String WebPlatformStrategies::contextMenuItemTagLookUpInDictionary()
     263{
     264    return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
     265}
     266
     267String WebPlatformStrategies::contextMenuItemTagOpenLink()
     268{
     269    return UI_STRING("Open Link", "Open Link context menu item");
     270}
     271
     272String WebPlatformStrategies::contextMenuItemTagIgnoreGrammar()
     273{
     274    return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item");
     275}
     276
     277String WebPlatformStrategies::contextMenuItemTagSpellingMenu()
     278{
     279    return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item");
     280}
     281
     282String WebPlatformStrategies::contextMenuItemTagShowSpellingPanel(bool show)
     283{
     284    if (show)
     285        return UI_STRING("Show Spelling and Grammar", "menu item title");
     286    return UI_STRING("Hide Spelling and Grammar", "menu item title");
     287}
     288
     289String WebPlatformStrategies::contextMenuItemTagCheckSpelling()
     290{
     291    return UI_STRING("Check Document Now", "Check spelling context menu item");
     292}
     293
     294String WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping()
     295{
     296    return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item");
     297}
     298
     299String WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling()
     300{
     301    return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item");
     302}
     303
     304String WebPlatformStrategies::contextMenuItemTagFontMenu()
     305{
     306    return UI_STRING("Font", "Font context sub-menu item");
     307}
     308
     309String WebPlatformStrategies::contextMenuItemTagBold()
     310{
     311    return UI_STRING("Bold", "Bold context menu item");
     312}
     313
     314String WebPlatformStrategies::contextMenuItemTagItalic()
     315{
     316    return UI_STRING("Italic", "Italic context menu item");
     317}
     318
     319String WebPlatformStrategies::contextMenuItemTagUnderline()
     320{
     321    return UI_STRING("Underline", "Underline context menu item");
     322}
     323
     324String WebPlatformStrategies::contextMenuItemTagOutline()
     325{
     326    return UI_STRING("Outline", "Outline context menu item");
     327}
     328
     329String WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu()
     330{
     331    return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item");
     332}
     333
     334String WebPlatformStrategies::contextMenuItemTagTextDirectionMenu()
     335{
     336    return UI_STRING("Selection Direction", "Selection direction context sub-menu item");
     337}
     338
     339String WebPlatformStrategies::contextMenuItemTagDefaultDirection()
     340{
     341    return UI_STRING("Default", "Default writing direction context menu item");
     342}
     343
     344String WebPlatformStrategies::contextMenuItemTagLeftToRight()
     345{
     346    return UI_STRING("Left to Right", "Left to Right context menu item");
     347}
     348
     349String WebPlatformStrategies::contextMenuItemTagRightToLeft()
     350{
     351    return UI_STRING("Right to Left", "Right to Left context menu item");
     352}
     353
     354#if PLATFORM(MAC)
     355
     356String WebPlatformStrategies::contextMenuItemTagSearchInSpotlight()
     357{
     358    return UI_STRING("Search in Spotlight", "Search in Spotlight context menu item");
     359}
     360
     361String WebPlatformStrategies::contextMenuItemTagShowFonts()
     362{
     363    return UI_STRING("Show Fonts", "Show fonts context menu item");
     364}
     365
     366String WebPlatformStrategies::contextMenuItemTagStyles()
     367{
     368    return UI_STRING("Styles...", "Styles context menu item");
     369}
     370
     371String WebPlatformStrategies::contextMenuItemTagShowColors()
     372{
     373    return UI_STRING("Show Colors", "Show colors context menu item");
     374}
     375
     376String WebPlatformStrategies::contextMenuItemTagSpeechMenu()
     377{
     378    return UI_STRING("Speech", "Speech context sub-menu item");
     379}
     380
     381String WebPlatformStrategies::contextMenuItemTagStartSpeaking()
     382{
     383    return UI_STRING("Start Speaking", "Start speaking context menu item");
     384}
     385
     386String WebPlatformStrategies::contextMenuItemTagStopSpeaking()
     387{
     388    return UI_STRING("Stop Speaking", "Stop speaking context menu item");
     389}
     390
     391String WebPlatformStrategies::contextMenuItemTagCorrectSpellingAutomatically()
     392{
     393    return UI_STRING("Correct Spelling Automatically", "Correct Spelling Automatically context menu item");
     394}
     395
     396String WebPlatformStrategies::contextMenuItemTagSubstitutionsMenu()
     397{
     398    return UI_STRING("Substitutions", "Substitutions context sub-menu item");
     399}
     400
     401String WebPlatformStrategies::contextMenuItemTagShowSubstitutions(bool show)
     402{
     403    if (show)
     404        return UI_STRING("Show Substitutions", "menu item title");
     405    return UI_STRING("Hide Substitutions", "menu item title");
     406}
     407
     408String WebPlatformStrategies::contextMenuItemTagSmartCopyPaste()
     409{
     410    return UI_STRING("Smart Copy/Paste", "Smart Copy/Paste context menu item");
     411}
     412
     413String WebPlatformStrategies::contextMenuItemTagSmartQuotes()
     414{
     415    return UI_STRING("Smart Quotes", "Smart Quotes context menu item");
     416}
     417
     418String WebPlatformStrategies::contextMenuItemTagSmartDashes()
     419{
     420    return UI_STRING("Smart Dashes", "Smart Dashes context menu item");
     421}
     422
     423String WebPlatformStrategies::contextMenuItemTagSmartLinks()
     424{
     425    return UI_STRING("Smart Links", "Smart Links context menu item");
     426}
     427
     428String WebPlatformStrategies::contextMenuItemTagTextReplacement()
     429{
     430    return UI_STRING("Text Replacement", "Text Replacement context menu item");
     431}
     432
     433String WebPlatformStrategies::contextMenuItemTagTransformationsMenu()
     434{
     435    return UI_STRING("Transformations", "Transformations context sub-menu item");
     436}
     437
     438String WebPlatformStrategies::contextMenuItemTagMakeUpperCase()
     439{
     440    return UI_STRING("Make Upper Case", "Make Upper Case context menu item");
     441}
     442
     443String WebPlatformStrategies::contextMenuItemTagMakeLowerCase()
     444{
     445    return UI_STRING("Make Lower Case", "Make Lower Case context menu item");
     446}
     447
     448String WebPlatformStrategies::contextMenuItemTagCapitalize()
     449{
     450    return UI_STRING("Capitalize", "Capitalize context menu item");
     451}
     452
     453String WebPlatformStrategies::contextMenuItemTagChangeBack(const String& replacedString)
     454{
     455    notImplemented();
     456    return replacedString;
     457}
     458
     459#endif
     460
     461String WebPlatformStrategies::contextMenuItemTagInspectElement()
     462{
     463    return UI_STRING("Inspect Element", "Inspect Element context menu item");
     464}
     465
     466#endif // ENABLE(CONTEXT_MENUS)
     467
     468String WebPlatformStrategies::searchMenuNoRecentSearchesText()
     469{
     470    return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed");
     471}
     472
     473String WebPlatformStrategies::searchMenuRecentSearchesText()
     474{
     475    return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title");
     476}
     477
     478String WebPlatformStrategies::searchMenuClearRecentSearchesText()
     479{
     480    return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents");
     481}
     482
     483String WebPlatformStrategies::AXWebAreaText()
     484{
     485    return UI_STRING("HTML content", "accessibility role description for web area");
     486}
     487
     488String WebPlatformStrategies::AXLinkText()
     489{
     490    return UI_STRING("link", "accessibility role description for link");
     491}
     492
     493String WebPlatformStrategies::AXListMarkerText()
     494{
     495    return UI_STRING("list marker", "accessibility role description for list marker");
     496}
     497
     498String WebPlatformStrategies::AXImageMapText()
     499{
     500    return UI_STRING("image map", "accessibility role description for image map");
     501}
     502
     503String WebPlatformStrategies::AXHeadingText()
     504{
     505    return UI_STRING("heading", "accessibility role description for headings");
     506}
     507
     508String WebPlatformStrategies::AXDefinitionListTermText()
     509{
     510    return UI_STRING("term", "term word of a definition");
     511}
     512
     513String WebPlatformStrategies::AXDefinitionListDefinitionText()
     514{
     515    return UI_STRING("definition", "definition phrase");
     516}
     517
     518String WebPlatformStrategies::AXARIAContentGroupText(const String& ariaType)
     519{
     520    if (ariaType == "ARIAApplicationAlert")
     521        return UI_STRING("alert", "An ARIA accessibility group that acts as an alert.");
     522    if (ariaType == "ARIAApplicationAlertDialog")
     523        return UI_STRING("alert dialog", "An ARIA accessibility group that acts as an alert dialog.");
     524    if (ariaType == "ARIAApplicationDialog")
     525        return UI_STRING("dialog", "An ARIA accessibility group that acts as an dialog.");
     526    if (ariaType == "ARIAApplicationLog")
     527        return UI_STRING("log", "An ARIA accessibility group that acts as a console log.");
     528    if (ariaType == "ARIAApplicationMarquee")
     529        return UI_STRING("marquee", "An ARIA accessibility group that acts as a marquee.");   
     530    if (ariaType == "ARIAApplicationStatus")
     531        return UI_STRING("application status", "An ARIA accessibility group that acts as a status update.");   
     532    if (ariaType == "ARIAApplicationTimer")
     533        return UI_STRING("timer", "An ARIA accessibility group that acts as an updating timer.");   
     534    if (ariaType == "ARIADocument")
     535        return UI_STRING("document", "An ARIA accessibility group that acts as a document.");   
     536    if (ariaType == "ARIADocumentArticle")
     537        return UI_STRING("article", "An ARIA accessibility group that acts as an article.");   
     538    if (ariaType == "ARIADocumentNote")
     539        return UI_STRING("note", "An ARIA accessibility group that acts as a note in a document.");   
     540    if (ariaType == "ARIADocumentRegion")
     541        return UI_STRING("region", "An ARIA accessibility group that acts as a distinct region in a document.");   
     542    if (ariaType == "ARIALandmarkApplication")
     543        return UI_STRING("application", "An ARIA accessibility group that acts as an application.");   
     544    if (ariaType == "ARIALandmarkBanner")
     545        return UI_STRING("banner", "An ARIA accessibility group that acts as a banner.");   
     546    if (ariaType == "ARIALandmarkComplementary")
     547        return UI_STRING("complementary", "An ARIA accessibility group that acts as a region of complementary information.");   
     548    if (ariaType == "ARIALandmarkContentInfo")
     549        return UI_STRING("content", "An ARIA accessibility group that contains content.");   
     550    if (ariaType == "ARIALandmarkMain")
     551        return UI_STRING("main", "An ARIA accessibility group that is the main portion of the website.");   
     552    if (ariaType == "ARIALandmarkNavigation")
     553        return UI_STRING("navigation", "An ARIA accessibility group that contains the main navigation elements of a website.");   
     554    if (ariaType == "ARIALandmarkSearch")
     555        return UI_STRING("search", "An ARIA accessibility group that contains a search feature of a website.");   
     556    if (ariaType == "ARIAUserInterfaceTooltip")
     557        return UI_STRING("tooltip", "An ARIA accessibility group that acts as a tooltip.");   
     558    if (ariaType == "ARIATabPanel")
     559        return UI_STRING("tab panel", "An ARIA accessibility group that contains the content of a tab.");
     560    if (ariaType == "ARIADocumentMath")
     561        return UI_STRING("math", "An ARIA accessibility group that contains mathematical symbols.");
     562    return String();
     563}
     564
     565String WebPlatformStrategies::AXButtonActionVerb()
     566{
     567    return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility");
     568}
     569
     570String WebPlatformStrategies::AXRadioButtonActionVerb()
     571{
     572    return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility");
     573}
     574
     575String WebPlatformStrategies::AXTextFieldActionVerb()
     576{
     577    return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility");
     578}
     579
     580String WebPlatformStrategies::AXCheckedCheckBoxActionVerb()
     581{
     582    return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility");
     583}
     584
     585String WebPlatformStrategies::AXUncheckedCheckBoxActionVerb()
     586{
     587    return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility");
     588}
     589
     590String WebPlatformStrategies::AXMenuListActionVerb()
     591{
     592    notImplemented();
     593    return "select";
     594}
     595
     596String WebPlatformStrategies::AXMenuListPopupActionVerb()
     597{
     598    notImplemented();
     599    return "select";
     600}
     601
     602String WebPlatformStrategies::AXLinkActionVerb()
     603{
     604    return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility");
     605}
     606
     607String WebPlatformStrategies::missingPluginText()
     608{
     609    return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing");
     610}
     611
     612String WebPlatformStrategies::crashedPluginText()
     613{
     614    return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed");
     615}
     616
     617String WebPlatformStrategies::multipleFileUploadText(unsigned numberOfFiles)
     618{
     619    return String::format(UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles);
     620}
     621
     622String WebPlatformStrategies::unknownFileSizeText()
     623{
     624    return UI_STRING("Unknown", "Unknown filesize FTP directory listing item");
     625}
     626
     627#if PLATFORM(WIN)
     628
     629String WebPlatformStrategies::uploadFileText()
     630{
     631    notImplemented();
     632    return "upload";
     633}
     634
     635String WebPlatformStrategies::allFilesText()
     636{
     637    notImplemented();
     638    return "all files";
     639}
     640
     641#endif
     642
     643String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size)
     644{
     645    return String::format(UI_STRING("%s %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filename.utf8().data(), size.width(), size.height());
     646}
     647
     648String WebPlatformStrategies::mediaElementLoadingStateText()
     649{
     650    return UI_STRING("Loading...", "Media controller status message when the media is loading");
     651}
     652
     653String WebPlatformStrategies::mediaElementLiveBroadcastStateText()
     654{
     655    return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast");
     656}
     657
     658String WebPlatformStrategies::localizedMediaControlElementString(const String& name)
     659{
     660    if (name == "AudioElement")
     661        return UI_STRING("audio element controller", "accessibility role description for audio element controller");
     662    if (name == "VideoElement")
     663        return UI_STRING("video element controller", "accessibility role description for video element controller");
     664    if (name == "MuteButton")
     665        return UI_STRING("mute", "accessibility role description for mute button");
     666    if (name == "UnMuteButton")
     667        return UI_STRING("unmute", "accessibility role description for turn mute off button");
     668    if (name == "PlayButton")
     669        return UI_STRING("play", "accessibility role description for play button");
     670    if (name == "PauseButton")
     671        return UI_STRING("pause", "accessibility role description for pause button");
     672    if (name == "Slider")
     673        return UI_STRING("movie time", "accessibility role description for timeline slider");
     674    if (name == "SliderThumb")
     675        return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb");
     676    if (name == "RewindButton")
     677        return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button");
     678    if (name == "ReturnToRealtimeButton")
     679        return UI_STRING("return to realtime", "accessibility role description for return to real time button");
     680    if (name == "CurrentTimeDisplay")
     681        return UI_STRING("elapsed time", "accessibility role description for elapsed time display");
     682    if (name == "TimeRemainingDisplay")
     683        return UI_STRING("remaining time", "accessibility role description for time remaining display");
     684    if (name == "StatusDisplay")
     685        return UI_STRING("status", "accessibility role description for movie status");
     686    if (name == "FullscreenButton")
     687        return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button");
     688    if (name == "SeekForwardButton")
     689        return UI_STRING("fast forward", "accessibility role description for fast forward button");
     690    if (name == "SeekBackButton")
     691        return UI_STRING("fast reverse", "accessibility role description for fast reverse button");
     692    if (name == "ShowClosedCaptionsButton")
     693        return UI_STRING("show closed captions", "accessibility role description for show closed captions button");
     694    if (name == "HideClosedCaptionsButton")
     695        return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button");
     696
     697    // FIXME: the ControlsPanel container should never be visible in the accessibility hierarchy.
     698    if (name == "ControlsPanel")
     699        return String();
     700
     701    ASSERT_NOT_REACHED();
     702    return String();
     703}
     704
     705String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name)
     706{
     707    if (name == "AudioElement")
     708        return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller");
     709    if (name == "VideoElement")
     710        return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller");
     711    if (name == "MuteButton")
     712        return UI_STRING("mute audio tracks", "accessibility help text for mute button");
     713    if (name == "UnMuteButton")
     714        return UI_STRING("unmute audio tracks", "accessibility help text for un mute button");
     715    if (name == "PlayButton")
     716        return UI_STRING("begin playback", "accessibility help text for play button");
     717    if (name == "PauseButton")
     718        return UI_STRING("pause playback", "accessibility help text for pause button");
     719    if (name == "Slider")
     720        return UI_STRING("movie time scrubber", "accessibility help text for timeline slider");
     721    if (name == "SliderThumb")
     722        return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb");
     723    if (name == "RewindButton")
     724        return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button");
     725    if (name == "ReturnToRealtimeButton")
     726        return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button");
     727    if (name == "CurrentTimeDisplay")
     728        return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display");
     729    if (name == "TimeRemainingDisplay")
     730        return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display");
     731    if (name == "StatusDisplay")
     732        return UI_STRING("current movie status", "accessibility help text for movie status display");
     733    if (name == "SeekBackButton")
     734        return UI_STRING("seek quickly back", "accessibility help text for fast rewind button");
     735    if (name == "SeekForwardButton")
     736        return UI_STRING("seek quickly forward", "accessibility help text for fast forward button");
     737    if (name == "FullscreenButton")
     738        return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button");
     739    if (name == "ShowClosedCaptionsButton")
     740        return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button");
     741    if (name == "HideClosedCaptionsButton")
     742        return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button");
     743
     744    ASSERT_NOT_REACHED();
     745    return String();
     746}
     747
     748String WebPlatformStrategies::localizedMediaTimeDescription(float time)
     749{
     750    if (!isfinite(time))
     751        return UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value");
     752
     753    int seconds = static_cast<int>(fabsf(time));
     754    int days = seconds / (60 * 60 * 24);
     755    int hours = seconds / (60 * 60);
     756    int minutes = (seconds / 60) % 60;
     757    seconds %= 60;
     758
     759    if (days)
     760        return String::format(UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds);
     761    if (hours)
     762        return String::format(UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds);
     763    if (minutes)
     764        return String::format(UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds);
     765    return String::format(UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds);
     766}
     767
     768String WebPlatformStrategies::validationMessageValueMissingText()
     769{
     770    return UI_STRING("value missing", "Validation message for required form control elements that have no value");
     771}
     772
     773String WebPlatformStrategies::validationMessageTypeMismatchText()
     774{
     775    return UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type");
     776}
     777
     778String WebPlatformStrategies::validationMessagePatternMismatchText()
     779{
     780    return UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern");
     781}
     782
     783String WebPlatformStrategies::validationMessageTooLongText()
     784{
     785    return UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length");
     786}
     787
     788String WebPlatformStrategies::validationMessageRangeUnderflowText()
     789{
     790    return UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum");
     791}
     792
     793String WebPlatformStrategies::validationMessageRangeOverflowText()
     794{
     795    return UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum");
     796}
     797
     798String WebPlatformStrategies::validationMessageStepMismatchText()
     799{
     800    return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute");
     801}
     802
    90803} // namespace WebKit
    91804
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h

    r61702 r63904  
    3131#include <WebCore/PlatformStrategies.h>
    3232#include <WebCore/PluginStrategy.h>
     33#include <WebCore/LocalizationStrategy.h>
    3334
    3435namespace WebKit {
    3536
    36 class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy {
     37class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy {
    3738public:
    3839    static void initialize();
     
    4344    // WebCore::PlatformStrategies
    4445    virtual WebCore::PluginStrategy* createPluginStrategy();
     46    virtual WebCore::LocalizationStrategy* createLocalizationStrategy();
    4547
    4648    // WebCore::PluginStrategy
    4749    virtual void refreshPlugins();
    4850    virtual void getPluginInfo(Vector<WebCore::PluginInfo>&);
    49    
     51
     52    // WebCore::LocalizationStrategy   
     53    virtual WebCore::String inputElementAltText();
     54    virtual WebCore::String resetButtonDefaultLabel();
     55    virtual WebCore::String searchableIndexIntroduction();
     56    virtual WebCore::String submitButtonDefaultLabel();
     57    virtual WebCore::String fileButtonChooseFileLabel();
     58    virtual WebCore::String fileButtonNoFileSelectedLabel();
     59    virtual WebCore::String copyImageUnknownFileLabel();
     60#if ENABLE(CONTEXT_MENUS)
     61    virtual WebCore::String contextMenuItemTagOpenLinkInNewWindow();
     62    virtual WebCore::String contextMenuItemTagDownloadLinkToDisk();
     63    virtual WebCore::String contextMenuItemTagCopyLinkToClipboard();
     64    virtual WebCore::String contextMenuItemTagOpenImageInNewWindow();
     65    virtual WebCore::String contextMenuItemTagDownloadImageToDisk();
     66    virtual WebCore::String contextMenuItemTagCopyImageToClipboard();
     67    virtual WebCore::String contextMenuItemTagOpenFrameInNewWindow();
     68    virtual WebCore::String contextMenuItemTagCopy();
     69    virtual WebCore::String contextMenuItemTagGoBack();
     70    virtual WebCore::String contextMenuItemTagGoForward();
     71    virtual WebCore::String contextMenuItemTagStop();
     72    virtual WebCore::String contextMenuItemTagReload();
     73    virtual WebCore::String contextMenuItemTagCut();
     74    virtual WebCore::String contextMenuItemTagPaste();
     75#if PLATFORM(GTK)
     76    virtual WebCore::String contextMenuItemTagDelete();
     77    virtual WebCore::String contextMenuItemTagSelectAll();
     78    virtual WebCore::String contextMenuItemTagInputMethods();
     79    virtual WebCore::String contextMenuItemTagUnicode();
     80#endif
     81    virtual WebCore::String contextMenuItemTagNoGuessesFound();
     82    virtual WebCore::String contextMenuItemTagIgnoreSpelling();
     83    virtual WebCore::String contextMenuItemTagLearnSpelling();
     84    virtual WebCore::String contextMenuItemTagSearchWeb();
     85    virtual WebCore::String contextMenuItemTagLookUpInDictionary();
     86    virtual WebCore::String contextMenuItemTagOpenLink();
     87    virtual WebCore::String contextMenuItemTagIgnoreGrammar();
     88    virtual WebCore::String contextMenuItemTagSpellingMenu();
     89    virtual WebCore::String contextMenuItemTagShowSpellingPanel(bool show);
     90    virtual WebCore::String contextMenuItemTagCheckSpelling();
     91    virtual WebCore::String contextMenuItemTagCheckSpellingWhileTyping();
     92    virtual WebCore::String contextMenuItemTagCheckGrammarWithSpelling();
     93    virtual WebCore::String contextMenuItemTagFontMenu();
     94    virtual WebCore::String contextMenuItemTagBold();
     95    virtual WebCore::String contextMenuItemTagItalic();
     96    virtual WebCore::String contextMenuItemTagUnderline();
     97    virtual WebCore::String contextMenuItemTagOutline();
     98    virtual WebCore::String contextMenuItemTagWritingDirectionMenu();
     99    virtual WebCore::String contextMenuItemTagTextDirectionMenu();
     100    virtual WebCore::String contextMenuItemTagDefaultDirection();
     101    virtual WebCore::String contextMenuItemTagLeftToRight();
     102    virtual WebCore::String contextMenuItemTagRightToLeft();
     103#if PLATFORM(MAC)
     104    virtual WebCore::String contextMenuItemTagSearchInSpotlight();
     105    virtual WebCore::String contextMenuItemTagShowFonts();
     106    virtual WebCore::String contextMenuItemTagStyles();
     107    virtual WebCore::String contextMenuItemTagShowColors();
     108    virtual WebCore::String contextMenuItemTagSpeechMenu();
     109    virtual WebCore::String contextMenuItemTagStartSpeaking();
     110    virtual WebCore::String contextMenuItemTagStopSpeaking();
     111    virtual WebCore::String contextMenuItemTagCorrectSpellingAutomatically();
     112    virtual WebCore::String contextMenuItemTagSubstitutionsMenu();
     113    virtual WebCore::String contextMenuItemTagShowSubstitutions(bool show);
     114    virtual WebCore::String contextMenuItemTagSmartCopyPaste();
     115    virtual WebCore::String contextMenuItemTagSmartQuotes();
     116    virtual WebCore::String contextMenuItemTagSmartDashes();
     117    virtual WebCore::String contextMenuItemTagSmartLinks();
     118    virtual WebCore::String contextMenuItemTagTextReplacement();
     119    virtual WebCore::String contextMenuItemTagTransformationsMenu();
     120    virtual WebCore::String contextMenuItemTagMakeUpperCase();
     121    virtual WebCore::String contextMenuItemTagMakeLowerCase();
     122    virtual WebCore::String contextMenuItemTagCapitalize();
     123    virtual WebCore::String contextMenuItemTagChangeBack(const WebCore::String& replacedString);
     124#endif
     125    virtual WebCore::String contextMenuItemTagInspectElement();
     126#endif // ENABLE(CONTEXT_MENUS)
     127    virtual WebCore::String searchMenuNoRecentSearchesText();
     128    virtual WebCore::String searchMenuRecentSearchesText();
     129    virtual WebCore::String searchMenuClearRecentSearchesText();
     130    virtual WebCore::String AXWebAreaText();
     131    virtual WebCore::String AXLinkText();
     132    virtual WebCore::String AXListMarkerText();
     133    virtual WebCore::String AXImageMapText();
     134    virtual WebCore::String AXHeadingText();
     135    virtual WebCore::String AXDefinitionListTermText();
     136    virtual WebCore::String AXDefinitionListDefinitionText();
     137    virtual WebCore::String AXARIAContentGroupText(const WebCore::String& ariaType);
     138    virtual WebCore::String AXButtonActionVerb();
     139    virtual WebCore::String AXRadioButtonActionVerb();
     140    virtual WebCore::String AXTextFieldActionVerb();
     141    virtual WebCore::String AXCheckedCheckBoxActionVerb();
     142    virtual WebCore::String AXUncheckedCheckBoxActionVerb();
     143    virtual WebCore::String AXMenuListActionVerb();
     144    virtual WebCore::String AXMenuListPopupActionVerb();
     145    virtual WebCore::String AXLinkActionVerb();
     146    virtual WebCore::String missingPluginText();
     147    virtual WebCore::String crashedPluginText();
     148    virtual WebCore::String multipleFileUploadText(unsigned numberOfFiles);
     149    virtual WebCore::String unknownFileSizeText();
     150#if PLATFORM(WIN)
     151    virtual WebCore::String uploadFileText();
     152    virtual WebCore::String allFilesText();
     153#endif
     154    virtual WebCore::String imageTitle(const WebCore::String& filename, const WebCore::IntSize& size);
     155    virtual WebCore::String mediaElementLoadingStateText();
     156    virtual WebCore::String mediaElementLiveBroadcastStateText();
     157    virtual WebCore::String localizedMediaControlElementString(const WebCore::String&);
     158    virtual WebCore::String localizedMediaControlElementHelpText(const WebCore::String&);
     159    virtual WebCore::String localizedMediaTimeDescription(float);
     160    virtual WebCore::String validationMessageValueMissingText();
     161    virtual WebCore::String validationMessageTypeMismatchText();
     162    virtual WebCore::String validationMessagePatternMismatchText();
     163    virtual WebCore::String validationMessageTooLongText();
     164    virtual WebCore::String validationMessageRangeUnderflowText();
     165    virtual WebCore::String validationMessageRangeOverflowText();
     166    virtual WebCore::String validationMessageStepMismatchText();
     167
    50168    void populatePluginCache();
    51169
Note: See TracChangeset for help on using the changeset viewer.