-
Notifications
You must be signed in to change notification settings - Fork 520
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
BUG: Mark translatable strings in module ExtensionWizard #7698
Conversation
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.
Thanks, this is quite good, there are just a couple of things to change and test - see details in the inline comments.
@@ -12,7 +12,7 @@ | |||
See the License for the specific language governing permissions and | |||
limitations under the License. | |||
|
|||
This file was originally developed by Adam Rankin, PerkLab, Queen's University | |||
This file was originally developed by Adam Rankin, PerkLab, Queen's University |
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.
remove extra space
@@ -186,7 +189,7 @@ def setupTemplates(self): | |||
try: | |||
self.templateManager.addPath(builtinPath) | |||
except: | |||
qt.qWarning("failed to add built-in template path %r" % builtinPath) | |||
qt.qWarning(_("failed to add built-in template {path} %r") % builtinPath) |
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.
qt.qWarning(_("failed to add built-in template {path} %r") % builtinPath) | |
qt.qWarning(_("failed to add built-in template {path}").format(path=builtinPath)) |
@@ -195,7 +198,7 @@ def setupTemplates(self): | |||
try: | |||
self.templateManager.addPath(path) | |||
except: | |||
qt.qWarning("failed to add template path %r" % path) | |||
qt.qWarning(_("failed to add template {path} %r") % path) |
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.
fix the same way as the previous one
@@ -206,13 +209,13 @@ def setupTemplates(self): | |||
self.templateManager.addCategoryPath(c, path) | |||
except: | |||
mp = (c, path) | |||
qt.qWarning("failed to add template path %r for category %r" % mp) | |||
qt.qWarning(_("failed to add template path %r for category %r") % mp) |
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.
fix the same way as the previous one
dlg = CreateComponentDialog("extension", self.parent.window()) | ||
dlg.setTemplates(self.templateManager.templates("extensions")) | ||
dlg = CreateComponentDialog(_("extension"), self.parent.window()) | ||
dlg.setTemplates(self.templateManager.templates(_("extensions"))) |
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.
I don't think is is allowed to be translated. Please test.
dlg.setTemplates(self.templateManager.templates(_("extensions"))) | |
dlg.setTemplates(self.templateManager.templates("extensions")) |
dlg.setTemplates(self.templateManager.templates("modules"), | ||
default="scripted") | ||
dlg = CreateComponentDialog(_("module"), self.parent.window()) | ||
dlg.setTemplates(self.templateManager.templates(_("modules")), |
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.
probably must not be translated, please test
default="scripted") | ||
dlg = CreateComponentDialog(_("module"), self.parent.window()) | ||
dlg.setTemplates(self.templateManager.templates(_("modules")), | ||
default=_("scripted")) |
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.
probably must not be translated
dlg.showDestination = False | ||
|
||
while dlg.exec_() == qt.QDialog.Accepted: | ||
name = dlg.componentName | ||
|
||
try: | ||
self.templateManager.copyTemplate(self.extensionLocation, "modules", | ||
self.templateManager.copyTemplate(self.extensionLocation, _("modules"), |
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.
probably must not be translated
project = _map_property(lambda self: self.ui.nameEdit, "text") | ||
category = _map_property(lambda self: self.ui.categoryEdit, "text") | ||
description = _map_property(lambda self: self.ui.descriptionEdit, "plainText") | ||
project = _map_property(lambda self: self.ui.nameEdit, _("text")) |
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.
"text" must not be translated in these lines (this is a Qt object property name)
@@ -113,7 +114,7 @@ def contributors(self, value): | |||
item.setText(1, c[n + 1 : -1].strip()) | |||
|
|||
except ValueError: | |||
qt.qWarning("%r: badly formatted contributor" % c) | |||
qt.qWarning(_("%r: badly formatted contributor") % c) |
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.
use named placeholder {}
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.
I've implemented fixes for all my review comments. It should be good to go now.
Ok, done. thank you Mr. @lassoan . |
@lassoan can you please look at this.