Files
anki/ftl
Ian e16fc17b3c fix: don't let ftl string copy/move land new strings in deprecated sections (#5332)
## 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).
2026-08-14 11:45:50 -05:00
..
2026-08-06 19:16:54 +03:00
2026-08-06 19:16:54 +03:00
2021-06-03 16:51:03 +10:00

Files related to Anki's translations.

Please see https://translating.ankiweb.net/anki/developers