GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit 56399f5a authored by Cecylia Bocovich's avatar Cecylia Bocovich

Update send mail to get user requested locale

This updates sendmail to get links and save stats for the user requested
locale. Right now all body translations default to english since we
haven't translated it yet.
parent 277ba71b
......@@ -215,15 +215,15 @@ class Sendmail(object):
locales = strings.get_locales()
strings.load_strings(language)
locale = locales[language]['locale']
locale = locales['en']['locale']
log.info("Getting links for {}.".format(platform))
log.info("Getting links for {} {}.".format(platform, language))
links = yield self.conn.get_links(
platform=platform, language=locale, status="ACTIVE"
platform=platform, language=language, status="ACTIVE"
)
# build message
link_msg, file = self.build_link_strings(links, platform, locale)
link_msg, file = self.build_link_strings(links, platform, language)
body_msg = self.build_body_message(link_msg, platform, file)
subject_msg = strings._("links_subject")
......@@ -241,7 +241,7 @@ class Sendmail(object):
)
yield self.conn.update_stats(
command="links", platform=platform, language=locale,
command="links", platform=platform, language=language,
service="email"
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment