Skip to content

Commit eb8af55

Browse files
author
Stan van Rooy
committed
fix: remove duplicate keys & add workflow check
1 parent ca70834 commit eb8af55

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'Check all translation keys are unique'
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
check:
8+
name: 'Check duplicate keys'
9+
runs-on: ubuntu-20.04
10+
11+
defaults:
12+
run:
13+
shell: bash
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
with:
19+
token: '${{ secrets.GITHUB_TOKEN }}'
20+
21+
- name: Check
22+
run: |
23+
python3 ./scripts/test-duplicate-key.py ems_translations.csv
24+
python3 ./scripts/test-duplicate-key.py showroom_translations.csv
25+

ems_translations.csv

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,6 @@ Enable this setting to have absolute Feature sales prices for Sub-organizations.
811811
The conflict dialog opens up when there is a conflict in selected options when configuring a product in the "Order Entry" page. It enables the user to select different options, in order to resolve the conflict. If the dialog is disabled, the software automatically enables/disables certain options such that the selected option is enabled.;Het conflictvenster opent wanneer er een conflict is in geselecteerde opties bij het configureren van een product op de pagina "Order Entry". Het stelt de gebruiker in staat om verschillende opties te selecteren om het conflict op te lossen. Als het dialoogvenster is uitgeschakeld, schakelt de software automatisch bepaalde opties in/uit zodat de geselecteerde optie ingeschakeld is.;;;;;;;;;;
812812
Specify which locale should be used for users without locale settings;Geef aan welke locale gebruikt moet worden voor gebruikers zonder locale-instellingen.;;;;;;;;;;
813813
Account info;Account informatie;;Kontoinformation;;;;;;;;
814-
Upload an image of yourself, or change the e-mail adres which is used to login.;;;Laden Sie ein Bild von sich hoch oder ändern Sie die E-Mail-Adresse, die zum Einloggen verwendet wird.;;;;;;;;
815814
Change the password that is used to login into your account.;;;Ändern Sie das Passwort, das zum Einloggen in Ihr Konto verwendet wird.;;;;;;;;
816815
Change password;Wijzig wachtwoord;;Passwort ändern;;;;;;;;
817816
Current password;Huidig wachtwoord;;Aktuelles Passwort;;;;;;;;
@@ -826,7 +825,6 @@ The following permissions have been granted to your account:;;;Die folgenden Ber
826825
Past logins;;;Frühere Anmeldungen;;;;;;;;
827826
You have logged into your account from the following devices:;;;Sie haben sich von den folgenden Geräten aus in Ihr Konto eingeloggt:;;;;;;;;
828827
Delete account;;;Konto löschen;;;;;;;;
829-
This will delete your user account. Note that once your account is deleted, it cannot be restored.;;;Dies wird Ihr Benutzerkonto löschen. Beachten Sie, dass Ihr Konto nach dem Löschen nicht wiederhergestellt werden kann.;;;;;;;;
830828
Delete your account;;;Löschen Sie Ihr Konto;;;;;;;;
831829
Guides;Handleidingen;;Leitfäden;;;;;;;;
832830
Turn 'Getting Started' guides on/off;'Getting Started'-handleidingen in-/uitschakelen;;'Getting Started'-Leitfäden ein-/ausschalten;;;;;;;;
@@ -845,4 +843,4 @@ Here you can create your Configuration Models. Use Features as building blocks a
845843
Seach;Zoek;;;;;;;;;;
846844
Features are your smart building blocks. Create them here so you can use them in your Configuration Models;Feature zijn je slimme bouwstenen. Maak ze hier zodat je ze kunt gebruiken in je configuratie modellen;;;;;;;;;;
847845
Used in;Gebruikt in;;;;;;;;;;
848-
Edit/Delete;Aanpassen/verwijderen;;;;;;;;;;
846+
Edit/Delete;Aanpassen/verwijderen;;;;;;;;;;

scripts/test-duplicate-key.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import sys
2+
3+
translations = sys.argv[1]
4+
5+
with open(translations, 'r') as f:
6+
lines = f.readlines()
7+
8+
keys = set()
9+
for line_no, line in enumerate(lines, start=1):
10+
key = line.split(',')[0]
11+
if key in keys:
12+
print(f'Duplicate key found in line {line_no}: {key}')
13+
keys.add(key)

0 commit comments

Comments
 (0)