Skip to content

Translations: Use substitutions instead of concatenations #1114

@hoffie

Description

@hoffie

Describe the improvement

Some strings currently use concatenations. Example:

QString strSndCardDriverSetupTT = tr ( "Opens the driver settings. Note: " ) + APP_NAME +

To Reproduce

Could probably use something like grep -Po 'tr\s*\(.*\).*\+.*' src/* to find other places (this will still yield false positives such as HTML concatenation, which should be OK I think).

Expected behavior

This was suggested by @pljones in #1097 (comment):

Would it not be easier for a translator to have the full text with substitutions (so, QString ( tr ( "Hello, %1" ) ).arg( getName() )..., giving the context)? Here there are three pieces, one starting with a measurement unit.

Additional context
Must only be changed after 3.7.0 is completed.

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