Last active
August 29, 2015 14:16
-
-
Save mRoca/4a6e09277fe8335db2f0 to your computer and use it in GitHub Desktop.
xliff ids generator
This file contains hidden or 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
| <trans-unit id="([\w\.]*)">(\s*)<source>([\w\.]*)</source> | |
| <trans-unit id="$3">$2<source>$3</source> |
This file contains hidden or 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/sh | |
| # Add trans-unit ids in xliff files | |
| # Usage : xliffid.sh myfile.xliff | |
| awk '$0 = /<trans-unit id=".*">/ ? " <trans-unit id=\""++increment"\">" : $0' $1 > /tmp/xlifftmp | |
| mv /tmp/xlifftmp $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment