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

Generate l10n file on per locale basis #1658

Open
arkid15r opened this issue Jan 23, 2024 · 1 comment
Open

Generate l10n file on per locale basis #1658

arkid15r opened this issue Jan 23, 2024 · 1 comment
Labels

Comments

@arkid15r
Copy link
Collaborator

Currently we generate .po/.mo files for every entity. This approach is not ideal for l10n management and produces somewhat redundant l10n items. The better approach would be generate .po/.mo files on per locale basis. We need to consider switching to more simple mechanism and implement it when we have a chance. This would be a significant improvement for Weblate integration management too.

@arkid15r arkid15r added the v1 label Jan 23, 2024
@KJhellico
Copy link
Collaborator

I have some ideas about new l10n layout.
PO files use unified strings (derived from English name) as msgids. For holidays with the same name in all countries msgid begin with just "_" or some common prefix: "_new_years_day", "_good_friday", "_immaculate_conception" etc.
However, in some countries, the names of common holidays differ. For them, we use separate msgid with country code prefix: "ar_immaculate_conception", "bg_independence_day" etc.

So PO files will contain:

en_US.po:

#. New Year's Day.
msgid "_new_years_day"
msgstr "New Year's Day"
...
#. Good Friday.
msgid "_good_friday"
msgstr "Good Friday"
...
#. Immaculate Conception.
msgid "_immaculate_conception"
msgstr "Immaculate Conception"
...
#. Immaculate Conception.
msgid "ar_immaculate_conception"
msgstr "Immaculate Conception"

#. Independence Day.
msgid "_independence_day"
msgstr "Independence Day"

#. Independence Day.
msgid "bg_independence_day"
msgstr "Independence Day"

(in en_US locale names for Immaculate Conception in Argentina and Independence Day in Bulgaria doesn't differ from common)

es.po:

#. New Year's Day.
msgid "_new_years_day"
msgstr "Año Nuevo"
...
#. Good Friday.
msgid "_good_friday"
msgstr "Viernes Santo"
...
#. Immaculate Conception.
msgid "_immaculate_conception"
msgstr "Inmaculada Concepción"
...
#. Immaculate Conception.
msgid "ar_immaculate_conception"
msgstr "Inmaculada Concepción de María"

(in es locale name for Immaculate Conception in Argentina is different)

bg.po:

...
#. Independence Day.
msgid "_independence_day"
msgstr "Ден на независимостта"
# or there is simply no translation, if we don't yet need Bulgarian translation of countries other than Bulgaria

#. Independence Day.
msgid "bg_independence_day"
msgstr "Ден на Независимостта на България"

(in bg locale name for Independence Day in Bulgaria is different)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants