Skip to content
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

Proposal: i18n-system-languages #569

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d078e45
Add getOSLanguage proposal
carlosjeurissen Mar 18, 2024
7ed4c53
Update proposals/i18n-getOSLanguage.md
carlosjeurissen Mar 28, 2024
916f91d
Update proposals/i18n-getOSLanguage.md
carlosjeurissen Mar 28, 2024
30fbed6
Update workaround description
carlosjeurissen Mar 28, 2024
1339056
Add back Sponsoring Browser with TBD
carlosjeurissen Mar 28, 2024
b7781f4
Add Bugzilla bug to related issues
carlosjeurissen Mar 28, 2024
ae8e4e2
Add Author GitHub link
carlosjeurissen Mar 28, 2024
0c352e8
Add bcp47 link
carlosjeurissen Mar 28, 2024
15fde77
Rephrase objective
carlosjeurissen Mar 28, 2024
1bf297c
Rename IETF tags to BCP47 language tags
carlosjeurissen Mar 30, 2024
b9ab150
Remove > from title
carlosjeurissen Mar 31, 2024
da34a81
Replace chromium source reference with a permalink
carlosjeurissen Mar 31, 2024
6107700
Update proposals/i18n-getOSLanguage.md
carlosjeurissen Apr 19, 2024
38e9f39
Update proposal to include both getPreferredSystemLanguages and getSy…
carlosjeurissen May 23, 2024
4eb3df1
Rename proposal file to better reflect the proposal
carlosjeurissen May 23, 2024
280efb5
Fix proposal title
carlosjeurissen Jun 6, 2024
90dec9b
Update proposals/i18n-system-languages.md
carlosjeurissen Jun 14, 2024
1d995e9
Update proposals/i18n-system-languages.md
carlosjeurissen Jun 14, 2024
89f08b3
Clarify the type of list returned by getPreferredSystemLanguages
carlosjeurissen Jun 14, 2024
76acf81
Rewrite sentences to use locale instead of language when it makes sense
carlosjeurissen Jun 14, 2024
395c02e
Add purest form use-case
carlosjeurissen Jun 14, 2024
07b64c9
Update proposals/i18n-system-languages.md
carlosjeurissen Sep 23, 2024
e8ae3a9
Clarify additional subtags on getSystemUILanguage
carlosjeurissen Sep 24, 2024
7e3c88f
Update getSystemUILanguage to be async
carlosjeurissen Sep 24, 2024
64b942d
Clarify getPreferredSystemLanguages callback parameter
carlosjeurissen Sep 24, 2024
42f71ae
Clarify getPreferredSystemLanguages would not insert less specific lo…
carlosjeurissen Oct 2, 2024
7ac0a42
Remove additional subtags note on getSystemUILanguage
carlosjeurissen Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions proposals/i18n-system-languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ Language-related extensions and extensions wanting to match the locale of the op
"parameters": [],
"returns_async": {
"name": "callback",
"parameters": [
{"name": "languages", "type": "array", "items": {"$ref": "LanguageCode"}, "description": "Array of LanguageCode"}
]
"parameters": [{
"name": "languages",
"type": "array",
"items": {"$ref": "LanguageCode"},
"description": "Array of LanguageCode"
}]
}
}

Expand All @@ -67,11 +70,14 @@ It would follow the following signature for [i18n.json](https://chromium.googles
"name": "getSystemUILanguage",
"type": "function",
"nocompile": true,
"description": "Gets the current UI language of the Operating System. This is different from $(ref:i18n.getUILanguage) which returns the UI language of the web browser.",
"description": "Gets the current UI locale of the Operating System. This is different from $(ref:i18n.getUILanguage) which returns the UI locale of the web browser. This locale could include additional information like preferred datetime format and number system if supported by the OS.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the "additional information" part a standard? I know Apple platforms can include it, but that isn't something we have had in web extensions before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xeenon yes, this is specified by unicode. This was discussed during the shared session with the WECG/I18NWG meeting at TPAC. However, giving a further look at this I see how this should not be part of the getSystemUILanguage. Updated the PR to reflect this. Still, providing this information can be useful, but it should be implemented using some other method / proposal.

"parameters": [],
"returns": {
"type": "string",
"description": "A BCP47 language tag such as en-US or pt-BR."
"returns_async": {
"name": "callback",
"parameters": [{
"type": "string",
"description": "A BCP47 language tag such as en-US or pt-BR."
}]
}
}
```
Expand Down