Skip to content

Custom-name substitution corrupts translation keys and misses occurrences #305

Description

@Day-Anger

Custom-name substitution corrupts translation keys and misses occurrences

The change appname to custom step rewrites Cargo.toml, Runner.rc,
License.rtf and src/lang/*.rs with sed. I byte-compared its output
against a value-targeted replacement on real 1.4.9 sources
(appname with a space, stock everything else) and found three
defects. All below are reproducible with stock GNU sed.

1. Translation keys get corrupted (ru.rs and friends)

The lang rewrite is a blanket s|RustDesk|<appname>| without the
g flag
, so it hits the first occurrence per line — which in
("key", "value") tuples is often the key:

# stock 1.4.9 src/lang/ru.rs
("Keep RustDesk background service", "...")
("Show RustDesk", "...")
("About RustDesk", "...")

# after the workflow step (appname "RustDesk GTO")
("Keep RustDesk GTO background service", "...")   # key broken:
                                                  # lookup fails, falls back to English
("Show RustDesk GTO", "...")                      # same
("About RustDesk GTO", "...")                     # same

The translated values on those same lines keep saying RustDesk
(second occurrence untouched). So one step both breaks lookups and
misses the branding it was supposed to apply.

2. Second occurrences missed everywhere (en.rs, License.rtf)

Same missing g: install_tip keeps install RustDesk to the system, and the MSI license text keeps RustDesk-IDs /
performance of RustDesk software license agreement — stock name
ships inside the installer users actually read.

Note the dilemma: just adding g would corrupt more keys (see 1),
so the step needs value-targeted replacement, not a flag.

3. InternalName pattern never matches (Runner.rc)

sed -i -e 's|VALUE "InternalName", "rustdesk" "\0"|...|' ./flutter/windows/runner/Runner.rc

Against 1.4.9's Runner.rc this matches nothing (different spacing
around \0), so InternalName silently stays rustdesk in every
custom build. (Side note: sed also strips the files' BOM; harmless
for rustc, but признак того же подхода.)

Proposal

Happy to PR this in whatever shape you prefer — e.g. g + key
safelist, or a small value-targeted script. I have byte-level
before/after fixtures for all of the above if useful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions