From 70315f1f07fe669f4b78c5d73192234a90f55f47 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 27 Jul 2018 15:25:06 +0200 Subject: FreeAMO: Evaluate and from the localization function --- subprojects/freeamo/src/main_functions | 44 ++++++++++++++++++++++++---------- 1 file changed, 32 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 88de297..789b348 100644 --- a/subprojects/freeamo/src/main_functions +++ b/subprojects/freeamo/src/main_functions @@ -16,7 +16,7 @@ # along with this program. If not, see . function latest_debranded_trisquel_version { - + # All debranded programs starts with "i" so all of them are in Trisquels "/i/" directory wget -qO- "http://archive.trisquel.info/trisquel/pool/main/i/$debranded_package/?C=N;O=D" | sed "s|\"|\\n|g; s|-|\\n|g" | grep "$debranded_package"_ | head -n 1 | sed "s|"$debranded_package"_||" @@ -70,14 +70,6 @@ echo "####################" # 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 - -# David will work on this later -# 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|-|_|"); -# -#fi if [ "$tmp__en_US" != "null" ]; then @@ -92,7 +84,15 @@ echo "####################" elif [ "$locale_description" == "description" ]; then description="$tmp__en_US"; + + elif [ "$locale_description" == "homepage" ]; then + homepage="$tmp__en_US"; + + elif [ "$locale_description" == "support_url" ]; then + + support_url="$tmp__en_US"; + fi @@ -109,6 +109,14 @@ echo "####################" elif [ "$locale_description" == "description" ]; then description="$tmp__en_GB"; + + elif [ "$locale_description" == "homepage" ]; then + + homepage="$tmp__en_GB"; + + elif [ "$locale_description" == "support_url" ]; then + + support_url="$tmp__en_GB"; fi @@ -125,14 +133,26 @@ echo "####################" elif [ "$locale_description" == "description" ]; then description="$tmp"; + + elif [ "$locale_description" == "homepage" ]; then + + homepage="$tmp"; + + elif [ "$locale_description" == "support_url" ]; then + + support_url="$tmp"; fi fi - -echo "$name -.results[$entry].$locale_description[] $file" + # Use summary if description is not provided + if [ "$description" == "" ]; then + + description="$summary" + + fi + } # End locale code -- cgit v1.2.3