-
Notifications
You must be signed in to change notification settings - Fork 521
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 Markups module #7620
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, this looks very nice, I just added a couple of comments inline.
@@ -151,6 +151,9 @@ class VTK_SLICER_MARKUPS_MODULE_MRML_EXPORT vtkMRMLMarkupsNode : public vtkMRML | |||
/// Get markup short name | |||
virtual const char* GetDefaultNodeNamePrefix() {return "M";}; | |||
|
|||
/// Get markup type GUI display name | |||
virtual const char* GetTypeDisplayName() override {return this->TypeDisplayName.empty() ? "Markup" : this->TypeDisplayName.c_str();}; |
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.
Move the implementation to the .cxx file and make thd default "Markup" string translatable.
Modules/Loadable/Markups/Widgets/qMRMLMarkupsCurveSettingsWidget.cxx
Outdated
Show resolved
Hide resolved
@@ -45,8 +45,8 @@ class qMRMLMarkupsCurveSettingsWidgetPrivate | |||
public: | |||
qMRMLMarkupsCurveSettingsWidgetPrivate(qMRMLMarkupsCurveSettingsWidget &widget); | |||
|
|||
static const char* getCurveTypeAsHumanReadableString(int curveType); | |||
static const char* getCostFunctionAsHumanReadableString(int costFunction); | |||
static std::string getCurveTypeAsHumanReadableString(int curveType); |
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.
To follow Qt conventions
static std::string getCurveTypeAsHumanReadableString(int curveType); | |
static QString curveTypeAsDisplayableString(int curveType); |
static const char* getCurveTypeAsHumanReadableString(int curveType); | ||
static const char* getCostFunctionAsHumanReadableString(int costFunction); | ||
static std::string getCurveTypeAsHumanReadableString(int curveType); | ||
static std::string getCostFunctionAsHumanReadableString(int costFunction); |
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.
To follow Qt conventions
static std::string getCostFunctionAsHumanReadableString(int costFunction); | |
static QString costFunctionAsDisplayableString(int costFunction); |
@mhdiop Could you please have a look at the comments and update the pull request accordingly? Thank you! |
Thank you @lassoan for the reminder. I'll update and submit it in a few moments. |
bfa3afe
to
2f97a75
Compare
@@ -1029,6 +1032,14 @@ class VTK_SLICER_MARKUPS_MODULE_MRML_EXPORT vtkMRMLMarkupsNode : public vtkMRML | |||
|
|||
std::string PropertiesLabelText; | |||
|
|||
/// Store markup type GUI display name | |||
/// It's displayed to the user and is therefore translated to the application language |
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.
/// It's displayed to the user and is therefore translated to the application language | |
/// \note It's displayed to the user and is therefore translated to the application language |
std::string TypeDisplayName; | ||
|
||
/// Store markup short name | ||
/// It's displayed to the user and is therefore translated to the application language |
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.
/// It's displayed to the user and is therefore translated to the application language | |
/// \note It's displayed to the user and is therefore translated to the application language |
#include "vtkMRMLI18N.h" | ||
#include "vtkCurveGenerator.h" | ||
#include "vtkCurveMeasurementsCalculator.h" |
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.
#include "vtkMRMLI18N.h" | |
#include "vtkCurveGenerator.h" | |
#include "vtkCurveMeasurementsCalculator.h" | |
#include "vtkCurveGenerator.h" | |
#include "vtkCurveMeasurementsCalculator.h" | |
#include "vtkMRMLI18N.h" |
2f97a75
to
774acf1
Compare
774acf1
to
174466e
Compare
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.
It all looks good, thank you!
Mark some remaining translatable strings in Markups module