mirror of
https://github.com/ankitects/anki.git
synced 2026-09-10 06:20:47 -04:00
## Linked issue (required) Closes #5177 ## Summary / motivation (required) See #5177, as well as https://github.com/ankitects/anki-core-i18n/pull/18 ## Steps to reproduce (required, use N/A if not applicable) N/A ## How to test (required) 1. Run the newly added tests (`cargo test -p ftl string::tests`) 2. Run the following: ```sh mkdir -p /tmp/ftl-demo/en cat > /tmp/ftl-demo/en/errors.ftl <<'EOF' errors-collection-too-new = This collection requires a newer version of Anki to open. ## NO NEED TO TRANSLATE. This text is no longer used by Anki, and will be removed in the future. errors-invalid-input-empty = Invalid input. EOF cargo run -p ftl -- string copy /tmp/ftl-demo /tmp/ftl-demo errors-collection-too-new errors-demo-key cat /tmp/ftl-demo/en/errors.ftl ``` Expected output — the new key lands above the deprecated section, not inside it. ### Checklist (minimum) - [X] I ran `./ninja check` or an equivalent relevant check locally. - [X] I added or updated tests when the change is non-trivial or behavior changed. ### Details See "how to test" ## Before / after behavior (optional) BEFORE: Strings were appended to the file, sometimes landing them in the deprecated section. AFTER: Strings are added after the initial global comments if they exist, ensuring new strings do not land in a deprecated section. ## Risk / compatibility / migration (optional) Currently the deprecated section markers are all over the place; suggesting a one-off followup PR in the i18n repo to clean them, then another change to lint for the standardized deprecation titling to prevent drift, and/or some other way of keeping that section highly specific. ## UI evidence (required for visual changes; otherwise N/A) N/A ## Scope - [X] This PR is focused on one change (no unrelated edits).
Files related to Anki's translations.