[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [gettor/master] Update send mail to get user requested locale



commit 56399f5a71f7ebc642ab5ba9526f4da716a83771
Author: Cecylia Bocovich <cohosh@xxxxxxxxxxxxxx>
Date:   Fri Jan 31 09:53:32 2020 -0500

    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.
---
 gettor/services/email/sendmail.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gettor/services/email/sendmail.py b/gettor/services/email/sendmail.py
index c570f22..8d895d7 100644
--- a/gettor/services/email/sendmail.py
+++ b/gettor/services/email/sendmail.py
@@ -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"
                     )
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits