Skip to content

Commit

Permalink
Merge pull request #568 from ayobi/japan_locale_change
Browse files Browse the repository at this point in the history
japan locale change
  • Loading branch information
cassidysymons authored Jun 6, 2024
2 parents 9e65d14 + 8223ff5 commit b9f678e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions microsetta_private_api/model/account.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 3 additions & 1 deletion microsetta_private_api/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit b9f678e

Please sign in to comment.