Last active
May 11, 2021 19:41
-
-
Save cedricbonhomme/4d0bc78bb9e2382156f88f33bf33cc05 to your computer and use it in GitHub Desktop.
check-translations.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Defore executing this script you must install curl and jq: | |
# sudo apt-get install curl jq | |
set -e | |
# database user: | |
USER="sqlmonarcuser" | |
# database password | |
PASSWORD="sqlmonarcuser" | |
LANGUAGE="EN" | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' # No Color | |
for object in assets threats vulnerabilities | |
do | |
echo -e "Missing translations for $RED$object$NC:" | |
mysql -u $USER -p$PASSWORD monarc_common -e "SELECT label1 FROM $object WHERE (label2 is null or label2 = '')" | sed -n '1!p' | while read line | |
do | |
if [ "$line" ] | |
then | |
echo $line; | |
fi | |
done | |
echo "" | |
done | |
echo "==============" | |
for object in themes measures rolf_risks rolf_tags objects_categories questions questions_choices models soacategory scales_impact_types | |
do | |
echo -e "Missing translations for $RED$object$NC:" | |
mysql -u $USER -p$PASSWORD monarc_common -e "SELECT label1 FROM $object WHERE (label2 is null or label2 = '')" | sed -n '1!p' | while read line | |
do | |
if [ "$line" ] | |
then | |
echo $line; | |
fi | |
done | |
echo "" | |
done | |
echo "==============" | |
for object in objects instances | |
do | |
echo -e "Missing translations for $RED$object$NC:" | |
mysql -u $USER -p$PASSWORD monarc_common -e "SELECT label1 FROM $object WHERE (label2 is null or label2 = '' or name2 is null or name2 = '')" | sed -n '1!p' | while read line | |
do | |
if [ "$line" ] | |
then | |
echo $line; | |
fi | |
done | |
echo "" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment