]> Untitled Git - lemmy-ui.git/commitdiff
Add check for unused languages in update_translations.sh
authorFelix Ableitner <me@nutomic.com>
Wed, 21 Apr 2021 11:55:17 +0000 (13:55 +0200)
committerFelix Ableitner <me@nutomic.com>
Wed, 21 Apr 2021 11:55:17 +0000 (13:55 +0200)
lemmy-translations
src/shared/i18next.ts
update_translations.sh

index f36cf2332878286378303d0ce9629728b3889ac9..764d35d913453d1fd8eeec6007f0d94f59c8b0ee 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f36cf2332878286378303d0ce9629728b3889ac9
+Subproject commit 764d35d913453d1fd8eeec6007f0d94f59c8b0ee
index 60edeb4c74b787e802d3bf22ffdf35c2402aeb47..0bb85aea7853a5dc7f8d671030a711cb219649b6 100644 (file)
@@ -33,6 +33,8 @@ import { oc } from "./translations/oc";
 import { hr } from "./translations/hr";
 import { th } from "./translations/th";
 import { bg } from "./translations/bg";
+import { ar } from "./translations/ar";
+import { ko } from "./translations/ko";
 
 // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
 const resources = {
@@ -69,6 +71,8 @@ const resources = {
   hr,
   th,
   bg,
+  ar,
+  ko
 };
 
 function format(value: any, format: any): any {
index cb19834b617fd761d498d6860b97d6fe3416ce22..c5cc1b4e55dada5323f474c4e732c90a3a54c7a8 100755 (executable)
@@ -1,9 +1,18 @@
 #!/bin/bash
-pushd ../lemmy-translations
+pushd ../lemmy-translations || exit
 git fetch weblate
 git merge weblate/main
 git push
-popd
+popd || exit
+
+# look for unused translations
+for langfile in lemmy-translations/translations/*.json; do
+    lang=$(basename $langfile .json)
+    if ! grep -q "\"./translations/$lang\"" src/shared/i18next.ts; then
+      echo "Unused language $lang"
+    fi
+done
+
 git submodule update --remote
 git add lemmy-translations
 git commit -m"Updating translations."