Switch locale marker to locale_with_underscore

Zanata 3.7.1 has moved much of the locale logic to the server, which
means we can no longer make use of client side transforms, such as
map-from, so set the locale to locale_with_underscore so dashes are
replaced with underscores.

Change-Id: I0bde5b84388f2be39c85600870ec530e8b5c07a5
This commit is contained in:
Steve Kowalik 2015-08-20 13:39:11 +10:00
parent eeb2a9bdc6
commit 770b73d35e
2 changed files with 7 additions and 5 deletions

View File

@ -91,9 +91,9 @@ function setup_horizon {
# zanata.xml file.
if ! /usr/local/jenkins/slave_scripts/create-zanata-xml.py -p $project \
-v master --srcdir . --txdir . -r 'horizon/*.pot' \
'horizon/locale/{locale}/LC_MESSAGES}/{filename}.po' \
'horizon/locale/{locale_with_underscore}/LC_MESSAGES}/{filename}.po' \
-r 'openstack_dashboard/*.pot' \
'openstack_dashboard/locale/{locale}/LC_MESSAGES/{filename}.po' \
'openstack_dashboard/locale/{locale_with_underscore}/LC_MESSAGES/{filename}.po' \
-e '.*/**' -f zanata.xml; then
echo "Failed to generate zanata.xml"
fi
@ -170,7 +170,7 @@ function setup_manuals {
--source-file ${DocFolder}/${DOCNAME}/source/locale/${DOCNAME}.pot \
--minimum-perc=$PERC \
-t PO --execute
ZANATA_RULES="$ZANATA_RULES -r ${DocFolder}/${DOCNAME}/source/locale/${DOCNAME}.pot ${DocFolder}/${DOCNAME}/source/locale/{locale}/LC_MESSAGES/${DOCNAME}.po"
ZANATA_RULES="$ZANATA_RULES -r ${DocFolder}/${DOCNAME}/source/locale/${DOCNAME}.pot ${DocFolder}/${DOCNAME}/source/locale/{locale_with_underscore}/LC_MESSAGES/${DOCNAME}.po"
else
# Update the .pot file
./tools/generatepot ${DOCNAME}
@ -188,7 +188,7 @@ function setup_manuals {
--source-file ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot \
--minimum-perc=$PERC \
-t PO --execute
ZANATA_RULES="$ZANATA_RULES -r ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot ${DocFolder}/${DOCNAME}/locale/{locale}.po"
ZANATA_RULES="$ZANATA_RULES -r ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot ${DocFolder}/${DOCNAME}/locale/{locale_with_underscore}.po"
fi
fi
done

View File

@ -39,7 +39,9 @@ def get_args():
def main():
args = get_args()
rules = args.rule or [('**/*.pot', '{locale}/LC_MESSAGES/{filename}.po')]
default_rule = ('**/*.pot',
'{locale_with_underscore}/LC_MESSAGES/{filename}.po')
rules = args.rule or [default_rule]
try:
zc = IniConfig(os.path.expanduser('~/.config/zanata.ini'))
ProjectConfig(zc, args.file, rules, project=args.project,