Bug 170397

Summary: run-safari should support launching with custom language and locale
Product: WebKit Reporter: BJ Burg <bburg>
Component: Tools / TestsAssignee: BJ Burg <bburg>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bburg, buildbot, commit-queue, dbates, joepeck, lforschler, rmondello
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
For Landing none

Description BJ 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 BJ 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 BJ 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 BJ 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.