-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Dispatcher: preserve profile name, show actions count #9682
Conversation
Added |
frontend/dispatcher.lua
Outdated
if count == 1 then | ||
local item = next(settings) | ||
if item == "settings" then item = next(settings, item) end | ||
action_name = Dispatcher:getNameFromItem(item, settings) | ||
else | ||
action_name = _("Many") | ||
action_name = T(_("%1 actions"), count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if this is already in a > 1 branch ? Put something anyway for the singular form for translators to translate even if not used ? Put an empty string ?
And how do we now how many plural form to put here, as its a property of the language. Or do we just use it with 2 items (as the doc says, ngettext (msgid, msgid_plural, n)
), and it's the translation tools that will propose and record the 5 plural variations of Tadjugizbekistanese ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if this is already in a > 1 branch ?
That's my entire point. In some languages you have 3many vs 5many vs 10many vs 100many.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And how do we now how many plural form to put here, as its a property of the language. Or do we just use it with 2 items (as the doc says, ngettext (msgid, msgid_plural, n) ), and it's the translation tools that will propose and record the 5 plural variations of Tadjugizbekistanese ?
Yes, that's what it's for. English (as well as Dutch, French, etc.) basically only have 1 or plural.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put something anyway for the singular form for translators to translate even if not used ? Put an empty string ?
Probably empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some languages have different kinds of many. ;-)
koreader/frontend/dispatcher.lua Line 573 in d4153df
Is it okay? Can be merged? |
Yes, that seems fine by me. |
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. ```
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. ``` Co-authored-by: Frans de Jonge <frans@clevercast.com>
(1) Preserve profile name when selecting the "Nothing" action.
(2) Show number of actions instead of "Many".
TODO after #9651 (comment): fix checkbox of the "Nothing" action for profiles with name.
koreader/frontend/dispatcher.lua
Lines 800 to 802 in 724db87
This change is