added update translations script (flavor by saily)
This commit is contained in:
parent
e2811ebd52
commit
96bf7ca002
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,6 +10,7 @@
|
|||||||
/local.cfg
|
/local.cfg
|
||||||
.coverage
|
.coverage
|
||||||
/*.egg-info
|
/*.egg-info
|
||||||
|
/*.egg
|
||||||
/.installed.cfg
|
/.installed.cfg
|
||||||
*.pyc
|
*.pyc
|
||||||
/.Python
|
/.Python
|
||||||
|
47
buildout.cfg
47
buildout.cfg
@ -6,6 +6,7 @@ parts +=
|
|||||||
mkrelease
|
mkrelease
|
||||||
pocompile
|
pocompile
|
||||||
code-analysis
|
code-analysis
|
||||||
|
update_translations
|
||||||
|
|
||||||
[mkrelease]
|
[mkrelease]
|
||||||
recipe = zc.recipe.egg
|
recipe = zc.recipe.egg
|
||||||
@ -30,3 +31,49 @@ plone.app.jquery = 1.8.3
|
|||||||
plone.app.testing = 4.2.4
|
plone.app.testing = 4.2.4
|
||||||
plone.app.vocabularies = 2.1.14
|
plone.app.vocabularies = 2.1.14
|
||||||
|
|
||||||
|
[babelpy]
|
||||||
|
recipe = zc.recipe.egg
|
||||||
|
eggs =
|
||||||
|
setuptools
|
||||||
|
Babel
|
||||||
|
lingua
|
||||||
|
interpreter = babelpy
|
||||||
|
|
||||||
|
[update_translations]
|
||||||
|
recipe = collective.recipe.template
|
||||||
|
output = ${buildout:directory}/bin/update_translations
|
||||||
|
input = inline:
|
||||||
|
#!/bin/bash
|
||||||
|
DOMAIN="plone"
|
||||||
|
BASE_PATH=${buildout:directory}/plone/app/discussion
|
||||||
|
# --- No modifications below ---
|
||||||
|
[[ -s $BASE_PATH/locales/$DOMAIN.pot ]] && \
|
||||||
|
cp $BASE_PATH/locales/$DOMAIN.pot $BASE_PATH/locales/$DOMAIN.1.pot
|
||||||
|
${buildout:directory}/bin/${babelpy:interpreter} \
|
||||||
|
${buildout:directory}/setup.py extract_messages \
|
||||||
|
-o $BASE_PATH/locales/$DOMAIN.pot
|
||||||
|
|
||||||
|
if [ ! -s $BASE_PATH/locales/$DOMAIN.pot ]; then
|
||||||
|
[[ -s $BASE_PATH/locales/$DOMAIN.1.pot ]] && \
|
||||||
|
mv $BASE_PATH/locales/$DOMAIN.1.pot $BASE_PATH/locales/$DOMAIN.pot
|
||||||
|
echo -e "\033[0;31mERROR\033[0m: Restored old .pot file due template errors."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
[[ -s $BASE_PATH/locales/$DOMAIN.1.pot ]] && \
|
||||||
|
rm $BASE_PATH/locales/$DOMAIN.1.pot
|
||||||
|
# sync all locales, create if they do not exist
|
||||||
|
for LANG in `find $BASE_PATH/locales -maxdepth 1 -mindepth 1 -type d \
|
||||||
|
| grep -v .svn \
|
||||||
|
| sed -e "s/.*locales\/\(.*\)$/\1/"`; do
|
||||||
|
if [ ! -f $BASE_PATH/locales/$LANG/LC_MESSAGES/$DOMAIN.po ]; then
|
||||||
|
echo -e "\033[0;32mINFO\033[0m: Create $BASE_PATH/locales/$LANG/LC_MESSAGES/$DOMAIN.po."
|
||||||
|
touch $BASE_PATH/locales/$LANG/LC_MESSAGES/$DOMAIN.po
|
||||||
|
fi
|
||||||
|
${buildout:directory}/bin/${babelpy:interpreter} \
|
||||||
|
${buildout:directory}/setup.py update_catalog \
|
||||||
|
-l $LANG -i $BASE_PATH/locales/$DOMAIN.pot \
|
||||||
|
-o $BASE_PATH/locales/$LANG/LC_MESSAGES/$DOMAIN.po
|
||||||
|
|
||||||
|
echo -e "\033[0;32mINFO ($LANG)\033[0m: $BASE_PATH/locales/$LANG/LC_MESSAGES/$DOMAIN.po synced."
|
||||||
|
done
|
||||||
|
mode = 755
|
15
setup.py
15
setup.py
@ -1,4 +1,8 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import dist
|
||||||
|
from setuptools import find_packages
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
dist.Distribution(dict(setup_requires='Babel'))
|
||||||
|
|
||||||
version = '2.3.2.dev0'
|
version = '2.3.2.dev0'
|
||||||
|
|
||||||
@ -54,6 +58,15 @@ setup(name='plone.app.discussion',
|
|||||||
'plone.app.contenttypes[test]',
|
'plone.app.contenttypes[test]',
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
message_extractors={
|
||||||
|
'src': [
|
||||||
|
('**.py', 'lingua_python', None),
|
||||||
|
('**.pt', 'lingua_xml', None),
|
||||||
|
('**.cpt', 'lingua_xml', None),
|
||||||
|
('**.zcml', 'lingua_xml', None),
|
||||||
|
('**.xml', 'lingua_xml', None),
|
||||||
|
],
|
||||||
|
},
|
||||||
entry_points="""
|
entry_points="""
|
||||||
[z3c.autoinclude.plugin]
|
[z3c.autoinclude.plugin]
|
||||||
target = plone
|
target = plone
|
||||||
|
Loading…
Reference in New Issue
Block a user