Bug 170397 - run-safari should support launching with custom language and locale
Summary: run-safari should support launching with custom language and locale
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brian Burg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-02 15:41 PDT by Brian Burg
Modified: 2017-04-03 13:44 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.30 KB, patch)
2017-04-03 12:23 PDT, Brian Burg
no flags Details | Formatted Diff | Diff
For Landing (2.34 KB, patch)
2017-04-03 13:05 PDT, Brian Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2017-04-02 15:41:13 PDT
This would be nice.
Comment 1 Alexey Proskuryakov 2017-04-02 17:32:19 PDT
With system Safari and WebKit, this can be achieved to some degree of fidelity with command line options:

/Applications/Safari.app/Contents/MacOS/Safari -AppleLanguages '(fr)' -AppleLocale 'fr_FR'

However, locally built WebKit does not have resources other than English, so overriding language would be no-op for most part. Overriding locale may be more useful, but I'm not sure if we inherit AppleLocale override to WebContent process.
Comment 2 Brian Burg 2017-04-03 12:23:25 PDT
Created attachment 306094 [details]
Patch
Comment 3 Alexey Proskuryakov 2017-04-03 12:39:54 PDT
Comment on attachment 306094 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=306094&action=review

OK. I'm still unsure if this won't cause more confusion than good though.

> Tools/Scripts/webkitdirs.pm:-2179
> -  -g|--guard-malloc                 Enable Guard Malloc (OS X only)

Surely this still doesn't work on Linux or Windows.

> Tools/Scripts/webkitdirs.pm:2180
> +  --lang=LANGUAGE                   Use a specific language instead of system language.

Why abbreviate?

> Tools/Scripts/webkitdirs.pm:2182
> +  --locale=LOCALE                   Useg a specific locale instead of the system region.

Typo: Useg.

Also, these won't work on Linux either.
Comment 4 Brian Burg 2017-04-03 13:02:42 PDT
(In reply to Alexey Proskuryakov from comment #3)
> Comment on attachment 306094 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=306094&action=review
> 
> OK. I'm still unsure if this won't cause more confusion than good though.
> 
> > Tools/Scripts/webkitdirs.pm:-2179
> > -  -g|--guard-malloc                 Enable Guard Malloc (OS X only)
> 
> Surely this still doesn't work on Linux or Windows.
> 
> > Tools/Scripts/webkitdirs.pm:2180
> > +  --lang=LANGUAGE                   Use a specific language instead of system language.
> 
> Why abbreviate?

It matches the LANG environment variable. And since it's unambiguous, when type more than necessary?

> > Tools/Scripts/webkitdirs.pm:2182
> > +  --locale=LOCALE                   Useg a specific locale instead of the system region.
> 
> Typo: Useg.

Ooops.

> 
> Also, these won't work on Linux either.

I'll add a header back to state that these are specific to macOS.
Comment 5 Brian Burg 2017-04-03 13:05:15 PDT
Created attachment 306097 [details]
For Landing
Comment 6 WebKit Commit Bot 2017-04-03 13:44:57 PDT
Comment on attachment 306097 [details]
For Landing

Clearing flags on attachment: 306097

Committed r214835: <http://trac.webkit.org/changeset/214835>
Comment 7 WebKit Commit Bot 2017-04-03 13:44:59 PDT
All reviewed patches have been landed.  Closing bug.