Translations: Refaktor
Create extract_messages function that can be used by both python and django_openstack_auth repositories. This enables the extra keywords for django_openstack_auth as well. Change-Id: Ica998700215db5a0eae6aa88f4462ae416af2bdd
This commit is contained in:
parent
4dc0ca560e
commit
56ccfa16cf
@ -213,16 +213,21 @@ function setup_loglevel_vars {
|
||||
LKEYWORD['critical']='_LC'
|
||||
}
|
||||
|
||||
|
||||
# Run extract_messages for user visible messages and log messages.
|
||||
# Needs variables setup via setup_loglevel_vars.
|
||||
function extract_messages_log {
|
||||
project=$1
|
||||
# Run extract_messages for user visible messages.
|
||||
function extract_messages {
|
||||
|
||||
# Update the .pot files
|
||||
# The "_C" and "_P" prefix are for more-gettext-support blueprint,
|
||||
# "_C" for message with context, "_P" for plural form message.
|
||||
python setup.py $QUIET extract_messages --keyword "_C:1c,2 _P:1,2"
|
||||
}
|
||||
|
||||
# Run extract_messages for log messages.
|
||||
# Needs variables setup via setup_loglevel_vars.
|
||||
function extract_messages_log {
|
||||
project=$1
|
||||
|
||||
# Update the .pot files
|
||||
for level in $LEVELS ; do
|
||||
python setup.py $QUIET extract_messages --no-default-keywords \
|
||||
--keyword ${LKEYWORD[$level]} \
|
||||
|
@ -75,6 +75,7 @@ function propose_python {
|
||||
pull_from_zanata
|
||||
|
||||
# Extract all messages from project, including log messages.
|
||||
extract_messages
|
||||
extract_messages_log "$PROJECT"
|
||||
|
||||
update_po_files "$PROJECT"
|
||||
@ -139,7 +140,7 @@ function propose_django_openstack_auth {
|
||||
pull_from_zanata
|
||||
|
||||
# Update the .pot file
|
||||
python setup.py extract_messages
|
||||
extract_messages
|
||||
|
||||
update_po_files "openstack_auth"
|
||||
|
||||
|
@ -31,7 +31,7 @@ case "$PROJECT" in
|
||||
;;
|
||||
django_openstack_auth)
|
||||
setup_django_openstack_auth
|
||||
python setup.py extract_messages
|
||||
extract_messages
|
||||
;;
|
||||
horizon)
|
||||
setup_horizon
|
||||
@ -40,6 +40,7 @@ case "$PROJECT" in
|
||||
*)
|
||||
setup_project "$PROJECT"
|
||||
setup_loglevel_vars
|
||||
extract_messages
|
||||
extract_messages_log "$PROJECT"
|
||||
;;
|
||||
esac
|
||||
|
Loading…
x
Reference in New Issue
Block a user