-
-
Notifications
You must be signed in to change notification settings - Fork 566
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
feat(i18n): use same languages names in display and translations sections (settings/language) #2817
base: main
Are you sure you want to change the base?
Conversation
Run & review this pull request in StackBlitz Codeflow. |
✅ Deploy Preview for elk-zone ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for elk-docs canceled.
|
Maybe we can use use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that we can use lang+country code (e.g. en-US
) for the "Display Language" section but we should use only lang code (e.g. en
) without country variants for the "Hide Translation" setting.
Before
see: https://main.elk.zone/settings/language
After
see: https://deploy-preview-2817--elk-zone.netlify.app/settings/language
This is because Mastodon's status object only has two characters of lang code such as en
and es
so we can only filter by lang code.
ref. Status - Mastodon documentation - https://docs.joinmastodon.org/entities/Status/#language
example:
{
...
id: "112225445529039980",
content: "<p>Hello</p>",
language: "en",
media_attachments: [],
...
}
If this can simplify code, maybe it's a good idea? |
Also, do we want to use the new function elk/components/settings/SettingsLanguage.vue Lines 10 to 16 in 55037f0
+import { getDisplayName } from 'virtual:iso-639-1'
...
- {{ item.name }}
+ {{ getDisplayName(item.code) }} |
No, those locales come from |
OK, will we adjust |
We could also consider other languages in the "Hide translation" list (please refer to #2843). Although there is no need to include them in this PR, it may affect how we organize the language names. |
This PR includes a new virtual module to use it instead
iso-639-1
dependency: since translations showing only configured languages inconf/i18n.ts
module, we just use them via the virtual module.We cannot remove
iso-639-1
dependency, it is being used incomposables/language.ts
(also renamed) and publish widgets (languages and fuse).We can decide if we change the languages names to use
Intl.DisplayNames/iso-639-1
ones: for example including only country names when added to the country variant entry inconf/i18n.ts
module.Language Names with Country Variants in Firefox
closes #2814