diff --git a/.twosky.json b/.twosky.json index 7a40c489259..e9658055df0 100644 --- a/.twosky.json +++ b/.twosky.json @@ -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": "العربية", diff --git a/scripts/README.md b/scripts/README.md index a06edb2119f..215eb1c5f39 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -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. diff --git a/scripts/translations/main.go b/scripts/translations/main.go index 71a272b9a0d..ce466c62aae 100644 --- a/scripts/translations/main.go +++ b/scripts/translations/main.go @@ -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()