BiologicalRecordsCentre / ABLE

Assessing ButterfLies in Europe project repository
2 stars 3 forks source link

Transifex connection not working to provide translation: eBMS website #458

Open CrisSevilleja opened 2 years ago

CrisSevilleja commented 2 years ago

The translations of the inner part of the website are done with the connection with Transifex: https://www.transifex.com/ceh/ebms-website-wwwbutterfly-monitoringnet/dashboard/

I request those translations for the eBMS website on this page https://butterfly-monitoring.net/admin/tmgmt/sources/locale/default that appear on Transifex to add translations in different languages. However, when the translations have been done, the connection with Transifex doesn't work, I mean the translated strings don't appear on the eBMS website jobs https://butterfly-monitoring.net/admin/tmgmt/jobs. I checked several times and the connections are not working for all the languages of the website.

One example: I just request these strings "Species I have recorded, Species sort order, Species known at this site, Search for or add species to, Preload species list", as is shown in the screenshot 2022-07-11_11h15_30

Those strings are already translated into Spanish but the translations don't appear on the Translation Jobs https://butterfly-monitoring.net/admin/tmgmt/jobs to be accepted. Those strings stay pending forever, despite I include the translation that cost me double time (specially for other languages).

I don't know if you could help on this @JimBacon there is not a big hurry but for a long time, it is not working. Thank you

JimBacon commented 2 years ago

Hi @CrisSevilleja

There are two ways to get the translations.

It seems the automatic update is not working so we need to check the configuration as described at https://docs.transifex.com/drupal-integrations/drupal-8-9#setting-up-an-auto-update-webhook-with-transifex.

@DavidRoy I cannot find the credentials to log in to Transifex in the BRC Keepass database. Would you be able to add them so that I can investigate?

CrisSevilleja commented 2 years ago

Hi @JimBacon thanks for this advice, I didn't know it was possible to make manual translations to get the transifex with connection. I did it for Spanish and Romanian languages and it worked, however, I missed some updates for German. A bit strange because German is completely translated....

Anyway, if you can check the automatic update that will be the best. One thing is that missing translations on the website are not incorporated if I done create the "job" on the website, however for the case of Romanian for example, this language is completely translated on transifex. So if I create the jobs for getting the missing translation, this action will duplicate the item on Transifex... This happened to me before, so I don't want to do it again. But then, I don't see other option to get the translated words applied to the website without the automatic way.

Let's hope we can resolve it. @DavidRoy can you give the credentials to Jim to be able to go further? thanks

DavidRoy commented 2 years ago

@JimBacon I've invited you as an admin for CEH transifex account. Let me know if you need different access

JimBacon commented 2 years ago

@DavidRoy I've not had any email notifications and I get no response from a password reset attempt via https://www.transifex.com/signin/ Am I in the wrong place?

DavidRoy commented 2 years ago

@JimBacon You are in the right place. Can you access: https://www.transifex.com/ceh/ebms-website-wwwbutterfly-monitoringnet/dashboard/

JimBacon commented 2 years ago

@DavidRoy I just got an email invitation and am signing in. Success

CrisSevilleja commented 2 years ago

Trying to update translations manually but it fails even if the Language is complete on Transifex. One example of the Japanese language on the screenshot shows the failure message on the website.

2022-07-27_10h30_40

@JimBacon I know you are checking this, just to give you a bit more information. Thanks for working on this.

JimBacon commented 2 years ago

I logged in to Transifex and looked at the settings for the automatic updates. They were being sent to https://dev-butterfly-monitoring.pantheonsite.io/tmgmt_transifex/webhook/ which doesn't even exist. I have corrected this to https://butterfly-monitoring.net/tmgmt_transifex_callback as specified in https://docs.transifex.com/drupal-integrations/drupal-8-9#setting-up-an-auto-update-webhook-with-transifex

If this were the only problem then I would expect new translations to now start showing in Drupal as 'Needs review' automatically. I don't suppose it will update anything retrospectively.

The more recent issue, of manual updates returning a message "Missing resource with slug", is another problem. A slug is a unique identifier of an item. I get an error for txdrupal__txsep__12371__txsep__default which corresponds to the item https://www.transifex.com/ceh/ebms-website-wwwbutterfly-monitoringnet/translate/#pl_PL/txdrupal_12371_default/. It looks to me like the slug should be 'txdrupal_12371_default' so possibly a bug in the Drupal module - it has been updated in the last week.

Raised issue https://www.drupal.org/project/tmgmt_transifex/issues/3301878

CrisSevilleja commented 2 years ago

Good @JimBacon you found the error and correct the proper website.

However, as you supposed Drupal is not making the automatic translation, I checked making some manual translation "Check for updates" and it gives the same message "Missing resource with slug: txdrupaltxsep12429txsepdefault". In this case, this was for the German language that is completely translated on Transifex for the website.

Let's hope they reply to your issue. Thanks!

JimBacon commented 2 years ago

I have had a helpful response to the issue I raised with the maintainers of the Transifex module.

There was a backwards-incompatible change made in version 2 of the module which we were unaware of. We started using the new version on 14th September 2021. Jobs created before then cannot be managed by the new module. Jobs created after then cannot be managed by the old module. They suggest re-creating the old jobs with the new module. Since we have about 50% of our jobs created after that date, I think they are probably correct.

JimBacon commented 2 years ago

@CrisSevilleja, can you confirm whether the Transifex connection is working properly now for jobs created recently?

CrisSevilleja commented 1 year ago

Hi @JimBacon sorry I never replied to this... many issues to control. But no, the connection between Transifex and eBMS is not working properly. What I have been doing recently is to apply direct translation in the way you told me Configuration > Regional and Language > User interface translation. #614

It is a direct translation, but really tedious and slower way to apply translation. Last year I was trying still to work with Transifex translation to the website, but the connection didn't work and started to produce duplication of some items to translate in Transifex, some language worked others not... due to the complexity I avoided sending jobs to Transifex and apply direct translation but I don't have the time to apply all the languages we have.

I don't know if you think of a different approach, but maybe we can book some time to meet and discuss this issue properly because I think it is quite intense. thank you in advance.

JimBacon commented 1 year ago

I can see some things that are causing a problem.

Looking at the translation jobs for the word 'Totals' in Drupal, there are 10 pending and 10 finished image

Comparing this with the status on Transifex I find the following

Language Status on Drupal Status on Transifex
Bulgarian Finished Translated
Catalan In progress Untranslated
Croatian Finished Translated
Czech Finished Translated & Reviewed
Danish Finished Translated
Dutch In progress Not present
Finnish Not requested Not present
French In progress Untranslated
German In progress Translated
Galician Not present Untranslated
Greek In progress Not present
Hungarian In progress Untranslated
Italian Finished Translated
Japanese In progress Untranslated
Lithuanian In progress Untranslated
Polish(pl) Finished Untranslated
Polish (Poland)(pl_PL) Not present Translated
Portuguese Finished Untranslated
Romanian Finished Translated
Serbian Not present Untranslated
Slovak Not requested Translated
Slovenian Finished Translated
Spanish Finished Translated
Swedish In progress Translated
Turkish In progress Untranslated

There are mismatches between languages configured on Drupal and Transifex:

We need to be aware of these because, for example, the request for a Greek translation will never get fulfilled as things stand.

Where 'Totals' is Translated on Transifex and Finished on Drupal there is nothing more to do. Where 'Totals' is Untranslated on Transifex and In progress on Drupal there is nothing that can be done. Where 'Totals' is Translated in Transifex and In progress on Drupal (German and Swedish) then we can Manage that job and Check for Updates

image

When we do that, no update is presented. Why?

The software asks Transifex for the status of the object with 'slug' = txdrupal__txsep__15677__txsep__default and language sv and gets a correct response to say there is a translation. When it tries to apply the update, it asks Transifex for the ids of the Drupal jobs associated with the resource, which is stored in a category field having values like tjid:nnn where nnn is the number of a job. It comes back with just one value, 541, where we need 559. Because 541 is a Bulgarian job and not Swedish, no update is applied but no error is deemed to have occurred.

If you edit the resource on Transifex you can see the category field. I think there should be a tjid category for each Drupal job connected to the resource (one for each language). It would seem there is a bug in the way the resource has been added to Transifex.

image @CrisSevilleja can you explain how you add the jobs so I know where to look for a bug.

I note that the settings allow you to change the slug. This gives us a means to fix the problem described above without resubmitting jobs.

CrisSevilleja commented 1 year ago

Hi @JimBacon thanks for the explanations and for digging into this problem.

Indeed, I think I generated some of the issues with Transifex sending jobs to languages not available in Transifex (like Dutch, Greek, and Finnish). I would like to add the Greek and Dutch language at least, but let's see first how I add new jobs to Transifex.

