opensupplyhub / open-apparel-registry

An application for searching, matching, uploading factories.
MIT License
32 stars 13 forks source link

Google Translate is automatically translating text that should not be translated #2370

Open KlausGPaul opened 1 year ago

KlausGPaul commented 1 year ago

Overview

When selecting a non-english language option from the google translate bar, the content of the page gets translated automatically. For the landing page, the term "OS" is considered to be the abbreviation for "Operating System", e.g.

image

Note this also affect the display of the search results, both company names and OS-IDs

image

and portions of addresses (lot -> Grundstück)

image

There is another unwanted behaviour when e.g. being on a translated page such as https://opensupplyhub.org/facilities . For the field "Product Type", the blind text is translated (when using German it would read "z.B. Jacken"), while the search will positively not find Jacken, only jackets

image

Expected Behavior

Certain terms should not be translated

Actual Behavior

OS ID gets translated such that the resulting text makes absolutely no more sense, whilst the OS ID is the key feature of the offering.

Steps to Reproduce

Demo

N/A

Additional context

This error did not occur on openapparel as OS ID used to be called OAR ID.

jwalgran commented 1 year ago

From the Google Cloud Translation documentation https://cloud.google.com/translate/troubleshooting

How do I tell Cloud Translation - Advanced to not translate something? You can use the following HTML tags:

<span translate="no"> </span>
<span class="notranslate"> </span>

This functionality requires the source text to be submitted in HTML.

jwalgran commented 1 year ago

We already use notranslate in a few places. Proposed solution is to wrap all usages of OS ID with a notranslate style.

jwalgran commented 1 year ago

Hey team! Please add your planning poker estimate with Zenhub @mstone121 @TaiWilkin

mariel-oar commented 1 year ago

@jwalgran , does this estimate include wrapping the example search texts (e.g. "select" and "jackets") in a no translate style?

jwalgran commented 1 year ago

@mariel-oar Yes, the estimate does cover all of the undesired translations in the issue description. I updated the issue title to cover all cases rather than specifically calling out OS ID.