Last active
April 13, 2018 10:22
-
-
Save fabianmarz/852cc92125a5233e20b975cc0adcb761 to your computer and use it in GitHub Desktop.
Generate and move Drupal translation files to related folder via potx.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eux | |
CURRENT_DIR=${PWD} | |
NAME="$(basename $CURRENT_DIR)" | |
DOCROOT=$(drush dd) | |
FILEPATH=$(realpath --relative-to="$DOCROOT" "$CURRENT_DIR") | |
drush potx --api=8 --folder=$FILEPATH/* | |
mkdir -p ./translations | |
mv $DOCROOT/general.pot ./translations/$NAME.pot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script requires
$ composer require kgaut/potx && drush en potx
and must be executed from the folder where you want to add the translations to.The generated
general.pot
file coming frompotx
will automatically be moved and renamed to match the current module name (based on the folder name).