mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
docs: split AGENTS.md into core policy and on-demand playbooks
2602.12670 and 2602.11988 findings favoring curated, minimal, modular guidance over comprehensive always-on context
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
# Translations Workflow
|
||||
|
||||
This project uses i18next translation files in `public/translations/{lang}/default.json`.
|
||||
|
||||
## Rule
|
||||
|
||||
Do not manually edit every language file. Use `scripts/update-translations.js`.
|
||||
|
||||
## Add or Update a Key
|
||||
|
||||
1. Create a temporary dictionary file, e.g. `translations-temp.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"en": "English text",
|
||||
"es": "Spanish text",
|
||||
"fr": "French text",
|
||||
"de": "German text"
|
||||
}
|
||||
```
|
||||
|
||||
2. Apply the translation map:
|
||||
|
||||
```bash
|
||||
node scripts/update-translations.js --key my_new_key --map translations-temp.json --include-en --write
|
||||
```
|
||||
|
||||
3. Delete the temporary dictionary file.
|
||||
|
||||
## Other Useful Commands
|
||||
|
||||
```bash
|
||||
# Copy a key from English to all languages (dry run then write)
|
||||
node scripts/update-translations.js --key some_key --from en --dry
|
||||
node scripts/update-translations.js --key some_key --from en --write
|
||||
|
||||
# Delete a key from all languages
|
||||
node scripts/update-translations.js --key obsolete_key --delete --write
|
||||
|
||||
# Audit for unused translation keys
|
||||
node scripts/update-translations.js --audit --dry
|
||||
node scripts/update-translations.js --audit --write
|
||||
```
|
||||
Reference in New Issue
Block a user