Skip to content

Commit

Permalink
Fix segmentation in 1-Index 2nd attempt (#976)
Browse files Browse the repository at this point in the history
* Update _config.yml

Make kramdown the markdown processor

* Update and rename 1-index.html to 1-index.md

* Update 1-index.md

* Update 1-de-index.html

* Rename 1-de-index.html to 1-de-index.md

* Update and rename 1-es-index.html to 1-es-index.md

* Update and rename 1-fr-index.html to 1-fr-index.md

* Update and rename 1-index.html to 1-index.md

* Update and rename 1-it-index.html to 1-it-index.md

* Update and rename 1-ko_KR-index.html to 1-ko_KR-index.md

* Update and rename 1-nb_NO-index.html to 1-nb_NO-index.md

* Update and rename 1-nl-index.html to 1-nl-index.md

* Update and rename 1-pt_BR-index.html to 1-pt_BR-index.md

* Update and rename 1-pt_PT-index.html to 1-pt_PT-index.md

* Update and rename 1-zh_CN-index.html to 1-zh_CN-index.md

* Fix segmentation in 1-Index

* Don't include processed .po files

* Correction

* Add comments

* Add comments

* Update _po4a-tools/po4a-update-templates.sh

Co-authored-by: Peter L Jones <pljones@users.noreply.github.com>

* Remove unneeded check

* AUTO: Updated .po files

---------

Co-authored-by: Peter L Jones <pljones@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 1, 2023
1 parent b1ad370 commit 25b09ac
Show file tree
Hide file tree
Showing 31 changed files with 590 additions and 1,625 deletions.
1 change: 0 additions & 1 deletion 1-de-index.html

This file was deleted.

1 change: 1 addition & 0 deletions 1-de-index.md
1 change: 0 additions & 1 deletion 1-es-index.html

This file was deleted.

1 change: 1 addition & 0 deletions 1-es-index.md
1 change: 0 additions & 1 deletion 1-fr-index.html

This file was deleted.

1 change: 1 addition & 0 deletions 1-fr-index.md
1 change: 0 additions & 1 deletion 1-index.html

This file was deleted.

1 change: 1 addition & 0 deletions 1-index.md
1 change: 0 additions & 1 deletion 1-it-index.html

This file was deleted.

1 change: 1 addition & 0 deletions 1-it-index.md
1 change: 0 additions & 1 deletion 1-ko_KR-index.html

This file was deleted.

1 change: 1 addition & 0 deletions 1-ko_KR-index.md
1 change: 0 additions & 1 deletion 1-nb_NO-index.html

This file was deleted.

1 change: 1 addition & 0 deletions 1-nb_NO-index.md
1 change: 0 additions & 1 deletion 1-nl-index.html

This file was deleted.

1 change: 1 addition & 0 deletions 1-nl-index.md
1 change: 0 additions & 1 deletion 1-pt_BR-index.html

This file was deleted.

1 change: 1 addition & 0 deletions 1-pt_BR-index.md
1 change: 0 additions & 1 deletion 1-pt_PT-index.html

This file was deleted.

1 change: 1 addition & 0 deletions 1-pt_PT-index.md
1 change: 0 additions & 1 deletion 1-zh_CN-index.html

This file was deleted.

1 change: 1 addition & 0 deletions 1-zh_CN-index.md
57 changes: 31 additions & 26 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.1)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0)
concurrent-ruby (1.1.10)
concurrent-ruby (1.2.2)
cssminify2 (2.0.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
execjs (2.8.1)
ffi (1.15.5)
execjs (2.9.1)
ffi (1.16.3)
forwardable-extended (2.6.0)
google-protobuf (3.24.4)
htmlcompressor (0.4.0)
http_parser.rb (0.8.0)
i18n (1.12.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jekyll (4.2.2)
jekyll (4.3.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (~> 3.0)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-minifier (0.1.10)
cssminify2 (~> 2.0)
htmlcompressor (~> 0.4)
Expand All @@ -40,40 +42,43 @@ GEM
uglifier (~> 4.1)
jekyll-paginate-v2 (3.0.0)
jekyll (>= 3.0, < 5.0)
jekyll-polyglot (1.5.1)
jekyll (>= 3.0)
jekyll-sass-converter (2.2.0)
sassc (> 2.0.1, < 3.0)
jekyll-polyglot (1.6.0)
jekyll (>= 4.0, >= 3.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-watch (2.2.1)
listen (~> 3.0)
json (2.6.2)
json (2.6.3)
json-minify (0.0.3)
json (> 0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.7.1)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.0)
public_suffix (5.0.3)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.30.0)
rexml (3.2.6)
rouge (4.1.3)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
sass-embedded (1.69.4)
google-protobuf (~> 3.23)
rake (>= 13.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.8.0)
unicode-display_width (2.5.0)
webrick (1.8.1)

PLATFORMS
ruby
Expand Down
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ default_lang: "en"
exclude_from_localization: ["assets", "images", "css", "README.md", "manifest.json", "humans.txt", "sitemap.xml", "robots.txt", "404.html", "CNAME", "LICENSE.md"]
parallel_localization: true
a_rootpage: "https://jamulus.io"
markdown: kramdown
kramdown:
input: GFM

# Jamulus release binary links
download_root_link: "https://github.com/jamulussoftware/jamulus/releases/download/r3_10_0/"
Expand Down
8 changes: 4 additions & 4 deletions _po4a-tools/po4a-add-language.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ echo Creating .po files for "$new_lang"
# Go to root directory
cd ../

# Create symlinks for 1-index.html file
ln -s -r ./wiki/$new_lang/1-index.html ./1-$new_lang-index.html
# Create symlinks for 1-index.md file
ln -s -r ./wiki/$new_lang/1-index.md ./1-$new_lang-index.md
if [ $(echo $?) == 0 ] ; then
echo ''
echo 1-"$new_lang"-index.html symlink created for "$new_lang" in /
echo 1-"$new_lang"-index.md symlink created for "$new_lang" in /
else
echo Error creating 1-"$new_lang"-index.html symlink in /
echo Error creating 1-"$new_lang"-index.md symlink in /
exit 1
fi

Expand Down
10 changes: 5 additions & 5 deletions _po4a-tools/po4a-create-all-targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ process_with_po4a () {
if [ $ext == yml ] ; then
FILE_FORMAT=yaml
OPTION="skip_array"
elif [ $ext == html ] ; then
elif [[ $ext == html || "$filename" == *'-index' ]] ; then # '-index.md' has a markdown extension but is actually html and should be processed as such by po4a
FILE_FORMAT=xml
OPTION="ontagerror=warn"
elif [ $ext == md ] ; then
Expand All @@ -128,11 +128,11 @@ process_with_po4a () {
echo "$filename.$ext" translated into "$lang"
fi

# Check if language is set correctly in '1-$lang-index.html'
# Check if language is set correctly in '1-$lang-index.md'
if [ $filename == '1-index' ] ; then
if ! grep -Fxq 'lang: "'$lang'"' "$WIKI_DIR/$lang/1-index.html" ; then
echo replacing incorrect language tag in 1-"$lang"-index.html;
sed -i '0,/lang: "[^"]*"/s/lang: "[^"]*"/lang: "'$lang'"/' "$WIKI_DIR/$lang/1-index.html"
if ! grep -Fxq 'lang: "'$lang'"' "$WIKI_DIR/$lang/1-index.md" ; then
echo replacing incorrect language tag in 1-"$lang"-index.md;
sed -i '0,/lang: "[^"]*"/s/lang: "[^"]*"/lang: "'$lang'"/' "$WIKI_DIR/$lang/1-index.md"
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion _po4a-tools/po4a-update-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ while IFS= read -r -d '' doc ; do
if [ $ext == yml ] ; then
FILE_FORMAT=yaml
OPTION="skip_array"
elif [ $ext == html ] ; then
elif [[ $ext == html || "$filename" == *'-index' ]] ; then # '-index.md' has a markdown extension but is actually html and should be processed as such by po4a
FILE_FORMAT=xml
OPTION="ontagerror=warn"
elif [ $ext == md ] ; then
Expand Down
Loading

0 comments on commit 25b09ac

Please sign in to comment.