unfoldingWord-dev / ts-desktop

translationStudio Desktop App
http://ufw.io/ts
Other
41 stars 29 forks source link

Expand tS api to support tA in other languages #1271

Closed da1nerd closed 5 years ago

da1nerd commented 5 years ago

tA has been translated to Croatian and users would like to access it inside of tS.

Right now only english is processed and uploaded to the tS v2 api.

Example:

Once the api has been updated we'll need to improve the android client and node client to also support other languages. Both are currently hard coded to English.

Finally, the Android and desktop apps will need to be updated to display the correct translation of tA. This should depend on the selected source translation in the project (Android already does this).

Here are some key locations in the code:

da1nerd commented 5 years ago

I've determined that tA is not processed at all by the ts v2 api. The english tW was manually uploaded in 2017.

jag3773 commented 5 years ago

As a result, we've decided not to build this feature into the deprecated tS v2 API. Support for tA is available in the v3 API and apps that want to access it can use it there.

This does mean that tS v12 won't support viewing tA in other languages.

birchamp commented 5 years ago

As a backup/workaround, we can use the tN pdf to have access to tA through tN. https://www.unfoldingword.org/utn

jag3773 commented 5 years ago

I'd suggest that we don't touch the catalog but rather have tS hit https://api.door43.org/v3/subjects/Translation_Academy.json directly. Since there isn't any code in tS to handle tA right now anyway, makes sense to just add the code there to get it from the latest published location.

da1nerd commented 5 years ago

Originally, all of the api content was downloaded and managed from a separate library. Because translationAcademy will be coming from a different api end point and format, we'll need to provide a new way to view, update, and download translationAcademy translations.

@jag3773 can you provide some feedback on the below approach?

Concerns: Will any of the tA links within tN become invalid because we are using tA from the v3 api? There have been some structural changes to tA since the v2 days. If this is a problem, we can solve this with a map from v2 to v3 tA entries.

jag3773 commented 5 years ago

@neutrinog That approach sounds like a good way to go.

Regarding your concerns, I don't think that will be a problem, especially because the tN content is being updated while the tA content has not been. In other words, having the latest tA available is likely to fix areas where there might have been a link mismatch. However, in the vast majority of cases we have tried to not change the paths/links to any of the articles.

Some articles have been added and a couple of the manuals were removed, but the removed manuals were the ones not linked to from tN anyway (tech and audio).

Note that @klappy has some code in https://github.com/unfoldingWord-box3/translation-helps for showing Markdown as HTML including rendering the RC links. If there is a straightforward way to use that then great :)

klappy commented 5 years ago

There are plans in the not so distant future to abstract that out as it’s own library on npm.

Here’s the file that handles the above: https://github.com/unfoldingWord-box3/translation-helps/blob/master/src/components/Viewer/Workspace/TranslationHelps/RCLinkContainer.js

da1nerd commented 5 years ago

@jag3773 yes, but tN is going through the tS api. I'll need to double check that we aren't doctoring any of the links before it gets to tS.

da1nerd commented 5 years ago

Just about finished. There's a few usability things I need to add including:

Checking for updates checking-for-updates

Downloading tA downloading-ta

Opening tA from a contextual link opening-contextual-link-with-downloaded-ta

Opening tA from a contextual link when the translation of tA has not yet been downloaded. opening-contextual-link-without-downloaded-ta

jag3773 commented 5 years ago

Looking really good @neutrinog ! One thing that I want to make sure that we preserve is fall back to English tA if tA is not available in the GL. Also, if the user doesn't want to download the GL version, then English should be shown.

da1nerd commented 5 years ago

@jag3773 what translations of tA should be bundled with the app?

jag3773 commented 5 years ago

Let's do all that are published.

elsylambert commented 5 years ago

Regarding tS translationAcademy, these are my observations. Please let me know if this is the desired behavior:

  1. When opening tS, tA shows 6 languages resources to chose from. I am assuming this is bundled with the App.
  2. Check for updates button, did not gave me any results, so I am assuming that I have the latest resources. It does show a message for a fraction of second "looking for updates....". There should be a message indicating that resources are up-to-date. 3.When tA is accessed from within the Projects>Words, it opens by default in English. so if the user has to change the language, tA must be closed and opened again from the home page by selecting any of the desired language resources .
  3. When tA is accessed from within the Projects>Words with tA opened as in step 3b, tA opens up in the chosen language.
da1nerd commented 5 years ago

@elsylambert @jag3773 one feature I didn't mention was you can open the language selection menu at any time by pressing ctrl+o. You can also delete the selected language from that same dialog by holding down ctrl and pressing on the delete button that appears.

I added those mostly for my sanity in testing things, but we could potentially expose those to users in a friendlier way.

elsylambert commented 5 years ago

@neutrinog Ctrl+o works well to bring the language selection menu and able to change the language. The issue here is, when I cancel on the language selection menu, it closes tA, instead of closing the Menu window. Ctrl and delete works fine.

jag3773 commented 5 years ago

@elsylambert In my testing, if I have a Hindi translation active in the source pane and click on a link to tA from the words pane then I do get tA in Hindi (even though I previously had opened it in English). I think this is the desired behavior.

Basically, on Mac, the language that tA opens with depends on the language of the resource it was launched from. So if I click a tA link from a Hindi tW article, I get tA in Hindi. If I click a tA link from an English article, I get tA in English.

Are you seeing something different @elsylambert ? And on which platform?

elsylambert commented 5 years ago

@jag3773 Yes, I am seeing the same behaviour. Previously I had English Translation active so tA opened in English. Looks good.