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 names #6789

Merged
merged 3 commits into from
Aug 6, 2023
Merged

Language names #6789

merged 3 commits into from
Aug 6, 2023

Conversation

Lawrence37
Copy link
Collaborator

See #6657 for context.

This displays language names in their own language, e.g. Castellano Spanish is "Español (Castellano)". The name is defined in the language's respective file as a metadata variable called LANGUAGE_DISPLAY_NAME. I describe metadata variables in the commit message:

Metadata variables are defined in the first section of a language file,
i.e. the comments at the beginning of the file. At most one variable can
be defined per line. The definition takes the following format:
   #<header><whitespace>@<key>=<value>
where:
   <header> is any sequence of non-whitespace characters
   <whitespace> is any non-empty sequence of whitespace characters
   <key> is the metadata key name
   <value> is the metadata value
For example,
   #101 @LANGUAGE_DISPLAY_NAME=English (US)
defines a metadata key "LANGUAGE_DISPLAY_NAME" with value
"English (US)". Lines that do not match the format are ignored.

These changes only affect the names displayed in the drop-down for selecting the language. options still saves the language file's name. All language names have been added to the best of my ability.

Screenshot:
image
Excuse the tofu for Chinese. Something is wrong with the fonts on my system.

Closes #6657.

Add ability to set metadata variables in the language files.
Use the LANGUAGE_DISPLAY_NAME metadata variable value in preferences to
show the languages.

Metadata variables are defined in the first section of a language file,
i.e. the comments at the beginning of the file. At most one variable can
be defined per line. The definition takes the following format:
    #<header><whitespace>@<key>=<value>
where:
    <header> is any sequence of non-whitespace characters
    <whitespace> is any non-empty sequence of whitespace characters
    <key> is the metadata key name
    <value> is the metadata value
For example,
    Beep6581#101 @LANGUAGE_DISPLAY_NAME=English (US)
defines a metadata key "LANGUAGE_DISPLAY_NAME" with value
"English (US)". Lines that do not match the format are ignored.
@Lawrence37 Lawrence37 added scope: localization Translation scope: GUI Changes to GUI, not core functionality labels Jul 5, 2023
@Lawrence37 Lawrence37 added this to the v5.10 milestone Jul 5, 2023
@Lawrence37 Lawrence37 self-assigned this Jul 5, 2023
@Hombre57
Copy link
Collaborator

Hombre57 commented Aug 2, 2023

@Lawrence37 PR tested on my side, it's working fine 👍 . This PR should be merged once the README has been updated.

@Lawrence37
Copy link
Collaborator Author

Thanks for reviewing, @Hombre57. I agree with the README.

@kmilos
Copy link
Contributor

kmilos commented Aug 4, 2023

All language names have been added to the best of my ability.

Just in case you were not aware, you can pull these from https://cldr.unicode.org/

@Lawrence37
Copy link
Collaborator Author

Checking against CLDR, I confirmed all languages except for Chinese (Simplified) (not present in CLDR), Czech (čeština in CLDR, Český on my KDE system), and Brazilian Portuguese (not present in CLDR). Čeština seems correct based on a quick internet search.

@Lawrence37 Lawrence37 merged commit a596de2 into Beep6581:dev Aug 6, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: GUI Changes to GUI, not core functionality scope: localization Translation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Displaying correct, untranslated languages in preferences
3 participants