Add openstack_auth to translation-related commands

openstack_auth was missing in pull_catalog and extract_messages
commands in manage.py. It is just because we forgot add it when
openstack_auth was merged from django-openstack-auth into horizon.

update_catalog did not run with python3 as write_po assumes fileobj is
opened as binary mode. We need to open a POT file with binary mode.

Change-Id: Ifa1c07c46d1081a299b030e523713e73b41faf19
This commit is contained in:
Akihiro Motoki 2021-02-04 12:04:26 +09:00
parent 944902c5c2
commit be3d27c029
3 changed files with 4 additions and 4 deletions

View File

@ -21,7 +21,7 @@ import requests
ZANATA_LOCALES_URL = ("https://translate.openstack.org/rest/project"
"/horizon/version/master/locales")
DOMAINS = ['django', 'djangojs']
MODULES = ['horizon', 'openstack_dashboard']
MODULES = ['horizon', 'openstack_dashboard', 'openstack_auth']
PROJECT = 'horizon'
BRANCH = 'master'
POFILE = "{module}/locale/{locale}/LC_MESSAGES/{domain}.po"

View File

@ -20,7 +20,7 @@ from subprocess import call
from django.core.management.base import BaseCommand
DOMAINS = ['django', 'djangojs']
MODULES = ['openstack_dashboard', 'horizon']
MODULES = ['openstack_dashboard', 'horizon', 'openstack_auth']
class Command(BaseCommand):

View File

@ -29,7 +29,7 @@ LANGUAGE_CODES = [language[0] for language in settings.LANGUAGES
POTFILE = "{module}/locale/{domain}.pot"
POFILE = "{module}/locale/{locale}/LC_MESSAGES/{domain}.po"
DOMAINS = ['django', 'djangojs']
MODULES = ['openstack_dashboard', 'horizon']
MODULES = ['openstack_dashboard', 'horizon', 'openstack_auth']
def translate(segment):
@ -127,5 +127,5 @@ class Command(BaseCommand):
msg.string = translate(msg.id)
new_cat[msg.id] = msg
with open(pofile, 'w') as f:
with open(pofile, 'wb') as f:
babel_pofile.write_po(f, new_cat, ignore_obsolete=True)