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

Fix broken translation metadata #9726

Merged
merged 1 commit into from
Nov 1, 2022
Merged

Conversation

Frenzie
Copy link
Member

@Frenzie Frenzie commented Nov 1, 2022

Should fix #9719

Regression introduced in #9682 by my fault.

See the xgettext error message:

frontend/dispatcher.lua:573: warning: Empty msgid.  It is reserved by GNU gettext:
                                      gettext("") returns the header entry with
                                      meta information, not the empty string.
xgettext: warning: msgid '' is used without plural and with plural.
                   xgettext.c:1975: Here is the occurrence without plural.
                   frontend/dispatcher.lua:573: Here is the occurrence with plural.
                   Workaround: If the msgid is a sentence, change the wording of the sentence; otherwise, use contexts for disambiguation.

This change is Reviewable

Should fix koreader#9719

Regression introduced in koreader#9682 by my fault.

See the xgettext error message:

```
frontend/dispatcher.lua:573: warning: Empty msgid.  It is reserved by GNU gettext:
                                      gettext("") returns the header entry with
                                      meta information, not the empty string.
xgettext: warning: msgid '' is used without plural and with plural.
                   xgettext.c:1975: Here is the occurrence without plural.
                   frontend/dispatcher.lua:573: Here is the occurrence with plural.
                   Workaround: If the msgid is a sentence, change the wording of the sentence; otherwise, use contexts for disambiguation.
```
@Frenzie Frenzie added the i18n label Nov 1, 2022
@Frenzie Frenzie added this to the 2022.11 milestone Nov 1, 2022
@@ -570,7 +570,7 @@ function Dispatcher:menuTextFunc(settings)
if item == "settings" then item = next(settings, item) end
action_name = Dispatcher:getNameFromItem(item, settings)
else
action_name = T(N_("", "%1 actions", count), count)
action_name = T(NC_("Dispatcher", "", "%1 actions", count), count)
Copy link
Member Author

@Frenzie Frenzie Nov 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't really right either since the singular is used as the ID, but it might work as long as there's only one per context.

Requires some more thought but I'll merge this quickly to fix the plurals.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that english singular is missing in weblate.
weblate_dispatcher_singular_string_missing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given all the tools expect it plus resulting confusion it'll be best to put an unused singular in there.

The "problem" is that if there's only one action, the name of the action is shown. It only says 2 actions, 3 actions, etc. if there's more than 1.

@Frenzie Frenzie merged commit 71cad1e into koreader:master Nov 1, 2022
@Frenzie Frenzie deleted the fix-translations branch November 1, 2022 19:59
Frenzie added a commit that referenced this pull request Nov 2, 2022
Tools and humans alike are confused by leaving it empty. It should be inoffensive to resolve the problem this by having an unused singular. Doing anything else would make it so we couldn't have the correct plurals in Slovak, among others.

Follow-up to #9726
Frenzie added a commit that referenced this pull request Nov 3, 2022
Tools and humans alike are confused by leaving it empty. It should be inoffensive to resolve the problem this by having an unused singular. Doing anything else would make it so we couldn't have the correct plurals in Slovak, among others.

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

Successfully merging this pull request may close these issues.

None yet

2 participants