#166 Updated translation scripts
Closed 11 months ago by darknao. Opened 3 years ago by copperi.
fedora-web/ copperi/websites pot_handling  into  master

@@ -0,0 +1,2 @@ 

+ #!/usr/bin/env bash

+ pybabel compile -d translations 

\ No newline at end of file

@@ -1,7 +1,39 @@ 

  #!/usr/bin/env bash

- #pybabel extract -F ../babel.cfg -o getfedora.org.pot . ../partials/

- pybabel extract -F ../../babel.cfg -o getfedora.org.pot ../../partials ../../getfedora.org/site ../../getfedora.org/partials

+ CONFIGFILE=babel.cfg

+ COMMAND=(pybabel extract -F babel.cfg -o getfedora.org.pot partials getfedora.org/site getfedora.org/partials)

The build pipeline expects to find the pot file at the same location as the translations-source.sh and push-pot.sh scripts or it will fail.

+ # Command needs to be run from the directory containing babel.cfg for the proper output format

+ if test -f "$CONFIGFILE"; then

+     # Run the command given above

+     "${COMMAND[@]}"

+ else

+     # if running with "podman run " move to the directory containing babel.cfg

+     if test -f "../$CONFIGFILE"; then

+         cd ..

+         "${COMMAND[@]}"

+     # if running from the scripts directory move to the directory containing babel.cfg

+     elif test -f "../../$CONFIGFILE"; then

+         cd ../..

+         "${COMMAND[@]}"

+     # script is called from some other location than the supported ones.

+     else

+         echo

+         echo "  SCRIPT EXECUTION FAILED!"

+         echo

+         echo "  No $CONFIGFILE found."

+         echo

+         echo "    This script should be run from the directory containing $CONFIGFILE by running"

+         echo "    ./getfedora.org/scripts/translations-source.sh"

+         echo "    Alternatively it can be run from the scripts directory by running"

+         echo "    ./translations-source.sh"

+         echo

+         echo

+         exit 1

+     fi

+ fi

  echo

  echo

+ echo 'Note: Instructions below has not been tested due to missing access rights'

  echo 'If you have write access to https://pagure.io/fedora-web/translations, you may now run:'

- echo './scripts/push-pot.sh'

+ echo '.getfedora.org/scripts/push-pot.sh'

+ echo 

+ 

@@ -0,0 +1,3 @@ 

+ #!/usr/bin/env bash

+ pybabel update -i ../getfedora.org.pot -d translations

+ 

Updated scripts to align with the translation-flow.adoc instructions.

This is a pretty big change and I'm not familiar enough to sign off on it myself. I will point out that you have a file named combile instead of compile. That should definitely be corrected.

@jibecfed @codeblock @misc between the three of you, can you review these changes?

1 new commit added

  • renamed translations-combile-local.sh to translations-compile-local.sh
3 years ago

@bcotton Thanks for correction, names changed in relevant locations.

The build pipeline expects to find the pot file at the same location as the translations-source.sh and push-pot.sh scripts or it will fail.

Thanks for your contribution.
getfedora.org has been retired and replaced with the new fedoraproject.org.
I'm going to close this PR, but you're more than welcome to contribute to the new website: https://gitlab.com/fedora/websites-apps/fedora-websites/fedora-websites-3.0

Pull-Request has been closed by darknao

11 months ago