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

Allow full qualified language names (BCP47) #91

Closed
Omikhleia opened this issue Aug 4, 2023 · 3 comments · Fixed by #92
Closed

Allow full qualified language names (BCP47) #91

Omikhleia opened this issue Aug 4, 2023 · 3 comments · Fixed by #92
Assignees
Labels
bug Something isn't working refactor Something needs to be refactored
Milestone

Comments

@Omikhleia
Copy link
Owner

Omikhleia commented Aug 4, 2023

Currently we "normalize" languages to a 2-letter code.

Whatever happens on the SILE front for sile-typesetter/sile#1641

Let's rely on silex too, and remove the normalizeLang workarounds we have here and there in the code.

So for instance fr and fr-CH get both correct smartquotes and still load correct hyphenation patterns etc.

@Omikhleia Omikhleia added bug Something isn't working refactor Something needs to be refactored labels Aug 4, 2023
@Omikhleia Omikhleia added this to the 1.4.1 milestone Aug 4, 2023
@Omikhleia
Copy link
Owner Author

Djot

{lang=es}
"Es 'muy' difícil"

{lang=es-MX}
"Es 'muy' difícil"

{lang=fr}
"Un 'bon' essai"

{lang=fr-CH}
"Un 'bon' essai"

Current:

image

@Omikhleia
Copy link
Owner Author

With just removing the normalizeLang hacks:

image

With SILE complaints:

! Unable to load language feature support (e.g. hyphenation rules) for es-MX: module 'languages.es-MX' not found at es.dj:0:0: in \language[main="es-MX"]
! Unable to load localized strings (e.g. table of contents header text) for es-MX: module 'i18n.es-MX' not found at es.dj:0:0: in \language[main="es-MX"]
! Unable to load language feature support (e.g. hyphenation rules) for fr-CH: module 'languages.fr-CH' not found at es.dj:0:0: in \language[main="fr-CH"]
! Unable to load localized strings (e.g. table of contents header text) for fr-CH: module 'i18n.fr-CH' not found at es.dj:0:0: in \language[main="fr-CH"]

@Omikhleia
Copy link
Owner Author

Relying on silex

image

And no complaints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working refactor Something needs to be refactored
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant