mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Add scripts to help the i18n team extract and import stings (#2186)
This commit is contained in:
committed by
Mario Romano
parent
ca2ba3c5c7
commit
a8024bbdf5
26
scripts/import-langs.sh
Executable file
26
scripts/import-langs.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "No arguments supplied. You must provide path for the translations"
|
||||
exit;
|
||||
else
|
||||
LANG_ROOT=${1%/}
|
||||
fi
|
||||
|
||||
# Findn all JSON files
|
||||
FILES=(`find $LANG_ROOT -type f -name "*.json"`)
|
||||
|
||||
# Loop the individual components
|
||||
for FILE in "${FILES[@]}"
|
||||
do :
|
||||
|
||||
echo "Processing $FILE"
|
||||
# Match the language so we can get to the actual destination
|
||||
if [[ $FILE =~ /[A-Z0-0_-]+/(.+)$ ]] ; then
|
||||
|
||||
DEST=${BASH_REMATCH[1]} # Will contain the full file path
|
||||
echo "\tCopying $FILE to $DEST"
|
||||
`cp $FILE $DEST`
|
||||
fi
|
||||
echo "\n"
|
||||
done
|
Reference in New Issue
Block a user