Skip to content
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

Merged
merged 1 commit into from
May 20, 2024

Conversation

mhdiop
Copy link
Contributor

@mhdiop mhdiop commented Mar 5, 2024

Mark some remaining translatable strings in Markups module

Copy link
Contributor

@lassoan lassoan left a 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();};
Copy link
Contributor

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/MRML/vtkMRMLMarkupsNode.h 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);
Copy link
Contributor

Choose a reason for hiding this comment

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

To follow Qt conventions

Suggested change
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);
Copy link
Contributor

Choose a reason for hiding this comment

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

To follow Qt conventions

Suggested change
static std::string getCostFunctionAsHumanReadableString(int costFunction);
static QString costFunctionAsDisplayableString(int costFunction);

@lassoan
Copy link
Contributor

lassoan commented Apr 16, 2024

@mhdiop Could you please have a look at the comments and update the pull request accordingly? Thank you!

@mhdiop
Copy link
Contributor Author

mhdiop commented Apr 17, 2024

Thank you @lassoan for the reminder. I'll update and submit it in a few moments.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// 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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// 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

Comment on lines 21 to 22
#include "vtkMRMLI18N.h"
#include "vtkCurveGenerator.h"
#include "vtkCurveMeasurementsCalculator.h"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#include "vtkMRMLI18N.h"
#include "vtkCurveGenerator.h"
#include "vtkCurveMeasurementsCalculator.h"
#include "vtkCurveGenerator.h"
#include "vtkCurveMeasurementsCalculator.h"
#include "vtkMRMLI18N.h"

Copy link
Contributor

@lassoan lassoan left a 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!

@lassoan lassoan enabled auto-merge (rebase) May 20, 2024 15:09
@lassoan lassoan merged commit 6905bb1 into Slicer:main May 20, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants