Skip to content

Some strings aren't being generated by locales_generator.sh #4584

@acuteenvy

Description

@acuteenvy

Strings from the bottom help bar and the F1-triggered help section aren't being generated by the script.

Screenshot Image

The Polish translation shows up as 100% done, but it really isn't. If I manually put:

msgid "Up"
msgstr "W górę"

inside the Polish translation file, it works correctly:

Image

However, this edit will be commented out after running ./locales_generator.sh pl. If I also put the strings in base.pot, the script will remove them.

I think this is because the script only detects tr("string goes here"), and these remaining strings are translated from a variable:

def _translate_bindings(source: BindingsMap | None, target: BindingsMap) -> None:
"""Translate binding descriptions from source to target.
Uses source (original, immutable class-level cache) to avoid
double-translation on repeated calls (e.g. language switch).
"""
if source is None:
return
for key, bindings in source.key_to_bindings.items():
target.key_to_bindings[key] = [replace(b, description=tr(b.description)) if b.description else b for b in bindings]

This was added in #4363. The PR also manually added the strings to base.pot, but they got removed by the script in #4557.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions