Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Add script to add new translation to everyfile

Cette révision appartient à :
tomleb 2017-05-11 12:26:16 -04:00
Parent 44d75f506d
révision ca9f8f28d6

12
translations/add_translation.sh Fichier exécutable
Voir le fichier

@ -0,0 +1,12 @@
#!/bin/bash
set -euo pipefail
id="$1"
translation="$2"
for file in *.json; do
head -n -2 "${file}" > "${file}.tmp"
echo -e " },\n {\n \"id\": \"${id}\",\n \"translation\": \"${translation}\"\n }\n]" >> "${file}.tmp"
mv "${file}.tmp" "${file}"
done