mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-10-12 02:01:26 +00:00
Pull request 2702: AGDNS-4218-fix-translation-scripts
Squashed commit of the following: commit b4b41149e56fc657b7452ddc05feeeb9bc3fe913 Author: Maksim Kazantsev <[email protected]> Date: Fri Jul 10 19:08:47 2026 +0300 scripts: imp note; commit 1e3b636fd288832f67fea509ebea46269d6e07c2 Author: Maksim Kazantsev <[email protected]> Date: Fri Jul 10 19:07:24 2026 +0300 scripts: move note to readme; commit 23ba9336933ebb43e698e1f9da047ab5a87b7cd5 Author: Maksim Kazantsev <[email protected]> Date: Fri Jul 10 17:55:10 2026 +0300 translations: fix scripts;
This commit is contained in:
+1
-1
@@ -52,7 +52,7 @@
|
||||
"project_id": "hostlists-registry",
|
||||
"base_locale": "en",
|
||||
"localizable_files": [
|
||||
"client/src/__locales-services/services.json"
|
||||
"client/src/__locales-services/en.json"
|
||||
],
|
||||
"languages": {
|
||||
"ar": "العربية",
|
||||
|
||||
@@ -202,6 +202,9 @@ Optional environment:
|
||||
|
||||
- `go run ./scripts/translations summary`: show the current locales summary.
|
||||
|
||||
> [!NOTE]
|
||||
> The following script may produce false positives because JavaScript uses template literals like `servicesgroup.${group.id}.name`, so the actual key won't be found by substring search.
|
||||
|
||||
- `go run ./scripts/translations unused`: show the list of unused strings.
|
||||
|
||||
- `go run ./scripts/translations auto-add`: add locales with additions to the git and restore locales with deletions.
|
||||
|
||||
@@ -60,8 +60,9 @@ type languages map[langCode]string
|
||||
// textlabel is a text label of localization.
|
||||
type textLabel string
|
||||
|
||||
// locales is a map, where key is text label and value is translation.
|
||||
type locales map[textLabel]string
|
||||
// locales is a map, where key is a text label and the value is either a string
|
||||
// or an object.
|
||||
type locales map[textLabel]any
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
Reference in New Issue
Block a user