summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2016-02-02 05:37:33 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2016-02-02 05:37:33 +0100
commitc53e3264f560d9e71145ffe94022175b8018277a (patch)
tree8a0faa89328a3e27efd23d5d9d18f8f7b54377a0
parent57a46e1e5c5aa9d10f35c85516ad877e6d744309 (diff)
downloadextbase-generator-cli-c53e3264f560d9e71145ffe94022175b8018277a.tar.gz
extbase-generator-cli-c53e3264f560d9e71145ffe94022175b8018277a.tar.bz2
extbase-generator-cli-c53e3264f560d9e71145ffe94022175b8018277a.zip
add model: Create the language files, if not available
-rwxr-xr-xadd_extbase_model.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/add_extbase_model.sh b/add_extbase_model.sh
index 4dc9da1..0a849f5 100755
--- a/add_extbase_model.sh
+++ b/add_extbase_model.sh
@@ -93,12 +93,11 @@ cat >> ext_tables.php << EOL
EOL
-sed -i "s/.*<\/body>/\t\t\t<trans-unit id=\"${tablename}\">\n\t\t\t\t<source>${model}<\/source>\n\t\t\t<\/trans-unit>\n&/" \
- Resources/Private/Language/locallang.xlf \
- Resources/Private/Language/locallang_db.xlf
-
date=`date "+%Y-%m-%dT%H:%I:%SZ"`
-cat > ${locallang_csh_file} << EOL
+for f in Resources/Private/Language/locallang.xlf Resources/Private/Language/locallang_db.xlf ${locallang_csh_file}
+do
+ if [ ! -e $f ]; then
+ cat > $f << EOL
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="${date}" product-name="${extension}">
@@ -108,6 +107,12 @@ cat > ${locallang_csh_file} << EOL
</file>
</xliff>
EOL
+ fi
+done
+
+sed -i "s/.*<\/body>/\t\t\t<trans-unit id=\"${tablename}\">\n\t\t\t\t<source>${model}<\/source>\n\t\t\t<\/trans-unit>\n&/" \
+ Resources/Private/Language/locallang.xlf \
+ Resources/Private/Language/locallang_db.xlf
cat > ${tca_file} << EOL