Twin-Cities-Mutual-Aid / twin-cities-aid-distribution-locations

A webapp to coordinate aid and care in the Twin Cities.
43 stars 32 forks source link

Karen font and translation related follow-up #191

Open experimatt opened 4 years ago

experimatt commented 4 years ago

See this PR from @benjifs for more details: https://github.com/Twin-Cities-Mutual-Aid/twin-cities-aid-distribution-locations/pull/182

codarose commented 4 years ago

@benjifs We've got a pretty major character encoding issue with regard to the drop-down!

Screenshot 2020-07-10 18 04 49
benjifs commented 4 years ago

Because the translations were dependent on the KNU Font, things that are not styled by css like a dropdown won't get the proper font applied to them. The quickest solution would be to change the select implementation and use a styled dropdown like the ones from Bootstrap or something like this: https://codepen.io/wallaceerick/pen/ctsCz

Not really sure what an alternate approach would be since the translations only work with that font.

amaxama commented 4 years ago

@benjifs @experimatt I'm also seeing an issue where other languages at times get the wrong value applied for moment values... This example in Mandarin Chinese that has unstyled Karen: Screen Shot 2020-09-21 at 9 52 10 PM

This example in Vietnamese which has Spanish: Screen Shot 2020-09-21 at 9 52 47 PM

Seems related to this issue or at least moment. Any idea what the problem could be?

benjifs commented 4 years ago

I looked into this and there's two problems. Moment doesn't default to a locale if the one used isn't present so it just fails to translate in the case of Mandarin Chinese and stays with whatever the previous translation was. A quick fix is to check if the locale is defined in moment and if not, default to English.

However I noticed the locale does in fact exist it's just never imported. If I import that locale in index.js, it'll work and translate that