Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

japan locale change #568

Merged
merged 6 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions microsetta_private_api/model/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ def __init__(self, account_id, email,
self.creation_time = creation_time
self.update_time = update_time
self.language = language
if (self.language == "ja_JP"):
ayobi marked this conversation as resolved.
Show resolved Hide resolved
self.language = "en_US"
language = self.language
ayobi marked this conversation as resolved.
Show resolved Hide resolved
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
Loading