Opened 5 months ago

Closed 5 months ago

#33002 closed defect (fixed)

Localized binaries not working for some locales

Reported by: cohosh Owned by: cohosh
Priority: High Milestone:
Component: Applications/GetTor Version:
Severity: Normal Keywords:
Cc: traumschule, hiro, gaba, phw, cohosh Actual Points:
Parent ID: Points: 2
Reviewer: phw Sponsor:

Description

When testing GetTor, I get links for en-US binaries even when I request a different locale. I've checked that the requested locales are available so I think there is a bug in the email processor. The following locales *are* processed correctly:

  • en to en-US
  • pt to pt-BR
  • es to es-ES

However, I tried ru, ar, and fa and these all sent me en-US links.

Child Tickets

Change History (9)

comment:1 Changed 5 months ago by cohosh

Alright it looks like it checks like gettor checks the received email for strings that match any known locales, as defined by a locale json.

However, after looking at the other json files in this directory, it seems like there's a conflation between translated gettor message body and the tor browser binary links. We only have json files for translating the message body into three languages so far, which we should open a separate ticket to expand on, but there's no reason why we can't give out links for the requested locale as long as we have them.

comment:2 Changed 5 months ago by cohosh

Points: 12

comment:3 Changed 5 months ago by cohosh

Status: assignedneeds_review

Here's a merge request for this ticket: https://dip.torproject.org/cohosh/gettor/merge_requests/4

As described in the commit messages, these are the rules for chosing a locale:

  • if only the language code is given, choses the regionalization that occurs first in the locale list (e.g., "en" --> "en-US"
  • if regionalization for the language is *not* present, choses the generalized language or a different regionalization (e.g. "pt-PT" --> "pt-BR")
  • parses both the subject and body looking for the most specific regionalization
  • defaults to en-US if no available language is found

It might be good to include all available regionalizations if no specific one is given (e.g., "es" --> "es-AR" and "es-ES"), but that would probably require a re-examination of how to structure the gettor message body so that the distinction is clear. I'll leave that for a future ticket for now.

comment:4 Changed 5 months ago by phw

Reviewer: phw
Status: needs_reviewmerge_ready

Looks good to me! I left some comments in the merge request.

comment:5 Changed 5 months ago by cohosh

Thanks! I forgot a commit to update sendmail. It's deployed as a hotfix now but isn't merged to master: https://dip.torproject.org/cohosh/gettor/commit/56399f5a71f7ebc642ab5ba9526f4da716a83771

comment:6 Changed 5 months ago by cohosh

Status: merge_readyneeds_review

comment:7 Changed 5 months ago by cohosh

comment:8 Changed 5 months ago by phw

Status: needs_reviewmerge_ready

Looks good to me!

comment:9 Changed 5 months ago by cohosh

Resolution: fixed
Status: merge_readyclosed
Note: See TracTickets for help on using tickets.