Skip to content

Commit

Permalink
Adding chinese translation support to previews (jakartaee#297)
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Guindon <[email protected]>
  • Loading branch information
chrisguindon authored Dec 14, 2020
1 parent f32de87 commit e15e842
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
26 changes: 26 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,29 @@ for f in specifications/*/*/*/; do
done

echo "Done!"

echo -e "Step 6: Create missing language copies..."
LANGS=(zh)
FILES=`find ./specifications -type f -name "*.md"`
for F in $FILES; do
if [ -f "$F" ]; then
FILE_NAME=`basename $F`
EXTENSION=${FILE_NAME#**.}
for LANG in ${LANGS[@]}; do
## Skip non base-lang copies
if [[ "$EXTENSION" =~ .*"$LANG".* ]];then
continue 2
fi
done
REL_DIR=`dirname $F`
for LANG in ${LANGS[@]}; do
LANG_FILE="$REL_DIR/`basename $F .md`.$LANG.md"
if [ ! -f $LANG_FILE ]; then
echo "Creating langauge copy of $F in $LANG_FILE"
cp $F $LANG_FILE
fi
done
fi
done
echo "Done!"

8 changes: 4 additions & 4 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ publish = "website/public"
command = "./build.sh && cd website && npm run disallow_robots_txt && hugo --buildFuture"

[context.production.environment]
HUGO_VERSION = "0.54.0"
HUGO_VERSION = "0.76.5"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"

[context.split1]
command = "./build.sh && cd website && npm run disallow_robots_txt && hugo --buildFuture --enableGitInfo"

[context.split1.environment]
HUGO_VERSION = "0.54.0"
HUGO_VERSION = "0.76.5"
HUGO_ENV = "production"

[context.deploy-preview]
command = "./build.sh && cd website && npm run disallow_robots_txt && hugo --buildFuture -b $DEPLOY_PRIME_URL"

[context.deploy-preview.environment]
HUGO_VERSION = "0.54.0"
HUGO_VERSION = "0.76.5"

[context.branch-deploy]
command = "./build.sh && cd website && npm run disallow_robots_txt && hugo --buildFuture -b $DEPLOY_PRIME_URL"

[context.branch-deploy.environment]
HUGO_VERSION = "0.54.0"
HUGO_VERSION = "0.76.5"

[context.next.environment]
HUGO_ENABLEGITINFO = "true"

0 comments on commit e15e842

Please sign in to comment.