Anki/.cursor/rules/i18n.md
Damien Elmes 86c89907e7
Add URL scheme whitelist (#3994)
* Add experimental Cursor rules

* Add the ability to customize URL schemes

Closes #3965
2025-05-15 15:37:49 +10:00

768 B

  • We use the fluent system+code generation for translation.
  • New strings should be added to rslib/core/. Ask for the appropriate file if you're not sure.
  • Assuming a string addons-you-have-count has been added to addons.ftl, that string is accessible in our different languages as follows:
    • Python: from aqt.utils import tr; msg = tr.addons_you_have_count(count=3)
    • TypeScript: import * as tr from "@generated/ftl"; tr.addonsYouHaveCount({count: 3})
    • Rust: collection.tr.addons_you_have_count(3)
  • In Qt .ui files, strings that are marked as translatable will automatically use the registered ftl strings. So a QLabel with a title 'addons_you_have_count' that is marked as translatable will automatically use the translation defined in our addons.ftl file.