aboutsummaryrefslogtreecommitdiff
path: root/subprojects/freeamo/src
diff options
context:
space:
mode:
authordavid <public@beloved.name>2018-07-26 23:29:40 +0200
committerdavid <public@beloved.name>2018-07-26 23:29:40 +0200
commit4cb3a60a348b5362927bf5225d1c1367d461d401 (patch)
tree2d354edadc04e0e6812f18b4e6363faa198beb64 /subprojects/freeamo/src
parent931df51d9354e0c67e7329096de86411270a5db7 (diff)
Imrpoved locatliztion variable names with underscore
Diffstat (limited to 'subprojects/freeamo/src')
-rw-r--r--subprojects/freeamo/src/get-licenses2
-rw-r--r--subprojects/freeamo/src/main_functions24
-rw-r--r--subprojects/freeamo/src/make-wiki4
-rw-r--r--subprojects/freeamo/src/unmaintained/bad_names10
4 files changed, 14 insertions, 26 deletions
diff --git a/subprojects/freeamo/src/get-licenses b/subprojects/freeamo/src/get-licenses
index 6f43518..7e587b4 100644
--- a/subprojects/freeamo/src/get-licenses
+++ b/subprojects/freeamo/src/get-licenses
@@ -101,8 +101,6 @@ function get-licenses--filter {
source "$run_path/src/main_functions"
amo_variables
amo_variables__licenses
-
- # license="$(jq ".license.name" "$run_path/build/json/current_versions/$current_version__id.json" | sed "s|en-US|enUS|;" | jq -r .enUS )"
# echo "$run_path/build/json/current_versions/$(jq ".results[$entry].current_version.id" "$file")"
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)"
}
diff --git a/subprojects/freeamo/src/make-wiki b/subprojects/freeamo/src/make-wiki
index 3b7019b..784a7a4 100644
--- a/subprojects/freeamo/src/make-wiki
+++ b/subprojects/freeamo/src/make-wiki
@@ -83,7 +83,7 @@ while IFS= read -r table; do
# End description code
# The homepage field is mandatory so let's remove "null" from it because we don't need to evaluat it
- homepage_url=$(jq .results[$entry].homepage "$file" | sed "s|en-US|enUS|;" | jq -r .enUS | sed "s|null||");
+ homepage_url=$(jq .results[$entry].homepage "$file" | sed "s|en-US|en_US|;" | jq -r .en_US | sed "s|null||");
license_copyright=$(jq -r .results[$entry].authors[].name "$file" );
bayesian_average=$(jq .results[$entry].ratings.bayesian_average "$file");
bayesian_average__simple=$(printf "%.1f" "${bayesian_average//./,}");
@@ -137,7 +137,7 @@ while IFS= read -r table; do
fi
- support_url=$(jq .results[$entry].support_url "$file" | sed "s|en-US|enUS|;" | jq -r .enUS);
+ support_url=$(jq .results[$entry].support_url "$file" | sed "s|en-US|en_US|;" | jq -r .en_US);
last_updated=$(jq -r .results[$entry].last_updated $file | sed "s|T|\n|" | head -n 1 | sed "s|-|/|g");
# List JSON structure: cat json/$file | js '.'
diff --git a/subprojects/freeamo/src/unmaintained/bad_names b/subprojects/freeamo/src/unmaintained/bad_names
index c55cb34..d919a00 100644
--- a/subprojects/freeamo/src/unmaintained/bad_names
+++ b/subprojects/freeamo/src/unmaintained/bad_names
@@ -1,15 +1,5 @@
-
-
function search-pages--filter__bad_names() {
-name=$(jq .results[$entry].name "$run_path/build/json/$file" | sed "s|en-US|enUS|;" | jq -r .enUS);
-
-if [ "$name" == "null" ]; then
-
-name=$(jq .results[$entry].name "$run_path/build/json/$file" | sed "s|en-GB|enGB|;" | jq -r .enGB);
-
-fi
-
# The API `name` parameter makes bad MediaWiki URL's - https://github.com/mozilla/addons-server/issues/8790
# Clean titles. Example of bad titles: "Ghostery – Privacy Ad Blocker"