From 408ffeb9a20feb828c3377a53c7b4dc7f89a67ad Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Tue, 5 Nov 2019 13:35:54 -0800 Subject: [PATCH] Build & link checking edits for multiple languages --- dactyl-config.yml | 32 ++++++++++++++++++++++++++++ tool/all-target-link-checker.sh | 37 +++++++++++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/dactyl-config.yml b/dactyl-config.yml index 9a13a968f2..4bb62e7667 100644 --- a/dactyl-config.yml +++ b/dactyl-config.yml @@ -219,6 +219,20 @@ targets: blog: "Blog" search: "Search site with Google..." bc_home: "Home" + tl_banner: + head: "Sorry, this page is not available in your language." + body: "We are making an effort to offer the XRP Ledger Dev Portal in a variety of languages, but not all pages are available in all languages. If you'd like to help, please contribute!" #TODO: have a real link for contributing translations + pagetoc: "In this document" + footer: + ripple: + careers: "Ripple Careers" + github: "Ripple on GitHub" + xrp_resources: "XRP Resources" + license: "License" + to_top: + short: "Top" + long: "Jump to top of page" + github_edit: "Edit" # Data API target for porting changes to the README in the upstream repo # Intended for use in markdown (--md) mode. @@ -230,6 +244,24 @@ targets: no_cover: True link_re_subs: "([\\w-]+\\.html)": https://xrpl.org/\1 + strings: + blog: "Blog" + search: "Search site with Google..." + bc_home: "Home" + tl_banner: + head: "Sorry, this page is not available in your language." + body: "We are making an effort to offer the XRP Ledger Dev Portal in a variety of languages, but not all pages are available in all languages. If you'd like to help, please contribute!" #TODO: have a real link for contributing translations + pagetoc: "In this document" + footer: + ripple: + careers: "Ripple Careers" + github: "Ripple on GitHub" + xrp_resources: "XRP Resources" + license: "License" + to_top: + short: "Top" + long: "Jump to top of page" + github_edit: "Edit" pages: diff --git a/tool/all-target-link-checker.sh b/tool/all-target-link-checker.sh index 33cdcc1377..20a52e1502 100755 --- a/tool/all-target-link-checker.sh +++ b/tool/all-target-link-checker.sh @@ -1,5 +1,6 @@ #!/bin/bash mkdir -p out +rm -r out # Pass forward dactyl "vars" arg if provided if [ "$1" == "--vars" ] && [ -n "$2" ]; @@ -8,9 +9,41 @@ then shift 2 fi -targets=`dactyl_build -lq | awk '{print $1}'` linkerrors=0 builderrors=0 + +# Build language-based targets all together first +langs=(en ja) +for lang in ${langs[*]}; do + echo "=======================================" + echo "Building language: en" + + if [ "$lang" == "en" ]; then + if [ -n "$dactyl_vars" ]; then + dactyl_build -q -t "$lang" --vars "$dactyl_vars" + else + dactyl_build -q -t "$lang" + fi + else + if [ -n "$dactyl_vars" ]; then + dactyl_build -q -t "$lang" -o "out/$lang" --vars "$dactyl_vars" + else + dactyl_build -q -t "$lang" -o "out/$lang" + fi + fi + buildresult=$? + if [ $buildresult -ne 0 ]; then + builderrors=$(($buildresult + $builderrors)) + echo "Error building this target; link checker may miss things." + fi +done + +# Check language targets all at once +dactyl_link_checker -q "$@" +linkerrors=$(($? + $linkerrors)) + +# Build & check other targets individually afterwords +other_targets=`dactyl_build -lq | awk '/^(en|ja) / {next;} {print $1}'` while read -r line; do echo "" echo "=======================================" @@ -30,7 +63,7 @@ while read -r line; do builderrors=$(($buildresult + $builderrors)) echo "Error building this target; skipping link checker." fi -done <<< "$targets" +done <<< "$other_targets" totalerrors=$(($builderrors + $linkerrors))