Build & link checking edits for multiple languages

This commit is contained in:
mDuo13
2019-11-05 13:35:54 -08:00
parent 10570fc28b
commit 408ffeb9a2
2 changed files with 67 additions and 2 deletions

View File

@@ -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, <a href=\"#\">please contribute!</a>" #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, <a href=\"#\">please contribute!</a>" #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:

View File

@@ -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))