-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update po4a scripts for better markdown support #873
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
if [[ "$CACHE_HIT" == 'true' ]] ; then | ||
sudo cp --force --recursive ~/po4a/* / | ||
else | ||
sudo apt install -yq gettext libsgmls-perl libyaml-tiny-perl opensp | ||
wget -O po4a.deb https://github.com/jamulussoftware/assets/raw/main/po4a/po4a_0.66.deb | ||
sudo apt install -yq gettext libsgmls-perl libyaml-tiny-perl opensp libsyntax-keyword-try-perl | ||
wget -O po4a.deb https://github.com/jamulussoftware/assets/raw/main/po4a/po4a_0.68.deb | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please upload the deb? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's in a PR in the assets repo. As I said in the description, I think #870 should be merged first, then the PR in assets, then this one. If I upload it now, the workflows won't find it. |
||
sudo dpkg -i po4a.deb | ||
|
||
if [ -f po4a.deb ] ; then | ||
|
@@ -16,7 +16,7 @@ fi | |
|
||
mkdir -p ~/po4a | ||
|
||
for dep in po4a libcroco3 libosp5 sgml-base gettext libsgmls-perl libyaml-tiny-perl opensp; do | ||
for dep in po4a libcroco3 libosp5 sgml-base gettext libsgmls-perl libyaml-tiny-perl opensp libsyntax-keyword-try-perl; do | ||
dpkg -L $dep | while IFS= read -r f; do if test -f $f; then echo $f; fi; done | xargs cp --parents --target-directory ~/po4a/ | ||
done | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,10 +102,13 @@ process_with_po4a () { | |
# Determine file format to be used | ||
if [ $ext == yml ] ; then | ||
FILE_FORMAT=yaml | ||
OPTION="skip_array" | ||
elif [ $ext == html ] ; then | ||
FILE_FORMAT=xml | ||
OPTION="ontagerror=warn" | ||
elif [ $ext == md ] ; then | ||
FILE_FORMAT=asciidoc | ||
FILE_FORMAT=text | ||
OPTION="markdown" | ||
fi | ||
|
||
# Run po4a-translate and create target files | ||
|
@@ -116,6 +119,8 @@ process_with_po4a () { | |
--po "$PO_DIR/$lang/${filename}.po" \ | ||
--localized "$targ_doc" \ | ||
--localized-charset "UTF-8" \ | ||
--no-deprecation \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to prevent a stream of warning messages - we use po4a in a way that is considered deprecated, but which actually works better for our workflow - we want separation between .po file updates and their processing into translated files. The 'updated' way of using po4a combines both steps, which we don't want. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. But will we need to change the behaviour any time soon? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not that I know of. In reality the "updated" way to use po4a is just an automated combined use of the scripts that we use separately. |
||
--option "$OPTION" \ | ||
--keep "$THRESHOLD" | ||
|
||
# Display message if translated file is created | ||
|
@@ -134,6 +139,3 @@ while IFS= read -r -d '' dir ; do | |
echo "$lang": | ||
process_with_po4a "$lang" | ||
done < <(find "$PO_DIR" -mindepth 1 -maxdepth 1 -type d -print0) | ||
|
||
# Produce a file with translation status of all .po files | ||
source ./po4a-stats.sh |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use a hash like in the main repo to make the key unique
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, I had a look but don't have a clue how that works...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache hasn't been used for a week, which means that any workflow run should now trigger the creation of a new one. So I could leave the key here as "po4a" and merge the new po4a version in the assets repo now. Does that sound ok @ann0see?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ${{ hashFiles('file1, 'file2') }}... Will open an issue for that soon.