SwitchPlugin and BackgroundTaskPlugin with tests#3137
SwitchPlugin and BackgroundTaskPlugin with tests#3137Frenzie merged 4 commits intokoreader:masterfrom Hzj-jie:master3
Conversation
frontend/ui/plugin/switch_plugin.lua
Outdated
| function SwitchPlugin:_showConfirmBox() | ||
| UIManager:show(ConfirmBox:new{ | ||
| text = self._confirmMessage() .. | ||
| T(_("Do you want to %1 it?"), |
There was a problem hiding this comment.
See my comment at #3078 (comment)
Is that safe for localization? It might be better to just write two full sentences, even if that seems redundant to a programmer.
There was a problem hiding this comment.
Writing into two sentences is not the right thing for localization. Some languages do not have the same syntax structure as English, so %1 may be placed before or after other elements. E.g. in Chinese, we usually say,
是否要%1?
%1 = 禁用 (disable) or 启用 (enable)
Because Chinese is not a syntax-first language, "it" is usually ignored. The context in the _confirmMessage() provides enough information to indicate what would be disabled.
(P.S. Syntax in Chinese is more complex than the example above, sometimes we can randomly put predicate before or after the object without breaking the meaning.)
There was a problem hiding this comment.
Writing into two sentences is not the right thing for localization. Some languages do not have the same syntax structure as English, so %1 may be placed before or after other elements.
But that's my whole point! In translating the whole sentence you're not dependent on random words like enable and disable being exactly the same as those that would actually fit into the sentence.
There was a problem hiding this comment.
Sorry, I misunderstood your meaning :(
Similar logic has been implemented for several plugins. It should be better to share the logic.