Changeset 80014 in webkit


Ignore:
Timestamp:
Mar 1, 2011 11:41:03 AM (13 years ago)
Author:
weinig@apple.com
Message:

WebKit2 needs to be made localizable
https://bugs.webkit.org/show_bug.cgi?id=55483

Reviewed by Timothy Hatcher.

Source/WebCore:

  • English.lproj/Localizable.strings: Copied from Source/WebKit/English.lproj/Localizable.strings.
  • WebCore.xcodeproj/project.pbxproj:

Move Localizable.strings to WebCore.

  • WebCore.exp.in:

Add export for localizedString function.

  • platform/LocalizedStrings.h:
  • platform/mac/LocalizedStringsMac.mm: Added.

Add function to get localized version of a string from the WebCore bundle.

Source/WebKit:

  • StringsNotToBeLocalized.txt: Removed.
  • WebKit.xcodeproj/project.pbxproj:

Copied Localizable.strings to WebCore, it can't be removed entirely
yet since Windows is still using it.

Source/WebKit/mac:

  • WebCoreSupport/WebPlatformStrategies.mm:

Use WebCore's localizedString function instead of WebLocalizableStrings
since WebCore is now responsible for localization.

Source/WebKit2:

  • PluginProcess/mac/PluginProcessMainMac.mm:
  • WebProcess/mac/WebProcessMainMac.mm:

Set the default localization from the passed in parameter.

  • UIProcess/Launcher/mac/ProcessLauncherMac.mm:

Add the preferred localization as a parameter when launching processes
so that they can set their localization to match the launching app.

  • WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:

Use WebCore's localizedString function on the mac, to actually localize
these strings.

(WebKit::WebPlatformStrategies::imageTitle):
Switch to using replace, instead of concatenation, to give localizers a chance
to rearrange the wording.

