Add experimental Cursor rules

This commit is contained in:
Damien Elmes 2025-05-11 19:13:34 +10:00
parent 5080451829
commit 85cef5e625
2 changed files with 9 additions and 0 deletions

7
.cursor/rules/i18n.md Normal file
View file

@ -0,0 +1,7 @@
- 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.

2
.cursor/rules/testing.md Normal file
View file

@ -0,0 +1,2 @@
- To build and check the project, use ./check(.bat)
- This will format files, then run lints and unit tests.