Skip to content

Printf strings with single % #3200

@BsAtHome

Description

@BsAtHome

A translation text used in a printf-style format uses a single '%' and is missing a proper format specifier. It looks, from the context, that a literal percent sign is meant to be printed.

A fix is to change the format to '%%', to print the percent sign.

That said, this is a change in a translatable string, which has consequences for all translations. I have not looked at the i18n and l10n procedures, so I have no idea how to fix it for all languages. Someone with knowledge of the translation procedure can use the diff below and then fix all translations.

diff --git a/src/emc/rs274ngc/rs274ngc_return.hh b/src/emc/rs274ngc/rs274ngc_return.hh
index 29e320625e..24dcf27ca5 100644
--- a/src/emc/rs274ngc/rs274ngc_return.hh
+++ b/src/emc/rs274ngc/rs274ngc_return.hh
@@ -77,8 +77,8 @@
 #define NCE_EQUAL_SIGN_MISSING_IN_PARAMETER_SETTING _("Equal sign missing in parameter setting")
 #define NCE_F_WORD_MISSING_WITH_INVERSE_TIME_ARC_MOVE _("F word missing with inverse time arc move")
 #define NCE_F_WORD_MISSING_WITH_INVERSE_TIME_G1_MOVE _("F word missing with inverse time g1 move")
-#define NCE_FILE_ENDED_WITH_NO_PERCENT_SIGN _("File ended with no percent sign (%)")
-#define NCE_FILE_ENDED_WITH_NO_PERCENT_SIGN_OR_PROGRAM_END _("File ended with no percent sign (%) or program end (M2)")
+#define NCE_FILE_ENDED_WITH_NO_PERCENT_SIGN _("File ended with no percent sign (%%)")
+#define NCE_FILE_ENDED_WITH_NO_PERCENT_SIGN_OR_PROGRAM_END _("File ended with no percent sign (%%) or program end (M2)")
 #define NCE_FILE_NAME_TOO_LONG _("File name too long")
 #define NCE_G_CODE_OUT_OF_RANGE _("G-code out of range")
 #define NCE_I_WORD_GIVEN_FOR_ARC_IN_YZ_PLANE _("I word given for arc in yz plane")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions