Skip to content

Commit

Permalink
correct rendering translated webpages
Browse files Browse the repository at this point in the history
  • Loading branch information
TomKellyGenetics committed Aug 14, 2020
1 parent 67079f6 commit e8e5ac3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ if [[ $create == true ]]; then
git submodule add [email protected]:${git_user}/${repo}

echo "update local submodules"
git submodule update -f --recursive --merge $repo
git submodule update -f --recursive $repo

#remove _locale directory (only translate English lessons)
for dir in `git submodule | grep "^+" | cut -d" " -f2`
Expand Down Expand Up @@ -435,11 +435,12 @@ if [[ $render == true ]]; then

#move to external repo
mkdir -p ../${repo}-ja
rsync -ru _locale/ja/${repo}/* ../${repo}-ja
rsync -ru locale/ja/${repo}/* ../${repo}-ja

#add update lessons to remote
cd ../${repo}-ja
git init
git remote remove swc-ja
remotes=`git remote | grep "swc-ja" | wc -l`
if [[ remotes -le 0 ]]; then
git remote add swc-ja https://github.com/$remote_user/$repo-ja.git
Expand All @@ -459,7 +460,7 @@ if [[ $render == true ]]; then
# restore to version from remote
git submodule update -f --recursive
# import changes from org repo
git submodule foreach 'case $name in po4gitbook) ;; *) git pull -f swc-ja gh-pages ;; esac'
git submodule foreach 'case $name in po4gitbook) ;; *) git checkout gh-pages; git pull -f swc-ja gh-pages ;; esac'

#restore _locale lessons (only English lessons translated)
for dir in `git submodule | grep "^+" | cut -d" " -f2`
Expand All @@ -468,7 +469,11 @@ if [[ $render == true ]]; then
then
cd $dir
git checkout gh-pages
git reset --hard
remotes=`git remote | grep "swc-ja" | wc -l`
if [[ remotes -le 0 ]]; then
git remote add swc-ja https://github.com/$remote_user/$repo-ja.git
fi
git pull swc-ja gh-pages
cd ..
fi
done
Expand Down

0 comments on commit e8e5ac3

Please sign in to comment.