Skip to content

Commit 7be3ca4

Browse files
authored
Update german locale (LAION-AI#1166)
also: sort keys in json alphabetically change the way files are printed to be grouped by language. This will be spicy since we have many german speakers here.
1 parent 196cc0c commit 7be3ca4

7 files changed

Lines changed: 59 additions & 37 deletions

File tree

‎scripts/frontend-development/find-missing-locales.py‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from collections import defaultdict
12
from glob import glob
23
from json import load
34
from os import path
@@ -23,10 +24,10 @@ def get_missing(en_json, translation_json):
2324

2425
def print_result(missing, not_translated, file):
2526
if len(missing):
26-
print("[{0}] - missing: {1} {2}".format(path.basename(path.dirname(file)), path.basename(file), missing))
27+
print("[{0}] - {1}\tmissing: {2}".format(path.basename(path.dirname(file)), path.basename(file), missing))
2728
if len(not_translated):
2829
print(
29-
"[{0}] - potentially untranslated: {1} {2}".format(
30+
"[{0}] - {1}\tpotentially untranslated: {2}".format(
3031
path.basename(path.dirname(file)), path.basename(file), not_translated
3132
)
3233
)
@@ -35,14 +36,20 @@ def print_result(missing, not_translated, file):
3536
def audit(file, en_file):
3637
en_json = load(open(en_file))
3738
translation_json = load(open(file))
38-
print_result(get_missing(en_json, translation_json), get_not_translated(en_json, translation_json), file)
39+
return (get_missing(en_json, translation_json), get_not_translated(en_json, translation_json), file)
3940

4041

4142
def main():
43+
per_language_dict = defaultdict(list)
4244
for en_file in glob(path.join(DIR, EN_PATH)):
4345
for file in glob(path.join(DIR, ALL_PATH)):
4446
if path.basename(en_file) == path.basename(file) and file != en_file:
45-
audit(file, en_file)
47+
file_info = audit(file, en_file)
48+
lang = path.basename(path.dirname(file))
49+
per_language_dict[lang].append(file_info)
50+
for results in per_language_dict.values():
51+
list(map(lambda args: print_result(*args), results))
52+
print()
4653

4754

4855
if __name__ == "__main__":

‎website/public/locales/de/common.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,23 @@
44
"admin_dashboard": "Admin-Bereich",
55
"connect": "Kontakt aufnehmen",
66
"conversational": "Konversations-KI für alle.",
7+
"copied": "Kopiert",
8+
"dark_mode": "Dunkler Modus",
79
"dashboard": "Dashboard",
10+
"delete": "Löschen",
811
"discord": "Discord",
912
"docs": "Doku",
1013
"github": "GitHub",
1114
"legal": "Rechtliches",
15+
"light_mode": "Heller Modus",
1216
"loading": "Wird geladen...",
13-
"more_information": "Weiter Informationen",
17+
"more_information": "Weitere Informationen",
1418
"no": "Nein",
1519
"privacy_policy": "Datenschutz-Bestimmungen",
1620
"report_a_bug": "Einen Fehler melden",
1721
"sign_in": "Anmelden",
1822
"sign_out": "Abmelden",
23+
"success": "Erfolg",
1924
"terms_of_service": "Nutzungsbedingungen",
2025
"title": "Open Assistant",
2126
"yes": "Ja"
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
{
2-
"label_highlighted_yes_no_instruction": "Beantworten Sie die folgende(n) Frage(n) zu der markierten Nachricht:",
2+
"fails_task.question": "Ist es eine schlechte Antwort, wenn man die Aufgabe sieht?",
3+
"hate_speech": "Hassrede",
4+
"hate_speech.explanation": "Inhalt ist beleidigend oder bedrohlich und drückt Vorurteile gegen eine geschützte Eigenschaft aus. Vorurteil bezieht sich auf vorgefasste Meinungen, die nicht auf Vernunft beruhen. Zu den geschützten Merkmalen gehören Geschlecht, ethnische Zugehörigkeit, Religion, sexuelle Orientierung, und ähnliche Merkmale.",
35
"label_highlighted_flag_instruction": "Wählen Sie aus, was auf die markierte Nachricht zutrifft:",
46
"label_highlighted_likert_instruction": "Bewerten Sie die markierte Nachricht:",
5-
"label_message_yes_no_instruction": "Beantworten Sie die folgende(n) Frage(n) zur Nachricht:",
7+
"label_highlighted_yes_no_instruction": "Beantworten Sie die folgende(n) Frage(n) zu der markierten Nachricht:",
68
"label_message_flag_instruction": "Wählen Sie aus, was auf die Nachricht zutrifft:",
79
"label_message_likert_instruction": "Nachricht bewerten:",
8-
"spam.question": "Ist die Nachricht Spam?",
9-
"fails_task.question": "Ist es eine schlechte Antwort, wenn man die Aufgabe sieht?",
10+
"label_message_yes_no_instruction": "Beantworten Sie die folgende(n) Frage(n) zur Nachricht:",
11+
"lang_mismatch": "Sprachkonflikt",
12+
"lang_mismatch.explanation": "Nicht in der aktuell ausgewählten Sprache geschrieben.",
13+
"moral_judgement": "Moralisches Urteil",
14+
"moral_judgement.explanation": "Drückt ein moralisches Urteil aus.",
1015
"not_appropriate": "Nicht angemessen",
16+
"not_appropriate.explanation": "Nicht angemessen für einen Assistenten.",
1117
"pii": "Personenbezogene Daten",
12-
"hate_speech": "Hassrede",
13-
"sexual_content": "Sexueller Inhalt",
14-
"moral_judgement": "Moralisches Urteil",
18+
"pii.explanation": "Enthält personenbezogene Daten. Beispiele hierfür sind persönliche Kontaktdaten, Lizenz- und andere Identitätsnummern, sowie Bankdaten.",
1519
"political_content": "Politisch",
16-
"lang_mismatch": "Sprachkonflikt"
20+
"political_content.explanation": "Enthält politische Meinungen.",
21+
"sexual_content": "Sexueller Inhalt",
22+
"spam.question": "Ist die Nachricht Spam?"
1723
}
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
{
22
"daily": "Täglich",
3+
"label": "Labels",
34
"last_updated_at": "Zuletzt aktualisiert: {{val, datetime}}",
45
"leaderboard": "Bestenliste",
56
"monthly": "Monatlich",
7+
"next": "Nächste",
68
"overall": "Gesamt",
9+
"previous": "Vorherige",
10+
"prompt": "Prompts",
711
"rank": "Rang",
12+
"reply": "Antworten",
813
"score": "Punktzahl",
14+
"top_5_contributors_today": "Top 5 Benutzer heute",
915
"user": "Benutzer",
10-
"weekly": "Wöchentlich",
11-
"prompt": "Prompts",
12-
"reply": "Antworten",
13-
"label": "Labels"
16+
"view_all": "Alle anzeigen",
17+
"weekly": "Wöchentlich"
1418
}

‎website/public/locales/en/common.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"about": "About",
33
"account_settings": "Account",
44
"admin_dashboard": "Admin Dashboard",
5-
"copied": "Copied",
65
"connect": "Connect",
76
"conversational": "Conversational AI for everyone.",
7+
"copied": "Copied",
88
"dark_mode": "Dark Mode",
99
"dashboard": "Dashboard",
1010
"delete": "Delete",
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
2-
"label_highlighted_yes_no_instruction": "Answer the following question(s) about the highlighted message:",
2+
"fails_task.question": "Is it a bad reply, as an answer to the prompt task?",
3+
"hate_speech": "Hate Speech",
4+
"hate_speech.explanation": "Content is abusive or threatening and expresses prejudice against a protected characteristic. Prejudice refers to preconceived views not based on reason. Protected characteristics include gender, ethnicity, religion, sexual orientation, and similar characteristics.",
35
"label_highlighted_flag_instruction": "Select any that apply to the highlighted message:",
46
"label_highlighted_likert_instruction": "Rate the highlighted message:",
5-
"label_message_yes_no_instruction": "Answer the following question(s) about the message:",
7+
"label_highlighted_yes_no_instruction": "Answer the following question(s) about the highlighted message:",
68
"label_message_flag_instruction": "Select any that apply to the message:",
79
"label_message_likert_instruction": "Rate the message:",
8-
"spam.question": "Is the message spam?",
9-
"fails_task.question": "Is it a bad reply, as an answer to the prompt task?",
10+
"label_message_yes_no_instruction": "Answer the following question(s) about the message:",
11+
"lang_mismatch": "Wrong Language",
12+
"lang_mismatch.explanation": "Not written in the currently selected language.",
13+
"moral_judgement": "Judges Morality",
14+
"moral_judgement.explanation": "Expresses moral judgement.",
1015
"not_appropriate": "Not Appropriate",
1116
"not_appropriate.explanation": "Inappropriate for a customer assistant.",
1217
"pii": "Contains PII",
1318
"pii.explanation": "Contains personally identifying information. Examples include personal contact details, license and other identity numbers and banking details.",
14-
"hate_speech": "Hate Speech",
15-
"hate_speech.explanation": "Content is abusive or threatening and expresses prejudice against a protected characteristic. Prejudice refers to preconceived views not based on reason. Protected characteristics include gender, ethnicity, religion, sexual orientation, and similar characteristics.",
16-
"sexual_content": "Sexual Content",
17-
"sexual_content.explanation": "Contains sexual content.",
18-
"moral_judgement": "Judges Morality",
19-
"moral_judgement.explanation": "Expresses moral judgement.",
2019
"political_content": "Political",
2120
"political_content.explanation": "Expresses political views.",
22-
"lang_mismatch": "Wrong Language",
23-
"lang_mismatch.explanation": "Not written in the currently selected language."
21+
"sexual_content": "Sexual Content",
22+
"sexual_content.explanation": "Contains sexual content.",
23+
"spam.question": "Is the message spam?"
2424
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"daily": "Daily",
3+
"label": "Labels",
34
"last_updated_at": "Last updated at: {{val, datetime}}",
45
"leaderboard": "Leaderboard",
56
"monthly": "Monthly",
7+
"next": "Next",
68
"overall": "Overall",
9+
"previous": "Previous",
10+
"prompt": "Prompts",
711
"rank": "Rank",
12+
"reply": "Replies",
813
"score": "Score",
14+
"top_5_contributors_today": "Top 5 Contributors Today",
915
"user": "User",
10-
"weekly": "Weekly",
11-
"prompt": "Prompts",
12-
"reply": "Replies",
13-
"label": "Labels",
1416
"view_all": "View all",
15-
"top_5_contributors_today": "Top 5 Contributors Today",
16-
"previous": "Previous",
17-
"next": "Next"
17+
"weekly": "Weekly"
1818
}

0 commit comments

Comments
 (0)