Skip to content

SwitchPlugin and BackgroundTaskPlugin with tests#3137

Merged
Frenzie merged 4 commits intokoreader:masterfrom
Hzj-jie:master3
Aug 31, 2017
Merged

SwitchPlugin and BackgroundTaskPlugin with tests#3137
Frenzie merged 4 commits intokoreader:masterfrom
Hzj-jie:master3

Conversation

@Hzj-jie
Copy link
Copy Markdown
Contributor

@Hzj-jie Hzj-jie commented Aug 27, 2017

Similar logic has been implemented for several plugins. It should be better to share the logic.

function SwitchPlugin:_showConfirmBox()
UIManager:show(ConfirmBox:new{
text = self._confirmMessage() ..
T(_("Do you want to %1 it?"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I misunderstood your meaning :(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No problem at all. :)

@Frenzie Frenzie merged commit 1ff46a6 into koreader:master Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants