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 Extension wizard #7626
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.
Thank you it looks good I just added a few trivial comments.
@@ -355,7 +358,7 @@ def loadModules(path=None, depth=1, modules=None, parent=None): | |||
# Add module(s) to permanent search paths, if requested | |||
if dlg.addToSearchPaths: | |||
settings = slicer.app.revisionUserSettings() | |||
rawSearchPaths = list(_settingsList(settings, "Modules/AdditionalPaths", convertToAbsolutePaths=True)) | |||
rawSearchPaths = list(_settingsList(settings, _("Modules/AdditionalPaths"), convertToAbsolutePaths=True)) |
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.
Should not be translated
@@ -368,11 +371,11 @@ def loadModules(path=None, depth=1, modules=None, parent=None): | |||
modified = True | |||
|
|||
if modified: | |||
settings.setValue("Modules/AdditionalPaths", slicer.app.toSlicerHomeRelativePaths(rawSearchPaths)) | |||
settings.setValue(_("Modules/AdditionalPaths"), slicer.app.toSlicerHomeRelativePaths(rawSearchPaths)) |
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.
Should not be translated
|
||
# Enable developer mode (shows Reload&Test section, etc.), if requested | ||
if dlg.enableDeveloperMode: | ||
qt.QSettings().setValue("Developer/DeveloperMode", "true") | ||
qt.QSettings().setValue(_("Developer/DeveloperMode"), _("true")) |
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.
Should not be translated
@@ -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.
Please use named placeholders; e.g. {path}
@@ -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.
Named placeholder should be used
@@ -240,12 +243,12 @@ def createExtension(self): | |||
" directory containing CMakeLists.txt file at '%s'" % dlg.destination) | |||
|
|||
path = self.templateManager.copyTemplate( | |||
destination, "extensions", | |||
destination, _("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.
Don't translate
@@ -336,7 +339,7 @@ def loadModules(path=None, depth=1, modules=None, parent=None): | |||
# Get list of modules in specified path | |||
modules = ModuleInfo.findModules(path, depth) | |||
elif modules is None: | |||
raise RuntimeError("loadModules require 'path' or 'modules' input") | |||
raise RuntimeError("loadModules require 'path' or _('modules') input") |
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.
Don't translate
else: | ||
text = "The '%s' module could not be registered:" % failed[0].key | ||
text = _("The '%s' module could not be registered:") % failed[0].key |
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 placeholders
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.
Can you explain more this?
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.
We use placeholders everywhere where we need to insert some value into the string. For example, the code here should look something like this:
text = _("The {moduleName} module could not be registered").format(moduleName=failed[0].key)
Thank you for your comment, I will correct what you pointed out. |
Have you closed this intentionally? |
No, it wasn't intentional.
Le sam. 23 mars 2024 à 15:20, Andras Lasso ***@***.***> a
écrit :
… Have you closed this intentionally?
—
Reply to this email directly, view it on GitHub
<#7626 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWFEO4PJKF5JVNDCKIXXGI3YZWMSVAVCNFSM6AAAAABEUOCLGOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJWGUZDGMBSHA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
It seems that it is due to that you used the same branch in several pull requests. One branch can only store one set of changes, so you must use different git branch for each pull request. |
We already have a pull request for the Extensions Wizard translation - #7698. Is this pull request still relevant? |
No, sorry. I deactivated it, I will work on this #7698
<#7698>.
Le mar. 16 avr. 2024 à 19:20, Andras Lasso ***@***.***> a
écrit :
… We already have a pull request for the Extensions Wizard translation -
#7698 <#7698>. Is this pull request
still relevant?
—
Reply to this email directly, view it on GitHub
<#7626 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWFEO4MUYGOP2FZTECTDHWTY5V2Y7AVCNFSM6AAAAABEUOCLGOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJZG43TIOJQG4>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
@lassoan
I'm not sure if the lines 361, 374 and 378 should be marked