1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-02-03 13:11:21 +02:00

Add check_locale.sh and update travis.yml to detect missing keys, deleted english values in locale/de/

This commit is contained in:
Valansch 2019-03-02 21:59:28 +01:00 committed by plague006
parent 55aa7fd916
commit b7912a5fa8
4 changed files with 41 additions and 19 deletions

View File

@ -16,6 +16,7 @@ install:
script:
- "if [[ $TRAVIS_EVENT_TYPE != 'cron' && $TRAVIS_EVENT_TYPE != 'api' ]]; then luacheck .; fi"
before_deploy:
- ./.travis/check_locale.sh
- git config --local user.name "$github_user_name"
- git config --local user.email "$github_user_email"
- DATE_FORMATTED=$(date +'%Y-%m-%d')

40
.travis/check_locale.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/sh
cd ~/build/Refactorio/RedMew/locale/ || exit
echo "Changing working directory to: "
pwd
ldiff() {
while read file; do
cat en/$file | sed 's/=.*//' | sed '/^#/ d' >diff_file.tmp
count=$(cat "$1/$file" | sed 's/=.*//' | sed '/^#/ d' | git --no-pager diff --no-index -- diff_file.tmp - | tail -n +6 | grep -o '\-.*' | sed '/^-$/d' | wc -l)
if [ "$count" -ne 0 ]; then
echo
echo "locale/$1/$file: ($count differences)"
echo "------------------------------"
cat "$1/$file" | sed 's/=.*//' | sed '/^#/ d' | git --no-pager diff --no-index -- diff_file.tmp - | tail -n +6 | grep -o '\-.*' | sed '/^-$/d' | sed 's/^-//'
echo "------------------------------"
rm diff_file.tmp
fi
done
}
echo "##############################"
echo" Checking locale for misplaced/missing keys."
for dir in *; do
if [ "$dir" != "en" ]; then
ls en | ldiff $dir
fi
done
echo
echo "Done checking locale"
echo "##############################"
cd ../../../
echo "Changing working directory back to: "
pwd

View File

@ -1,7 +1,5 @@
# This file holds all the locale strings for command help and descriptions
[command_description]
tp=If blank, teleport to selected entity. mode = toggle tp mode where you can teleport to a placed ghost. player = teleport to player.
[command_custom_help]
tp=<blank|mode|player> 3 different uses: "/tp" to tp to selected entity. "/tp mode" to toggle tp mode. "/tp Newcott" to tp to Newcott.

View File

@ -1,25 +1,8 @@
[command]
help_text_format=__1__ __2__ __3__
log_entry=__1__(Map time: __2__) [__3__ Command] __4__, used: __5__ __6__
required_rank= (Rang __1__ oder höher benötigt.)
donator_only=(Donator only)
server_only=(Server only)
undocumented_command=[Undocumented command]
not_allowed_by_server=The command '__1__' is not allowed to be executed by the server.
not_allowed_by_players=The command '__1__' is not allowed to be executed by players.
higher_rank_needed=Du brauchst Rang __2__ oder höher um den Befehl __1__ auszuführen.
not_allowed_by_non_donators=The command '__1__' is only allowed for donators.
fail_missing_argument=Argument "__1__" from command __2__ is missing.
warn_player_of_error=There was an error running __1__, it has been logged.
failed_command=Sorry there was an error running __1__
warn_deprecated_command=Warning! Usage of the command "/__1__" is deprecated. Please use "/__2__" instead.
error_bad_option=The following options were given to the command '__1__' but are invalid: __2__
error_no_player_no_server=The command '__1__' is not allowed by the server nor player, please enable at least one of them.
error_while_running_debug=__1__ triggered an error running a command and has been logged: '__2__' with arguments __3__
error_log=Error while running '__1__' with arguments __2__: __3__
[utils_core]
print_admins=__1__(ADMIN) __2__: __3__