@localheroai/cli 0.0.45-multilang.2 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -27
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ We auto-detect your project during init.
|
|
|
76
76
|
|
|
77
77
|
### Multi-language files (beta)
|
|
78
78
|
|
|
79
|
-
Some projects keep all locales in one file, with top-level locale keys
|
|
79
|
+
Some projects keep all locales in one file, with top-level locale keys:
|
|
80
80
|
|
|
81
81
|
```yaml
|
|
82
82
|
en:
|
|
@@ -85,43 +85,21 @@ sv:
|
|
|
85
85
|
subject: "Du har blivit inbjuden"
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
Opt in by
|
|
89
|
-
|
|
90
|
-
```json
|
|
91
|
-
"translationFiles": {
|
|
92
|
-
"paths": ["config/locales/", "apps/"],
|
|
93
|
-
"pattern": "**/*.{yml,yaml}",
|
|
94
|
-
"multiLanguageFiles": true
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Detection rule: every top-level key in the file must be a configured locale (in `sourceLocale` or `outputLocales`), and there must be at least two. Supported formats: YAML and JSON. PO files are not supported.
|
|
99
|
-
|
|
100
|
-
This is a beta feature — please report issues.
|
|
88
|
+
Opt in by setting `translationFiles.multiLanguageFiles: true`. YAML and JSON only, not PO. A file is treated as multi-language when every top-level key is a configured locale (source or output), with at least two locales present.
|
|
101
89
|
|
|
102
90
|
## Ignoring keys
|
|
103
91
|
|
|
104
|
-
|
|
105
|
-
errors served in English by an API, or internal admin strings. Add them to
|
|
106
|
-
`translationFiles.ignoreKeys` in your `localhero.json`:
|
|
92
|
+
Skip keys you don't want translated (e.g. Rails validation errors, internal admin strings) via `translationFiles.ignoreKeys`:
|
|
107
93
|
|
|
108
94
|
```json
|
|
109
95
|
{
|
|
110
96
|
"translationFiles": {
|
|
111
|
-
"ignoreKeys": [
|
|
112
|
-
"activerecord.errors.*",
|
|
113
|
-
"admin.internal.*"
|
|
114
|
-
]
|
|
97
|
+
"ignoreKeys": ["activerecord.errors.*", "admin.internal.*"]
|
|
115
98
|
}
|
|
116
99
|
}
|
|
117
100
|
```
|
|
118
101
|
|
|
119
|
-
|
|
120
|
-
supported: exact names (`foo.bar.baz`) and trailing wildcards (`foo.bar.*`,
|
|
121
|
-
recursive). Use `--verbose` to see a summary of what was ignored.
|
|
122
|
-
|
|
123
|
-
Not yet supported for `.po` / `.pot` files — those are uploaded unfiltered with
|
|
124
|
-
a warning.
|
|
102
|
+
Patterns are exact names or trailing wildcards (`foo.*`, recursive). Matches are skipped during `push` and `translate`; use `--verbose` for a summary. Not supported for `.po` / `.pot` files.
|
|
125
103
|
|
|
126
104
|
## Commands
|
|
127
105
|
|