This repository was archived by the owner on Jun 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathi18n.mdc
More file actions
26 lines (25 loc) · 1.92 KB
/
i18n.mdc
File metadata and controls
26 lines (25 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
description: Translation workflow for Elixir/Phoenix gettext - finding and filling missing translations (only for projects with internationalization)
globs:
alwaysApply: false
---
**Note: This rule applies only to projects using internationalization/translations**
- Translations reside in priv/gettext.
- When adding new strings to be translated, use `mix gettext.extract --merge` to generate .pot and .po files.
- Don't change files for English (en).
- Translation files are organized by a domain, e.g. auth.po.
- To add a language, create a directory under priv/gettext (e.g. priv/gettext/en).
- To list .po files run `ls priv/gettext/*/LC_MESSAGES/*.po`.
- If any .po file (not in en) is missing a translation (msgstr field is empty), translate it by filling the msgstr with appropriate translation.
- Check for missing translations with: `make show_missing_translations` to ignore an empty msgstr in the header.
- After making translation changes, run `mix gettext.extract` to ensure consistency.
- Test translations by switching language in the application.
- Keep translations contextually appropriate and consistent with existing terminology in the same domain.
- Never use gettext functions in tests.
- Supported languages are defined in config/config.exs under the `locales` setting and correspond to folders in priv/gettext/.
- To add a new language: add it to the `locales` list in config and create the corresponding folder in priv/gettext/.
- Translation domains are determined by the .po files present in the project (e.g., jobs.po, general.po, companies.po).
- Maintain consistency in terminology across all domains within the same language.
- Use appropriate formality levels and typography rules for each target language.
- Fuzzy translations (marked with `#, fuzzy`) are uncertain and need review - always verify and remove the fuzzy flag when corrected.
- Search for fuzzy translations with: `grep -r "fuzzy" priv/gettext/*/LC_MESSAGES/*.po`.