Location:
trunk/Source
Files:
1 added
13 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r80012 r80014  
    1 2011-02-23  Joseph Pecoraro  <joepeck@webkit.org>
     12011-03-01  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        WebKit2 needs to be made localizable
     6        https://bugs.webkit.org/show_bug.cgi?id=55483
     7
     8        * English.lproj/Localizable.strings: Copied from Source/WebKit/English.lproj/Localizable.strings.
     9        * WebCore.xcodeproj/project.pbxproj:
     10        Move Localizable.strings to WebCore.
     11
     12        * WebCore.exp.in:
     13        Add export for localizedString function.
     14
     15        * platform/LocalizedStrings.h:
     16        * platform/mac/LocalizedStringsMac.mm: Added.
     17        Add function to get localized version of a string from the WebCore bundle.
     18
     192011-03-01  Joseph Pecoraro  <joepeck@webkit.org>
    220
    321        Reviewed by Kenneth Rohde Christiansen.
  • trunk/Source/WebCore/English.lproj/Localizable.strings

    r79896 r80014  
    1717"%@ %d×%d pixels" = "%@ %d×%d pixels";
    1818
     19/* window title for a standalone image (uses multiplication symbol, not x) */
     20"<filename> %d×%d pixels" = "<filename> %d×%d pixels";
     21
    1922/* visible name of the plug-in host process. The first argument is the plug-in name and the second argument is the application name. */
    2023"%@ (%@ Internet plug-in)" = "%@ (%@ Internet plug-in)";
  • trunk/Source/WebCore/WebCore.exp.in

    r79953 r80014  
    413413__ZN7WebCore15VisiblePositionC1ERKNS_8PositionENS_9EAffinityE
    414414__ZN7WebCore15defaultLanguageEv
     415__ZN7WebCore15localizedStringEPKc
    415416__ZN7WebCore15reportExceptionEPN3JSC9ExecStateENS0_7JSValueE
    416417__ZN7WebCore15visitedLinkHashEPKtj
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r79985 r80014  
    48184818                BC23F0DB0DAFF4A4009FDC91 /* GeneratedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BC23F0DA0DAFF4A4009FDC91 /* GeneratedImage.h */; };
    48194819                BC2441C40E8B65D00055320F /* ScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2441C30E8B65D00055320F /* ScrollView.cpp */; };
     4820                BC25B52A131C6D3900180E10 /* LocalizedStringsMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC25B528131C6D3900180E10 /* LocalizedStringsMac.mm */; };
    48204821                BC275B7911C5D1C300C9206C /* JSWebKitPointCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275B7811C5D1C300C9206C /* JSWebKitPointCustom.cpp */; };
    48214822                BC275B7D11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275B7C11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp */; };
     
    50865087                BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */; };
    50875088                BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
     5089                BCAD180A131C7A0D00990406 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = BCAD1808131C7A0D00990406 /* Localizable.strings */; };
    50885090                BCAE1FA712939DB7004CB026 /* ScrollAnimatorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAE1FA512939DB7004CB026 /* ScrollAnimatorMac.h */; };
    50895091                BCAEFCAE1016CE4A0040D34E /* DOMRGBColor.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCAEFCAD1016CE4A0040D34E /* DOMRGBColor.mm */; };
     
    1115911161                BC23F0DA0DAFF4A4009FDC91 /* GeneratedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedImage.h; sourceTree = "<group>"; };
    1116011162                BC2441C30E8B65D00055320F /* ScrollView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollView.cpp; sourceTree = "<group>"; };
     11163                BC25B528131C6D3900180E10 /* LocalizedStringsMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalizedStringsMac.mm; sourceTree = "<group>"; };
    1116111164                BC275B7811C5D1C300C9206C /* JSWebKitPointCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitPointCustom.cpp; sourceTree = "<group>"; };
    1116211165                BC275B7C11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSMatrixCustom.cpp; sourceTree = "<group>"; };
     
    1144711450                BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserContentURLPattern.cpp; sourceTree = "<group>"; };
    1144811451                BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserContentURLPattern.h; sourceTree = "<group>"; };
     11452                BCAD1809131C7A0D00990406 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; };
    1144911453                BCAE1FA512939DB7004CB026 /* ScrollAnimatorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimatorMac.h; sourceTree = "<group>"; };
    1145011454                BCAEFCAD1016CE4A0040D34E /* DOMRGBColor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMRGBColor.mm; sourceTree = "<group>"; };
     
    1257612580                        isa = PBXGroup;
    1257712581                        children = (
     12582                                BCAD1808131C7A0D00990406 /* Localizable.strings */,
    1257812583                                46F9D5DA0B0D60170028EE36 /* aliasCursor.png */,
    1257912584                                46D4F2460AF97E810035385A /* cellCursor.png */,
     
    1390713912                                06E81ED60AB5D5E900C87837 /* LocalCurrentGraphicsContext.h */,
    1390813913                                06E81EEB0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm */,
     13914                                BC25B528131C6D3900180E10 /* LocalizedStringsMac.mm */,
    1390913915                                1402645D0AFDC19B005919E2 /* LoggingMac.mm */,
    1391013916                                BC772C5D0C4EB3440083285F /* MIMETypeRegistryMac.mm */,
     
    2257622582                        files = (
    2257722583                                46F9D5DD0B0D60170028EE36 /* aliasCursor.png in Resources */,
     22584                                BCAD180A131C7A0D00990406 /* Localizable.strings in Resources */,
    2257822585                                46D4F2490AF97E810035385A /* cellCursor.png in Resources */,
    2257922586                                46D4F24A0AF97E810035385A /* contextMenuCursor.png in Resources */,
     
    2513125138                                E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
    2513225139                                977E2E0E12F0FC9C00C13379 /* XSSFilter.cpp in Sources */,
     25140                                BC25B52A131C6D3900180E10 /* LocalizedStringsMac.mm in Sources */,
    2513325141                        );
    2513425142                        runOnlyForDeploymentPostprocessing = 0;
     
    2515525163
    2515625164/* Begin PBXVariantGroup section */
     25165                BCAD1808131C7A0D00990406 /* Localizable.strings */ = {
     25166                        isa = PBXVariantGroup;
     25167                        children = (
     25168                                BCAD1809131C7A0D00990406 /* English */,
     25169                        );
     25170                        name = Localizable.strings;
     25171                        sourceTree = "<group>";
     25172                };
    2515725173                BCC64F5F0DCFB84E0081EF3B /* localizedStrings.js */ = {
    2515825174                        isa = PBXVariantGroup;
  • trunk/Source/WebCore/platform/LocalizedStrings.h

    r78842 r80014  
    11/*
    2  * Copyright (C) 2003, 2006, 2009 Apple Computer, Inc.  All rights reserved.
     2 * Copyright (C) 2003, 2006, 2009, 2011 Apple Inc.  All rights reserved.
    33 * Copyright (C) 2010 Igalia S.L
    44 *
     
    188188    String validationMessageStepMismatchText(const String& base, const String& step);
    189189
    190 }
     190#if PLATFORM(MAC)
     191    String localizedString(const char* key);
     192#endif
    191193
    192 #endif
     194} // namespace WebCore
     195
     196#endif // LocalizedStrings_h
  • trunk/Source/WebKit/ChangeLog

    r79589 r80014  
     12011-03-01  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        WebKit2 needs to be made localizable
     6        https://bugs.webkit.org/show_bug.cgi?id=55483
     7
     8        * StringsNotToBeLocalized.txt: Removed.
     9        * WebKit.xcodeproj/project.pbxproj:
     10        Copied Localizable.strings to WebCore, it can't be removed entirely
     11        yet since Windows is still using it.
     12
    1132011-02-24  Peter Kasting  <pkasting@google.com>
    214
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r76478 r80014  
    121121                5D7BF8150C2A1D90008CE06D /* WebInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D7BF8130C2A1D90008CE06D /* WebInspector.mm */; };
    122122                5DE83A7A0D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib in Resources */ = {isa = PBXBuildFile; fileRef = 5DE83A740D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib */; };
    123                 5DE83A7F0D0F7FAD00CAD12A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5DE83A7D0D0F7FAD00CAD12A /* Localizable.strings */; };
    124123                5DE92FEF0BD7017E0059A5FD /* WebAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DE92FEE0BD7017E0059A5FD /* WebAssertions.h */; settings = {ATTRIBUTES = (Private, ); }; };
    125124                65488DA1084FBCCB00831AD0 /* WebNSDictionaryExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 65488D9F084FBCCB00831AD0 /* WebNSDictionaryExtras.h */; };
     
    543542                5D7BF8130C2A1D90008CE06D /* WebInspector.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspector.mm; sourceTree = "<group>"; };
    544543                5DE83A750D0F7F9400CAD12A /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/WebJavaScriptTextInputPanel.nib; sourceTree = SOURCE_ROOT; };
    545                 5DE83A7E0D0F7FAD00CAD12A /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; };
    546544                5DE92FEE0BD7017E0059A5FD /* WebAssertions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebAssertions.h; sourceTree = "<group>"; };
    547545                65488D9F084FBCCB00831AD0 /* WebNSDictionaryExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSDictionaryExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
     
    695693                ED2B2474033A2DA800C1A526 /* WebNSPasteboardExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSPasteboardExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
    696694                ED2B2475033A2DA800C1A526 /* WebNSPasteboardExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSPasteboardExtras.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
    697                 ED3B48DE0CC51F7E00DFF1EB /* StringsNotToBeLocalized.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = StringsNotToBeLocalized.txt; sourceTree = SOURCE_ROOT; };
    698695                ED5B9523111B725A00472298 /* WebLocalizableStrings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebLocalizableStrings.mm; sourceTree = "<group>"; };
    699696                ED6BE2E5088C32B50044DEDC /* WebNSAttributedStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSAttributedStringExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
     
    841838                                9325FBDC07D829AE00159862 /* IDNScriptWhiteList.txt */,
    842839                                939811320824BF01008DF038 /* Info.plist */,
    843                                 5DE83A7D0D0F7FAD00CAD12A /* Localizable.strings */,
    844                                 ED3B48DE0CC51F7E00DFF1EB /* StringsNotToBeLocalized.txt */,
    845840                                F5B67130023EDF8901C1A525 /* url_icon.tiff */,
    846841                                5DE83A740D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib */,
     
    16951690                                A864B3F6123ED9FA00C2A612 /* MailQuirksUserScript.js in Resources */,
    16961691                                939810BA0824BF01008DF038 /* IDNScriptWhiteList.txt in Resources */,
    1697                                 5DE83A7F0D0F7FAD00CAD12A /* Localizable.strings in Resources */,
    16981692                                939810B70824BF01008DF038 /* url_icon.tiff in Resources */,
    16991693                                939810B50824BF01008DF038 /* WebAuthenticationPanel.nib in Resources */,
     
    20092003                        sourceTree = SOURCE_ROOT;
    20102004                };
    2011                 5DE83A7D0D0F7FAD00CAD12A /* Localizable.strings */ = {
    2012                         isa = PBXVariantGroup;
    2013                         children = (
    2014                                 5DE83A7E0D0F7FAD00CAD12A /* English */,
    2015                         );
    2016                         name = Localizable.strings;
    2017                         path = mac/Resources;
    2018                         sourceTree = SOURCE_ROOT;
    2019                 };
    20202005                9345D17B0365BF35008635CE /* WebAuthenticationPanel.nib */ = {
    20212006                        isa = PBXVariantGroup;
  • trunk/Source/WebKit/mac/ChangeLog

    r79988 r80014  
     12011-03-01  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        WebKit2 needs to be made localizable
     6        https://bugs.webkit.org/show_bug.cgi?id=55483
     7
     8        * WebCoreSupport/WebPlatformStrategies.mm:
     9        Use WebCore's localizedString function instead of WebLocalizableStrings
     10        since WebCore is now responsible for localization.
     11
    1122011-02-25 Steve Block <steveblock@google.com>
    213
  • trunk/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm

    r78842 r80014  
    2626#import "WebPlatformStrategies.h"
    2727
    28 #import "WebLocalizableStrings.h"
    2928#import "WebPluginDatabase.h"
    3029#import "WebPluginPackage.h"
    3130#import <WebCore/BlockExceptions.h>
    3231#import <WebCore/IntSize.h>
     32#import <WebCore/LocalizedStrings.h>
    3333#import <WebCore/Page.h>
    3434#import <WebCore/PageGroup.h>
    3535#import <wtf/StdLibExtras.h>
    3636
    37 #ifdef BUILDING_ON_TIGER
    38 typedef unsigned NSUInteger;
    39 #endif
     37#define UI_STRING(string, description) localizedString(string)
     38#define UI_STRING_KEY(string, key, description) localizedString(key)
    4039
    4140using namespace WebCore;
  • trunk/Source/WebKit2/ChangeLog

    r80007 r80014  
     12011-03-01  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        WebKit2 needs to be made localizable
     6        https://bugs.webkit.org/show_bug.cgi?id=55483
     7
     8        * PluginProcess/mac/PluginProcessMainMac.mm:
     9        * WebProcess/mac/WebProcessMainMac.mm:
     10        Set the default localization from the passed in parameter.
     11
     12        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
     13        Add the preferred localization as a parameter when launching processes
     14        so that they can set their localization to match the launching app.
     15
     16        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
     17        Use WebCore's localizedString function on the mac, to actually localize
     18        these strings.
     19
     20        (WebKit::WebPlatformStrategies::imageTitle):
     21        Switch to using replace, instead of concatenation, to give localizers a chance
     22        to rearrange the wording.
     23
    1242011-03-01  Balazs Kelemen  <kbalazs@webkit.org>
    225
  • trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm

    r77981 r80014  
    11/*
    2  * Copyright (C) 2010 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3232#import "PluginProcess.h"
    3333#import "RunLoop.h"
     34#import <WebKitSystemInterface.h>
    3435#import <runtime/InitializeThreading.h>
    3536#import <servers/bootstrap.h>
     37#import <wtf/RetainPtr.h>
    3638#import <wtf/text/CString.h>
    3739#import <wtf/text/WTFString.h>
    38 #import <WebKitSystemInterface.h>
    3940
    4041// FIXME: We should be doing this another way.
     
    6566        return EXIT_FAILURE;
    6667    }
    67    
     68
     69    String localization = commandLine["localization"];
     70    RetainPtr<CFStringRef> cfLocalization(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(localization.characters()), localization.length()));
     71    if (cfLocalization)
     72        WKSetDefaultLocalization(cfLocalization.get());
     73
    6874#if !SHOW_CRASH_REPORTER
    6975    // Installs signal handlers that exit on a crash so that CrashReporter does not show up.
  • trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm

    r79752 r80014  
    204204    NSString *webProcessAppExecutablePath = [[NSBundle bundleWithPath:webProcessAppPath] executablePath];
    205205
     206    RetainPtr<CFStringRef> cfLocalization(AdoptCF, WKCopyCFLocalizationPreferredName(NULL));
     207    CString localization = String(cfLocalization.get()).utf8();
     208   
    206209    // Make a unique, per pid, per process launcher web process service name.
    207210    CString serviceName = String::format("com.apple.WebKit.WebProcess-%d-%p", getpid(), this).utf8();
    208211
    209     const char* args[] = { [webProcessAppExecutablePath fileSystemRepresentation], frameworkExecutablePath, "-type", processTypeAsString(m_launchOptions.processType), "-servicename", serviceName.data(), 0 };
     212    const char* args[] = { [webProcessAppExecutablePath fileSystemRepresentation], frameworkExecutablePath, "-type", processTypeAsString(m_launchOptions.processType), "-servicename", serviceName.data(), "-localization", localization.data(), 0 };
    210213
    211214    // Register ourselves.
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

    r79434 r80014  
    11/*
    2  * Copyright (C) 2010 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333#include "WebCoreArgumentCoders.h"
    3434#include "WebProcess.h"
     35#include <WebCore/LocalizedStrings.h>
    3536#include <WebCore/NotImplemented.h>
    3637#include <WebCore/Page.h>
     
    4344#endif
    4445
    45 // FIXME (WebKit2) <rdar://problem/8728860> WebKit2 needs to be localized
     46#if PLATFORM(MAC)
     47
     48#define UI_STRING(string, description) localizedString(string)
     49#define UI_STRING_KEY(string, key, description) localizedString(key)
     50
     51#else
     52
    4653#define UI_STRING(string, description) String::fromUTF8(string, strlen(string))
    4754#define UI_STRING_KEY(string, key, description) String::fromUTF8(string, strlen(string))
     55
     56#endif
    4857
    4958using namespace WebCore;
     
    754763String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size)
    755764{
    756     // FIXME: It would be nice to have the filename inside the format string, but it's not easy to do that in a way that works with non-ASCII characters in the filename.
    757     return filename + formatLocalizedString(UI_STRING(" %d×%d pixels", "window title suffix for a standalone image (uses multiplication symbol, not x)"), size.width(), size.height());
     765    // FIXME: This should format the numbers correctly. In Mac WebKit, we used +[NSNumberFormatter localizedStringFromNumber:numberStyle:].
     766    return formatLocalizedString(UI_STRING("<filename> %d×%d pixels", "window title suffix for a standalone image (uses multiplication symbol, not x)"), size.width(), size.height()).replace("<filename>", filename);
    758767}
    759768
  • trunk/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm

    r77452 r80014  
    11/*
    2  * Copyright (C) 2010 Apple Inc. All rights reserved.
     2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    7373    }
    7474
     75    String localization = commandLine["localization"];
     76    RetainPtr<CFStringRef> cfLocalization(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(localization.characters()), localization.length()));
     77    if (cfLocalization)
     78        WKSetDefaultLocalization(cfLocalization.get());
     79
    7580#if !SHOW_CRASH_REPORTER
    7681    // Installs signal handlers that exit on a crash so that CrashReporter does not show up.
Note: See TracChangeset for help on using the changeset viewer.