hackforla / food-oasis

Repository for the current redevelopment of the Food Oasis Los Angeles website
https://foodoasis.la
GNU General Public License v2.0
71 stars 50 forks source link

Investigate how to support multiple languages #12

Open entrotech opened 4 years ago

entrotech commented 4 years ago

Goal

We currently only support a single language, but a many of our target food-seeker audience are not English readers.

Figure out how to display Food Oasis site in other languages

Related issues

nicholaspung commented 4 years ago

Was able to add translation features to front-end. Next steps is to figure out how to load translation text from the back-end to front-end.

nicholaspung commented 4 years ago

Current implementation has translations for both front-end (hard codes in /locales) and back-end (FAQ table has a languages table to query).

Anyone have a better way? Is there a preference for having all translated text to be on the back-end?

Benbaillou commented 2 years ago

Hi - can we label the size please?

Benbaillou commented 2 years ago

@entrotech - Is Nicolas or someone else still working on this issue?

fancyham commented 2 years ago

Can this possibly be done on-the-fly with google translate? At least for the short-term?

What other solutions are out there? It'd be amazing if the UI and the org's individual details and prose descriptions were translated, even imperfectly, into multiple languages. Something like Google Translate seems ideal.

Is that even possible with React?

entrotech commented 2 years ago

It is certainly possible to internationalize a React application, but we would need to decide what language needs to be internationalized and for how many languages. Make no mistake - making Food Oasis a fully-customized multi-lingual site is a huge project, and it only seems worthwhile if we translate not only the static text on the web application, but also all of the listing data as well. Just getting the listing data in English is already a pretty burdensome task. To add Spanish would require bilingual volunteers to translate and re-enter the same data in Spanish, and then try to keep the contents in multiple languages in sync.

IMO, this is not practical given our current resources.

You can view the site using the Google Translate Browser Extension. Simply install the extension, navigate to the website, and select Google Translate from the Browser Toolbar. Here is an example in English:

image

Translated to Spanish:

image

Note that if I scroll down the list on the left a bit, the listings that scroll into view are not translated:

image

I.e., note how the James Wood listing is in English but the listings above it were translated. This is because Google translate only translates what's visible on the screen at the time, and as new content scrolls into view, it is in the original language. You can press the Original button and then click it again to re-translate the visible part of the page, but that's sort of awkward.

We would also need to consider which fields should not be translated. For example, Google Translate will sometimes attempt to translate words in email addresses to the new language, which will then be an incorrect email address. we should also consider if the organization name, street names, city names, etc. should be translated or not. We can add a translate='no' attribute to HTML tags that should not be translated, but we'd need to do a thorough review of all tags to see which ones should not be translated.

The only part I see that will not translate at all is the location drop-down box, since it is driven by the MapBox geolocator, which may not be translatable.

IMO, the question is whether it is worth the minor adjustments above to make our site a bit more compatible with Google Translate.

fancyham commented 2 years ago

I wonder if partial translations are useful?

For example, a first phase could translate only the labels and generated text such as hours open. But the free form text would stay as English. (Or whatever original language??)

A second phase might be to either hand-translate (a huge, huge task) or perhaps a machine-learning translation is possible?

I also wonder if in the longer term, if we can trigger in-browser translation to translated newly-displayed text (re: the problem shown in your example)? As you mentioned, google chrome supports translation to some extent. I believe Safari does, too.

This would be a great user research study or desk research bit to figure out how people who are fluent in other languages read or access government websites that are in English.

fancyham commented 2 years ago

Check out this automatic translation in Safari on my iPhone SE 2016. (I switched the UI language to spanish first)

My Spanish isn’t good enough to judge quality but It works with React loading.

maybe a solution would be to display instructions for how to turn browser translations on?

https://user-images.githubusercontent.com/3376957/174034791-a4e305a8-721a-4e73-a50b-ff2ee9459501.MOV

(Let me know if this video doesn’t work for you. It’s a .mov)

here is an 2018 iPad Pro 11 version where it even translates mage's text ..check out the logo. (Better processor is better translation features) https://user-images.githubusercontent.com/3376957/174035539-4879294f-b06f-4e06-ab6a-39d2232f9a95.mp4

fancyham commented 2 years ago

Had a good discussion about this — worth trying and it would be a huge time and effort saver compared to translating even just labels and buttons:

Immediate MVP steps:

@seiko, @entrotech ^ I think we could turn these into individual issues? Do you agree? If so, I'll create them.

Research ideas: Desk research:

^ I'd like not to lose these topics — perhaps I should create a related issue for this research as well?

fancyham commented 1 year ago

Quick notes from our leads meeting:

Let's try to make site compatible with automatic translation

On Safari, translations seem to happen well and on the fly, even with ReactJS

Once we roll it out, we should test it with food seekers

staceyrebekahscott commented 1 year ago

As for what should remain in English and what should be translated, we need to consider how names of orgs are listed. One concern is regarding religiously affiliated orgs that some food seeker groups might not be comfortable going to. Do we keep these in English only, do we translate them or is there a way we can have the org names in both English and another language?

fancyham commented 1 year ago

As an initial pass, I think the fields that should not be translated would be:

Also