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

Language naming issue at Hide translation block #2814

Closed
iamdtms opened this issue Apr 14, 2024 · 21 comments · May be fixed by #2817
Closed

Language naming issue at Hide translation block #2814

iamdtms opened this issue Apr 14, 2024 · 21 comments · May be fixed by #2817
Labels
c: bug Something isn't working c: i18n Enhance i18n s: needs decision Needs team/maintainer decision

Comments

@iamdtms
Copy link
Contributor

iamdtms commented Apr 14, 2024

In Settings > Language > At the 'Hide specific translations' block Hungarian language starts with a lowercase letter, need to replace Uppercase letter. I did not found it in the hu-HU.json file. Screenshot attachment also available.

Screenshot 2024-04-14 020925

Thank you!

@iamdtms iamdtms added c: bug Something isn't working s: pending triage Pending Triage labels Apr 14, 2024
Copy link

stackblitz bot commented Apr 14, 2024

Solve in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@iamdtms iamdtms changed the title feat(i18n): Hide translation Language naming issue at Hide translation block Apr 14, 2024
@userquin userquin added bug: upstream and removed s: pending triage Pending Triage labels Apr 14, 2024
@userquin
Copy link
Member

We use ISO-639-1 library, and the library has a few entries with lower case languages.

@iamdtms
Copy link
Contributor Author

iamdtms commented Apr 14, 2024

Okay then, so it's another issue.

@iamdtms iamdtms closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2024
@userquin
Copy link
Member

no, browser Intl functions also showing magdar, I'll check using also country, preparing small script...

@iamdtms iamdtms reopened this Apr 14, 2024
@userquin
Copy link
Member

you can open chrome/firefox dev tools (pressing F12 key), then paste this code on console tab:

new Intl.DisplayNames(
    ['hu'],
    { type: 'language', languageDisplay: 'standard', localeMatcher: 'lookup' },
  ).of('hu')

and

new Intl.DisplayNames(
    ['hu-HU'],
    { type: 'language', languageDisplay: 'standard', localeMatcher: 'lookup' },
  ).of('hu-HU')

Chrome:

imagen

Firefox:

imagen

@shuuji3
Copy link
Member

shuuji3 commented Apr 14, 2024

Screenshot 2024-04-14 at 19 45 05

https://mastodon.social/settings/preferences/appearance

This is the same in Mastodon UI. I think those language names are written in each language. Although I have little knowledge of Hungarian, I guess the lowercase one ("magdar") is a formal spelling in Hungarian in terms of the language name? Wiktionary also writes "magdar" in Hungarian but "Magdar" is English spelling.

ref.

@userquin userquin added s: needs decision Needs team/maintainer decision and removed c: bug Something isn't working bug: upstream labels Apr 14, 2024
@userquin
Copy link
Member

userquin commented Apr 14, 2024

Here some pairs from iso-639-1 and Intl.DisplayNames`:

imagen

imagen

@iamdtms
Copy link
Contributor Author

iamdtms commented Apr 14, 2024

magyar is a noun, but Magyarország is proper noun in English.
What confused me was that not all items capitalized.

@iamdtms iamdtms closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2024
@shuuji3
Copy link
Member

shuuji3 commented Apr 14, 2024

When "magyar" is not a wrong case, I think the confusion is due to inconsistency with the above "Language" section. This capitalized one is hardcoded here:

elk/config/i18n.ts

Lines 121 to 125 in c56d6b1

{
code: 'hu-HU',
file: 'hu-HU.json',
name: 'Magyar',
},

so we should use the same case as the below ISO 639-1's ones.

Screenshot 2024-04-14 at 20 03 03

@userquin
Copy link
Member

@shuuji3 as I mention, we use iso-639-1 library, rn that library and Intl.DisplayNames seems to match, in Language section we're using the i18n entries (i18n.ts module in conf folder).

Maybe we can update i18n.ts module to use same lang names.

@shuuji3
Copy link
Member

shuuji3 commented Apr 14, 2024

Yes, that's my understanding👍🏻 Can I try updating i18n.ts to use the same names?

@userquin
Copy link
Member

I'm going to check if we can infer display names in node side (no idea if Intl in node is fine)

I'm checking some spanish "languages" like es-419, ca-valencia, ca-ES, eu-ES and gl-ES:

Firefox (seems to be fine):

imagen

Chrome (seems to be fine, some missmatch with FF):

imagen

@iamdtms
Copy link
Contributor Author

iamdtms commented Apr 14, 2024

It is a style thing or it is language thing to have the first letter uppercase in lists? As a designer it is more important to have all first letter uppercase. I propose Magyar could be better in every language related list IMHO. And also important to have the same usage in every circumstances. It's only my opinion, I do not want to intervene in Elk development.

@userquin
Copy link
Member

@iamdtms it is a problem with the language: for example, week days in Spanish are no proper names (in Spain) and so the names should be in lowercase (with some exceptions), but anyone may want to use first letter in uppercase: monday (en) => lunes (es) => Lunes (es) (ofc, Lunes is wrong)

@iamdtms
Copy link
Contributor Author

iamdtms commented Apr 14, 2024

selector:first-letter { text-transform: uppercase } also an option for proper display with no text replacement?

@userquin
Copy link
Member

That css hack is wrong, not all languages using language names as proper names, in Spain spanish is español and not Español (in fact conf/i18n.ts is wrong, we should update lang names there properly).

From Intl and iso-639-1 library, the correct name seems to be magdar and not Magdar (or both are wrong, I have no idea about it)

@iamdtms
Copy link
Contributor Author

iamdtms commented Apr 14, 2024

I understand. Good luck with that multilingual thing.

@userquin
Copy link
Member

(screenshot translation): the words used to designate the different languages are common names, which is why they must always be written with a lower case letter: spanish is the most studied language in the world after English.

imagen

@userquin userquin reopened this Apr 14, 2024
@userquin
Copy link
Member

I'm going to prepare a PR to use Intl/ISO-639-1 language names in config/i18n.ts: this way Language and Translations will match.

@userquin
Copy link
Member

@iamdtms with #2817 should be fine, languages and translations in settings language will show the same names (from conf/i18n.ts), we can change the names in conf/i18n.ts if we want

@iamdtms
Copy link
Contributor Author

iamdtms commented Apr 14, 2024

Thank you!

@iamdtms iamdtms closed this as completed Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working c: i18n Enhance i18n s: needs decision Needs team/maintainer decision
Projects
None yet
3 participants