From 12953784b27a37e05703af5adcf3794a4b7cd621 Mon Sep 17 00:00:00 2001 From: Darragh Elliott Date: Fri, 16 Aug 2024 10:29:36 +0200 Subject: [PATCH] A few fixes to translation pages, and fix previous build link --- .gitignore | 2 +- status.fsfe.org/fsfe.org/index.cgi | 2 +- status.fsfe.org/tools/translation-status.sh | 23 ++++++++++++--------- status.fsfe.org/translations/default.xsl | 1 + 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 225d7adea0..dc4eb80cf9 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,4 @@ tags/tagged-*.en.xhtml tags/.tags.??.xml ## Status dir stuff -status.fsfe.org/*/data/* +status.fsfe.org/*/data*/* diff --git a/status.fsfe.org/fsfe.org/index.cgi b/status.fsfe.org/fsfe.org/index.cgi index 232e7bc6e0..7cd6c4447d 100755 --- a/status.fsfe.org/fsfe.org/index.cgi +++ b/status.fsfe.org/fsfe.org/index.cgi @@ -84,7 +84,7 @@ $( t="${stat#status_}" t="${t%.html}" printf '%s - %s
' \ - "$stat" "$(timestamp "$t")" "$(sed -rn 's;^.*
Duration:
(.+)
.*$;\1;p;T;q' "$stat")" + "data/$stat" "$(timestamp "$t")" "$(sed -rn 's;^.*
Duration:
(.+)
.*$;\1;p;T;q' "$stat")" printf $'\n' done ) diff --git a/status.fsfe.org/tools/translation-status.sh b/status.fsfe.org/tools/translation-status.sh index 698ab17bfd..757504e1f2 100755 --- a/status.fsfe.org/tools/translation-status.sh +++ b/status.fsfe.org/tools/translation-status.sh @@ -20,13 +20,16 @@ REPO="$SCRIPT_DIR"/../.. readonly REPO OUT="${REPO}"/status.fsfe.org/translations/data readonly OUT +OUT_TMP="${REPO}"/status.fsfe.org/translations/data-tmp +readonly OUT_TMP cd "${REPO}" || exit 2 echo "Making required directories!" mkdir -p "$OUT" +mkdir -p "$OUT_TMP" -LOGFILE="${OUT}/log.txt" +LOGFILE="${OUT_TMP}/log.txt" langs="$( find ./global/languages -type f -printf "%f\n" | while read -r lang; do @@ -111,7 +114,7 @@ statuses="$( echo "Status Generated" | tee -a "$LOGFILE" echo "Generate language status overview" | tee -a "$LOGFILE" -cat >"${OUT}/langs.en.xml" <<-EOF +cat >"${OUT_TMP}/langs.en.xml" <<-EOF @@ -122,7 +125,7 @@ echo "$langs" | while read -r lang_short lang_long; do for i in {1..6}; do prio_counts["$i"]="" done - cat >>"${OUT}/langs.en.xml" <<-EOF + cat >>"${OUT_TMP}/langs.en.xml" <<-EOF ${prio_counts["1"]} ${prio_counts["2"]} @@ -130,7 +133,7 @@ echo "$langs" | while read -r lang_short lang_long; do EOF unset prio_counts done -cat >>"${OUT}/langs.en.xml" <<-EOF +cat >>"${OUT_TMP}/langs.en.xml" <<-EOF EOF echo "Finished Generating status overview" | tee -a "$LOGFILE" @@ -156,7 +159,7 @@ echo "$statuses" | while read -r lang_short lang_long page priority originaldate missing_texts["$index"]="${missing_texts["$index"]}"$'\n' done - cat >>"${OUT}/translations.$prevlang.xml" <<-EOF + cat >>"${OUT_TMP}/translations.$prevlang.xml" <<-EOF https://git.fsfe.org/FSFE/fsfe-website/src/branch/master/${texts_file} @@ -170,7 +173,7 @@ echo "$statuses" | while read -r lang_short lang_long page priority originaldate break fi fi - cat >"${OUT}/translations.$lang_short.xml" <<-EOF + cat >"${OUT_TMP}/translations.$lang_short.xml" <<-EOF @@ -181,11 +184,11 @@ echo "$statuses" | while read -r lang_short lang_long page priority originaldate fi if [[ "$priority" != "$prevprio" ]]; then if [[ "$prevprio" != "" ]]; then - cat >>"${OUT}/translations.$lang_short.xml" <<-EOF + cat >>"${OUT_TMP}/translations.$lang_short.xml" <<-EOF EOF fi - cat >>"${OUT}/translations.$lang_short.xml" <<-EOF + cat >>"${OUT_TMP}/translations.$lang_short.xml" <<-EOF EOF prevprio=$priority @@ -197,7 +200,7 @@ echo "$statuses" | while read -r lang_short lang_long page priority originaldate else new=false fi - cat >>"${OUT}/translations.$lang_short.xml" <<-EOF + cat >>"${OUT_TMP}/translations.$lang_short.xml" <<-EOF $page $orig @@ -211,5 +214,5 @@ echo "$statuses" | while read -r lang_short lang_long page priority originaldate done echo "Finished creating language pages" | tee -a "$LOGFILE" +rsync -avz --delete --remove-source-files "$OUT_TMP"/ "$OUT"/ echo "Finished !" -# rm "$LOGFILE" diff --git a/status.fsfe.org/translations/default.xsl b/status.fsfe.org/translations/default.xsl index a4ad606dca..9f7b1d684d 100644 --- a/status.fsfe.org/translations/default.xsl +++ b/status.fsfe.org/translations/default.xsl @@ -13,6 +13,7 @@ Priority 2 files in need of translation +