10000 feat: add app.getSystemLocale() method by rzhao271 · Pull Request #35697 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add app.getSystemLocale() method #35697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Sep 23, 2022

Conversation

rzhao271
Copy link
Contributor

Description of Change

This PR adds a method to fetch the OS locale from Chromium. That way, even when the application is in a certain locale, the program can still know the system locale and make recommendations based off of that.

Downstream: microsoft/vscode#159813 and PR microsoft/vscode#159958.

CC @deepak1556

Checklist

Release Notes

Notes: Added app.getSystemLocale() method.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Sep 15, 2022
@rzhao271 rzhao271 force-pushed the rzhao271/set-system-locale branch from e48afc1 to f28d1c2 Compare September 15, 2022 21:57
Copy link
Member
@ckerr ckerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it.

API LGTM

ckerr
ckerr previously approved these changes Sep 15, 2022
@ckerr ckerr added enhancement ✨ api-review/requested 🗳 target/21-x-y PR should also be added to the "21-x-y" branch. labels Sep 15, 2022
@ckerr ckerr force-pushed the rzhao271/set-system-locale branch from f8677e4 to 7de0965 Compare September 15, 2022 23:33
@erickzhao erickzhao added the semver/minor backwards-compatible functionality label Sep 15, 2022
@ckerr ckerr dismissed their stale review September 16, 2022 23:11

code updated; I will re-review

@ckerr ckerr self-requested a review September 16, 2022 23:11
@rzhao271 rzhao271 force-pushed the rzhao271/set-system-locale branch from 6811bba to 5441c9e Compare September 16, 2022 23:37
10000
@rzhao271 rzhao271 requested review from deepak1556 and removed request for ckerr September 19, 2022 15:02
Copy link
Member
@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending API review and some minor style changes.

@deepak1556 deepak1556 requested a review from ckerr September 19, 2022 15:20
@rzhao271 rzhao271 requested review from deepak1556 and removed request for ckerr September 19, 2022 17:47
@itsananderson itsananderson self-assigned this Sep 19, 2022
Copy link
Member
@ckerr ckerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM.

Copy link
Member
@ckerr ckerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

impl looks fine.

Deferring to @deepak1556's better wisdom on the macOS string underscores vs dashes, since I didn't know about that issue. Looks like the new test code ensures the values are hyphenated 👍

@rzhao271 rzhao271 force-pushed the rzhao271/set-system-locale branch from 1d49ce6 to 3f13ff3 Compare September 20, 2022 17:52
@itsananderson
Copy link
Member

API LGTM

@rzhao271 rzhao271 requested a review from deepak1556 September 22, 2022 06:21
Copy link
Member
@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM

@MarshallOfSound MarshallOfSound merged commit 8a0b4fa into electron:main Sep 23, 2022
@release-clerk
Copy link
release-clerk bot commented Sep 23, 2022

Release Notes Persisted

Added app.getSystemLocale() method.

@trop
Copy link
Contributor
trop bot commented Sep 23, 2022

I have automatically backported this PR to "21-x-y", please check out #35794

@trop trop bot added in-flight/21-x-y and removed target/21-x-y PR should also be added to the "21-x-y" branch. labels Sep 23, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Sep 23, 2022
@trop trop bot added merged/21-x-y PR was merged to the "21-x-y" branch. and removed in-flight/21-x-y labels Sep 26, 2022
@rzhao271 rzhao271 deleted the rzhao271/set-system-locale branch September 26, 2022 18:43
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
* feat: add app.getSystemLocale() method

* Update shell/browser/electron_browser_main_parts.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* Change methods to be const

* Apply PR feedback

* Fix mac compile

* Add missing scope

* Apply style changes

* Change note

* Add braces to get the comment indentation right

* Change to static

* Apply PR feedback

* Fix the documentation

* Remove extraneous file

Co-authored-by: Charles Kerr <charles@charleskerr.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review/requested 🗳 enhancement ✨ merged/21-x-y PR was merged to the "21-x-y" branch. semver/minor backwards-compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0