news-catalyst / google-app-scripts

a collection of scripts for tinynews google docs add-ons
https://script.google.com/a/newscatalyst.org/d/1ILURq69o3cYUy6k1n1X6HwxdMfl9xWNhILYuZxgLfeblb3IR15WCMZSj/edit
1 stars 1 forks source link

Translate/open translation toggle in publishing tools; done for articles AND pages #323

Closed jacqui closed 3 years ago

jacqui commented 3 years ago

Closes #320 Closes #326

Update (Thursday): this functionality now may be tested with 👉 version 94 👈 in the script editor; includes translations for pages

Update (Friday): now displays full locale name, prevents dupe buttons, and opens new translated doc in a new tab in one step

Based on the locales available for a given organisation and what google documents are associated with an article, this PR updates the publishing tools so, for the Test Diaryo site that publishes in english and filipino:

So, for each additional locale that a site publishes in:

This gets a little confusing to test with the code only in the script editor testing mode: opening the sidebar in the newly created translation doc will not show the right buttons as this PR hasn't been published for the add-on yet!

Making all of this work was a bit easier this time around for me, but it's still kinda tricky, so I appreciate the help testing it out.

TylerFisher commented 3 years ago

Cool, this all works! I tested moving between translations that are already published, and I created a new set of articles that are connected via translation. I have a one very small edit about how this works, then I think this is good to go:

When I originally published my English translation, a button to translate didn't appear until I closed and reopened the sidebar. Is it possible for that button to appear right after the first publish? I can imagine people having both translations in hand and wanting to publish them immediately.

And a couple of thoughts, not sure if we need to change anything though:

jacqui commented 3 years ago

Cool, this all works! I tested moving between translations that are already published, and I created a new set of articles that are connected via translation. I have a one very small edit about how this works, then I think this is good to go:

When I originally published my English translation, a button to translate didn't appear until I closed and reopened the sidebar. Is it possible for that button to appear right after the first publish? I can imagine people having both translations in hand and wanting to publish them immediately.

And a couple of thoughts, not sure if we need to change anything though:

* I'm curious whether people will understand the locale codes we use everywhere, or if we should keep labels around for those. English instead of `en`, Spanish instead of `es`, Tagalog instead of `tl`, etc.

* I think I remember that this isn't possible, but is it possible to open the translation in another tab when you first click translate, instead of the double click thing?

Good points all around. Thanks for testing this out so thoroughly.

I've updated this PR as follows:

I'll see about getting the translate functionality opening a new window in one step now. I did have trouble with getting that to work in the past though, you're right.