First I go to Administration/Translation -> Sources https://butterfly-monitoring.net/admin/tmgmt/sources This page is where I search for an item to be translated. I select "Choose source = Locale" and in Source Text I write the interesting item to translate, for example, Totals and click on search. Then I see the status of the item Totals for the different languages and select Totals, the source language (English) and which language I want that job. In this case, I selected Suomalainen (Finnish) because it is the only language without that job submitted. To finalise I will click on Request translation button.\ (I didn't request that translation now). Later, after a few days, I checked on Translation -> Jobs page https://butterfly-monitoring.net/admin/tmgmt/jobs I reviewed which items were processed well or not and accepted them. Quite tedious work going one by one, but I applied many translations in that way.

image

I kept track of which items I sent as a job and checked which ones were applied. In general, I submitted jobs for several languages at once and the same requested item is for several (now I don't see the option to request for several languages). However, some languages applied the translations and others not, and it was not based if the translated item was available in Transifex, for me it was a problem with the connection with the languages. I sent many jobs trying to get them but not always work and sometimes some items were repeated on Transifex... So things got quite messy, Sorry for that.

I hope I explained clearly the steps I did.

JimBacon commented 1 year ago

Hi @CrisSevilleja

I've been tidying up a lot of things with the translation today.

Having done the above, the new translations I added automatically changed status in Drupal to 'Needs Review', indicating that the connection between Transifex and Drupal is working. For others, I manually checked the translation jobs in Drupal and many are now waiting for review. Are you able to complete these jobs in Drupal?

Do you know why we have two different Polish translations on Transifex? If this is just an accident, I want to remove Polish (Poland). We only have one Polish language configured on Drupal and it is connected to Polish on Transifex. Any translations made against Polish (Poland) are ignored.

Do you have permissions to add languages in Transifex? Is there some reason that Dutch, Greek and Finnish have not been added? Perhaps, for example, we enjoy free Dutch translations :-)

CrisSevilleja commented 1 year ago

Hi @JimBacon Thank you for the work on this, we have more organisation now. I am doing the reviews of the translated items from Transifex on Jobs from Drupal, I will try to finish them today.

About the Polish language, I think it is a mistake. I see on eBMS website there are two Polish languages and both are been translated... I would remove the one with less translation, Polish (pl). But reading you it looks like the one we have more translations in Polish (Poland) is the one being ignored by Drupal, right? Then, we can transfer the translations (manually?) from this one to the correct one? let me know what you think. image

I don't have permission to add new languages in Transifex I normally requested one and David approved it. But I agree, Dutch, Greek and Finnish should be added :-D

CrisSevilleja commented 1 year ago

@JimBacon I have reviewed all the pending jobs to be reviewed, all done. The pending jobs are because 1) it is missing the translation (not language completed) or 2) the language is not available.

To solve 1) I am going to push my translators to finish the translations. For 2) do you know which Greek language to add? I wanted to request it but I don't want to request the wrong one.

The last thing, can I continue adding new jobs for Transifex? I would do it only for the languages available. I think now the connection is working well and it should work as normal. Thank you in advance.

CrisSevilleja commented 9 months ago

Hi @JimBacon I want to add the Greek language to Transifex for the eBMS website project https://app.transifex.com/ceh/ebms-website-wwwbutterfly-monitoringnet/dashboard/ to apply the Greek translations to the website.

Which Greek should I request on Transifex? I don´t want to connect the wrong one, there are several options and I don´t know which one Drupal uses: -Greek (Greece)(el_GR) -Greek (el_GR)

thank you in advance. By the way, the other languages being translated on Transifex are appearing on the website, so the connection for German and Turkish at least is correct.

JimBacon commented 9 months ago

Hi,

Navigate to Translation > Providers and click the Edit button for Transifex then scroll down to see the Remote languages mappings. The setting here needs to be consistent with your choice in Transifex.

Unless you are planning to support the different variants of Greek spoken in Greece, Cyprus and Germany I would accept the current setting of el and choose Greek (el) in Transifex. If you did want to support the country variants then I think you would need to add these to Drupal first.

Seeing this, it is now obvious why the translations on Transifex for pl_PL are being ignored.

CrisSevilleja commented 9 months ago

Hello,

Thanks, now I can see the different types of languages. The majority of languages are consistent with Transifex, except for:

I would like to change the website the provider to be consistent with the language types appearing on Transifex (there are some languages almost translated into Transifex). Can I change those languages on the website (Translation > Providers and click the Edit button) to be consistent with Transifex translations? Just to check before doing it.

JimBacon commented 9 months ago

I have not tried this and cannot find any help on Google to help answer this. My advice is not to change anything that is working. If some of these are not working then I would experiment by just changing one to see what happens. I would begin by changing the mapping for the language with fewest translations. Good luck!