From 0d0f33769de7f5b0033c3d04a63f487c8513b597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20N=C3=BCsse?= Date: Sun, 28 Apr 2024 10:25:12 +0200 Subject: [PATCH] verify profanities --- .github/workflows/translations.yml | 11 ++++++++++- app/src/main/res/values-de/strings.xml | 2 ++ scripts/checkProfanity.py | 7 +++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index fe9cee30..4052b6b9 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -73,4 +73,13 @@ jobs: name: Translations path: | changed_texts.txt - translated_texts.txt \ No newline at end of file + translated_texts.txt + suspicious_texts.txt + - name: Fail if there are suspected profanities + run: | + if [ -s "suspicious_texts.txt" ]; then + echo "We found suspicious translations. Please check!" + exit 1 + fi + shell: sh + diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 01b39b0a..a073f999 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -470,4 +470,6 @@ Remote-Startpunkt Nächster Breadcrumb-Pfeil-Indikator Nächster Schritt + Du Dummkopf + Ficken! diff --git a/scripts/checkProfanity.py b/scripts/checkProfanity.py index 7c626310..a5e53279 100755 --- a/scripts/checkProfanity.py +++ b/scripts/checkProfanity.py @@ -5,8 +5,11 @@ import joblib +file = open("suspicious_texts.txt", "a") for line in sys.stdin: prediction = predict_prob([line.rstrip()]) - if prediction[0] < 0.5: + if prediction[0] > 0.5: + file.write(str(line.rstrip())+"\n") print(str(line.rstrip())) - exit(1) + +file.close() \ No newline at end of file