Created
October 19, 2012 15:11
-
-
Save oscarfonts/3918745 to your computer and use it in GitHub Desktop.
Generate Transifex resources from GeoServer source
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
host="https://www.transifex.com" | |
project_slug="geoserver_test" | |
propfile_orig="GeoServerApplication.properties" | |
propfile_trans="GeoServerApplication_<lang>.properties" | |
tx init --host $host | |
echo "type = PROPERTIES" >> .tx/config | |
find . -name $propfile_orig | while read -r source_file; do | |
if [[ $source_file =~ \./(maven/archetype/webPlugin/src/main/resources/)?((.*)/src/main/(resources|java))/$propfile_orig ]]; then | |
resource_slug=`echo ${BASH_REMATCH[3]} | sed 's/\//_/g'` | |
file_filter="${BASH_REMATCH[1]}${BASH_REMATCH[2]}/$propfile_trans" | |
tx set --auto-local -r $project_slug.$resource_slug "$file_filter" --source-lang en --source-file $source_file --execute | |
fi | |
done | |
echo "---" | |
echo "Transifex initialized for the repo: $host/projects/p/$project_slug/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment