rubyforgood / Flaredown

Flaredown web app and API
http://www.flaredown.com
GNU General Public License v3.0
39 stars 15 forks source link

Set translation fallback to use English (so UI does not show i18n keys) #487

Closed bklang closed 2 years ago

bklang commented 2 years ago

Doc: https://github.com/jamesarosen/ember-i18n/wiki/Doc:-Missing-Translations Code: https://github.com/rubyforgood/Flaredown/blob/master/frontend/app/utils/i18n/missing-message.js

Here is an old issue that appears relevant: https://github.com/jamesarosen/ember-i18n/issues/256

bklang commented 2 years ago
Screen Shot 2021-10-12 at 3 37 08 PM
bklang commented 2 years ago

On further investigation, the translations actually occur in the backend, and not in the frontend (Ember). The translation only took effect when I changed my country, and seems to ignore any locale hint provided by the browser/device.

bklang commented 2 years ago

Found the source of the problem: the frontend requests a list of sexes via API, and the API is returning these malformed strings. This likely affects multiple endpoints. I'm working on a PR which will handle this more gracefully.