Title: [214835] trunk/Tools
Revision
214835
Author
bb...@apple.com
Date
2017-04-03 13:44:54 -0700 (Mon, 03 Apr 2017)

Log Message

run-safari should support launching with custom language and locale
https://bugs.webkit.org/show_bug.cgi?id=170397

Reviewed by Alexey Proskuryakov.

Hook up -AppleLanguages and -AppleLocale to command line options.

* Scripts/webkitdirs.pm:
(printHelpAndExitForRunAndDebugWebKitAppIfNeeded):
(argumentsForRunAndDebugMacWebKitApp):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (214834 => 214835)


--- trunk/Tools/ChangeLog	2017-04-03 20:18:44 UTC (rev 214834)
+++ trunk/Tools/ChangeLog	2017-04-03 20:44:54 UTC (rev 214835)
@@ -1,3 +1,16 @@
+2017-04-03  Brian Burg  <bb...@apple.com>
+
+        run-safari should support launching with custom language and locale
+        https://bugs.webkit.org/show_bug.cgi?id=170397
+
+        Reviewed by Alexey Proskuryakov.
+
+        Hook up -AppleLanguages and -AppleLocale to command line options.
+
+        * Scripts/webkitdirs.pm:
+        (printHelpAndExitForRunAndDebugWebKitAppIfNeeded):
+        (argumentsForRunAndDebugMacWebKitApp):
+
 2017-04-03  Jonathan Bedard  <jbed...@apple.com>
 
         webkitpy: Provide option to skip install

Modified: trunk/Tools/Scripts/webkitdirs.pm (214834 => 214835)


--- trunk/Tools/Scripts/webkitdirs.pm	2017-04-03 20:18:44 UTC (rev 214834)
+++ trunk/Tools/Scripts/webkitdirs.pm	2017-04-03 20:44:54 UTC (rev 214835)
@@ -2176,7 +2176,12 @@
 Usage: @{[basename($0)]} [options] [args ...]
   --help                            Show this help message
   --no-saved-state                  Launch the application without state restoration
-  -g|--guard-malloc                 Enable Guard Malloc (OS X only)
+
+Options specific to macOS:
+  -g|--guard-malloc                 Enable Guard Malloc
+  --lang=LANGUAGE                   Use a specific language instead of system language.
+                                    This accepts a language name (German) or a language code (de, ar, pt_BR, etc).
+  --locale=LOCALE                   Use a specific locale instead of the system region.
 EOF
 
     exit(1);
@@ -2190,6 +2195,17 @@
         # FIXME: Don't set ApplePersistenceIgnoreState once all supported OS versions respect ApplePersistenceIgnoreStateQuietly (rdar://15032886).
         push @args, ("-ApplePersistenceIgnoreState", "YES");
     }
+
+    my $lang;
+    if (checkForArgumentAndRemoveFromARGVGettingValue("--lang", \$lang)) {
+        push @args, ("-AppleLanguages", "(" . $lang . ")");
+    }
+
+    my $locale;
+    if (checkForArgumentAndRemoveFromARGVGettingValue("--locale", \$locale)) {
+        push @args, ("-AppleLocale", $locale);
+    }
+
     unshift @args, @ARGV;
 
     return @args;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to