aboutsummaryrefslogtreecommitdiff
path: root/subprojects/freeamo/src/main_functions
diff options
context:
space:
mode:
authordavid <public@beloved.name>2018-07-25 13:32:41 +0200
committerdavid <public@beloved.name>2018-07-25 13:32:41 +0200
commitb868025432f83cfe9ecd0e2a626cf312d2123fb1 (patch)
treed53853bb2859dcce2e430623042cf0ac65831f50 /subprojects/freeamo/src/main_functions
parent3085614b00f7efcd46da67d3a24d21a0f4c4ce94 (diff)
Updated FreeAMO
Diffstat (limited to 'subprojects/freeamo/src/main_functions')
-rw-r--r--subprojects/freeamo/src/main_functions21
1 files changed, 17 insertions, 4 deletions
diff --git a/subprojects/freeamo/src/main_functions b/subprojects/freeamo/src/main_functions
index 782f896..3eb673e 100644
--- a/subprojects/freeamo/src/main_functions
+++ b/subprojects/freeamo/src/main_functions
@@ -62,9 +62,22 @@ function line_status {
# Begin locale code
function locale_description {
+
+echo "####################"
tmp__enUS=$(jq ".results[$entry].$locale_description" "$file" | sed "s|-||;" | jq .enUS | sed "s|^\"||; s|\"$||;" )
tmp__enGB=$(jq ".results[$entry].$locale_description" "$file" | sed "s|-||;" | jq .enGB | sed "s|^\"||; s|\"$||;" )
+
+ tmp=$(jq ".results[$entry].$locale_description[]" "$file" | head -n 1 | sed "s|^\"||; s|\"$||;"); # Use the first avalible if English is not avaliable
+
+# 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__enUS" != "null" ]; then
if [ "$locale_description" == "name" ]; then
@@ -98,10 +111,8 @@ function locale_description {
fi
- else
+ elif [ "$tmp" != "null" ]; then
- tmp=$(jq ".results[$entry].$locale_description[]" "$file" | sed "s|-||;" | jq . | sed "s|^\"||; s|\"$||;"); # Use the first avalible summary if English is not avaliable
-
if [ "$locale_description" == "name" ]; then
name="$tmp";
@@ -115,9 +126,11 @@ function locale_description {
description="$tmp";
fi
-
fi
+
+echo "$name
+.results[$entry].$locale_description[] $file"
}