From 4cb3a60a348b5362927bf5225d1c1367d461d401 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 26 Jul 2018 23:29:40 +0200 Subject: Imrpoved locatliztion variable names with underscore --- subprojects/freeamo/src/main_functions | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'subprojects/freeamo/src/main_functions') diff --git a/subprojects/freeamo/src/main_functions b/subprojects/freeamo/src/main_functions index 06ddad6..88de297 100644 --- a/subprojects/freeamo/src/main_functions +++ b/subprojects/freeamo/src/main_functions @@ -65,8 +65,8 @@ function do-locale { echo "####################" - tmp__enUS=$(jq ".results[$entry].$locale_description" "$file" | sed "s|-||;" | jq -r .enUS ) - tmp__enGB=$(jq ".results[$entry].$locale_description" "$file" | sed "s|-||;" | jq -r .enGB ) + tmp__en_US=$(jq ".results[$entry].$locale_description" "$file" | sed "s|en-US|en_US|" | jq -r .en_US ) + tmp__en_GB=$(jq ".results[$entry].$locale_description" "$file" | sed "s|en-GB|en_GB|" | jq -r .en_GB ) # Use the first avalible if English is not avaliable tmp=$(jq -r ".results[$entry].$locale_description[]" "$file" | head -n 1) || [[ $? == 141 ]] # jq causes superfluous 141 @@ -75,40 +75,40 @@ echo "####################" # if [ "$tmp" == "" ]; then # # # Some entries doesn't provide any `description` field but only a `summary` field. -# tmp=$(jq ".results[$entry].summary[]" "$file" | head -n 1 | sed "s|-||;"); +# tmp=$(jq ".results[$entry].summary[]" "$file" | head -n 1 | sed "s|-|_|"); # #fi - if [ "$tmp__enUS" != "null" ]; then + if [ "$tmp__en_US" != "null" ]; then if [ "$locale_description" == "name" ]; then - name="$tmp__enUS"; + name="$tmp__en_US"; elif [ "$locale_description" == "summary" ]; then - summary="$tmp__enUS"; + summary="$tmp__en_US"; elif [ "$locale_description" == "description" ]; then - description="$tmp__enUS"; + description="$tmp__en_US"; fi - elif [ "$tmp__enGB" != "null" ]; then + elif [ "$tmp__en_GB" != "null" ]; then if [ "$locale_description" == "name" ]; then - name="$tmp__enGB"; + name="$tmp__en_GB"; elif [ "$locale_description" == "summary" ]; then - summary="$tmp__enGB"; + summary="$tmp__en_GB"; elif [ "$locale_description" == "description" ]; then - description="$tmp__enGB"; + description="$tmp__en_GB"; fi @@ -163,7 +163,7 @@ function amo_variables() { function amo_variables__licenses { - license__amo_full_name="$(jq ".license.name" "$run_path/build/json/current_versions/$current_version__id.json" | sed "s|en-US|enUS|;" | jq -r .enUS)" + license__amo_full_name="$(jq ".license.name" "$run_path/build/json/current_versions/$current_version__id.json" | sed "s|en-US|en_US|;" | jq -r .en_US)" } -- cgit v1.2.3