diff --git a/microsetta_private_api/model/account.py b/microsetta_private_api/model/account.py index a42f03ec9..fb54f68e4 100644 --- a/microsetta_private_api/model/account.py +++ b/microsetta_private_api/model/account.py @@ -1,6 +1,7 @@ from enum import Enum from microsetta_private_api.model.model_base import ModelBase from microsetta_private_api.model.address import Address +from microsetta_private_api.localization import EN_US, JA_JP class AuthorizationMatch(Enum): @@ -61,6 +62,8 @@ def __init__(self, account_id, email, self.creation_time = creation_time self.update_time = update_time self.language = language + if (self.language == JA_JP): + self.language = EN_US self.consent_privacy_terms = consent_privacy_terms def to_api(self): diff --git a/microsetta_private_api/tasks.py b/microsetta_private_api/tasks.py index 152c631d3..6e3ef228a 100644 --- a/microsetta_private_api/tasks.py +++ b/microsetta_private_api/tasks.py @@ -8,7 +8,7 @@ from microsetta_private_api.repo.transaction import Transaction from microsetta_private_api.repo.admin_repo import AdminRepo from microsetta_private_api.repo.qiita_repo import QiitaRepo -from microsetta_private_api.localization import EN_US +from microsetta_private_api.localization import EN_US, JA_JP from microsetta_private_api.config_manager import SERVER_CONFIG import pandas as pd import tempfile @@ -22,6 +22,8 @@ @celery.task(ignore_result=True) def send_email(email, template_name, template_args, language): template = EmailMessage[template_name] + if language == JA_JP: + language = EN_US with flask_babel.force_locale(language): SendEmail.send(email, template, template_args)