wincowgerDEV / OpenSpecy-shiny

This is a companion repo that holds the code for www.openspecy.org website and shiny application. The Open Specy package repo https://github.com/wincowgerDEV/OpenSpecy-package
Creative Commons Attribution 4.0 International
3 stars 3 forks source link

Add option for manually translated versions of the application #5

Open wincowgerDEV opened 2 years ago

wincowgerDEV commented 2 years ago

Google translate isn't the best way to translate into other languages. I recently had a colleague reach out Bruno Ćaleta who is willing to help translate the website into Croatian. I think the best way to make this possible is to hit these milestones.

wincowgerDEV commented 2 years ago

Probably the best way to do this is to pre-create a JSON file with google translate for all the translation options: https://appsilon.com/rapid-internationalization-of-shiny-apps-shiny-i18n-version-0-2/

Then have people update that json file manually with their better translations. This will also allow translated text offline which is a nice feature. I am a little worried about how large the file size will be but I have hope it will be pretty small.

wincowgerDEV commented 2 years ago

@brunocalet, unfortunately, this is becoming more challenging than I originally thought. I have spent about 3 days on this so far and have run into several issues that I can't figure out how to surmount. I don't know if @brunocalet, @zsteinmetz, or @ardcarvalho have experience overcoming some of these challenges and could help me get around them.

  1. The first problem is that all of the translations need to be indexed in advance which will create a new file ~1.5 mb, which is small but CRAN doesn't allow us to have a total size larger than 5 mb so it isn't insignificant.
  2. The second problem is that the libraries (I tried ShinyBS, tippy, and shinyhelper) for the popups breaks when I try to run the translations in two distinct ways. The first, it breaks when on the UI side by not showing any translation or pasting html verbatim into the contents instead of the translation. The second way it breaks is on the server side where I can put everything into renderUI and it works the first time you change the language but then switches on and off of working afterward. Of course one way to overcome this would be to remove all the popups but I think that would be a downgrade since currently, we can translate the popups using the google translate add-in even though the translations are less than perfect.
  3. I think the best way to do this translation would actually be an entirely different framework than what I have currently done but I can find any other way people are doing it on the web. Ideally, there would be a global translator which just grabs all visible text on the page and converts it instead of forcing us to specify a variable translation at each location there is readable text in the code. That would make it easier to implement the translations for the rest of the text that I haven't gotten to yet and don't know how to (i.e. text in tables). Somehow the google translate api is able to do that.

All isn't lost though. On the plus side while pushing this forward I integrated some new improvements to the UI and we can pull those in if we don't end up incorporating the manual translation at this time. :)

zsteinmetz commented 2 years ago

Me playing the devil's advocate would first ask: Do we actually need perfect translations for the UI? I suppose that most users use Open Specy in English anyway. Maybe something worth a poll on Twitter?

  1. The first problem is that all of the translations need to be indexed in advance which will create a new file ~1.5 mb, which is small but CRAN doesn't allow us to have a total size larger than 5 mb so it isn't insignificant.

This could be solved by detaching the translations from the package (keeping the package in English by default) and providing the translations only via openspecy.org.

If we decide that it's worth the work, I can try to find a better framework. But we might still face some limitations with all the different Shiny packages we use.

wincowgerDEV commented 2 years ago

Yeah I don't think they are of urgent priority but I do think that we should continue to be open to opportunities that would improve our language translations.

On Fri, Jan 21, 2022, 2:57 AM Zacharias Steinmetz @.***> wrote:

Me playing the devil's advocate would first ask: Do we actually need perfect translations for the UI? I suppose that most users use Open Specy in English anyway. Maybe something worth a poll on Twitter?

  1. The first problem is that all of the translations need to be indexed in advance which will create a new file ~1.5 mb, which is small but CRAN doesn't allow us to have a total size larger than 5 mb so it isn't insignificant.

This could be solved by detaching the translations from the package (keeping the package in English by default) and providing the translations only via openspecy.org.

If we decide that it's worth the work, I can try to find a better framework. But we might still face some limitations with all the different Shiny packages we use.

— Reply to this email directly, view it on GitHub https://github.com/wincowgerDEV/OpenSpecy/issues/107#issuecomment-1018400340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGMUJU3ZUF4VQWTZQN5DQ4DUXE3Z7ANCNFSM5LACUPUQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were assigned.Message ID: @.***>