andrewhancox / moodle-filter_translations

8 stars 8 forks source link

Pages being translated to random languages #119

Closed berthelemy closed 2 years ago

berthelemy commented 2 years ago

Context

One of our installed language packs is Kinyarwanda.

To replicate

  1. Ensure your computer/browser is set to English
  2. Go to: https://academy.cabi.org/login/index.php

Expected behaviour

Actual behaviour

Capture d’écran 2022-06-13 à 07 25 26

Additional info

This is the HTML for the Authentication instructions. Before the translation plugin, we set up the multilang filter for Spanish-speaking users.

<span data-translationhash="73d5c3541509cc5fe1baf484d799ba74"></span>
<p>
    <span lang="en" class="multilang">Anyone can <a href="/login/signup.php">create an account</a> here to access our free-to-use resources.</span><span lang="es" class="multilang">Cualquier persona puede <a href="/login/signup.php">crear una cuenta</a> aquí para acceder a nuestros recursos de uso libre.</span></p>
<p>
    <span lang="en" class="multilang">If you wish to access the paid-for content, please speak to your normal CABI representative, or <a href="https://www.cabi.org/products-and-services/sales-information/meet-the-sales-team/" target="_blank">contact the sales team</a>.</span>
    <span lang="es" class="multilang">Si desea acceder al contenido de pago, por favor hable con su representante habitual de CABI, o <a href="https://www.cabi.org/products-and-services/sales-information/meet-the-sales-team/" target="_blank">contacte al equipo de ventas</a>.</span></p>
berthelemy commented 2 years ago

It turns out it's not just the login screen.

Here's a screenshot of the New Account screen, showing parts displaying in Arabic.

Capture d’écran 2022-06-13 à 07 55 18

berthelemy commented 2 years ago

The only thing that's changed in the last few days is that we discovered we needed to install the Atto plugin, and so did that.

Could that have had this effect?

berthelemy commented 2 years ago

Also noticed this occurring on the list of course categories (with the language set to English).

These category titles should be in English.

Capture d’écran 2022-06-13 à 09 51 11

berthelemy commented 2 years ago

Any thoughts on what might be happening here @andrewhancox @jgramp ?

andrewhancox commented 2 years ago

There may be multiple issues here. The login screen - I would check the site with the filter disabled - my assumption would be that this would be getting handled by the language packs.

On 14 Jun 2022, at 11:20, Mark Berthelemy @.***> wrote:

Any thoughts on what might be happening here @andrewhancox https://github.com/andrewhancox @jgramp https://github.com/jgramp ?

— Reply to this email directly, view it on GitHub https://github.com/andrewhancox/moodle-filter_translations/issues/119#issuecomment-1154996805, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJEYMXFTYAVLVGWFWQKIF3VPBMIHANCNFSM5YS7GVGA. You are receiving this because you were mentioned.

berthelemy commented 2 years ago

With the filter disabled (Off, but available), in an incognito browser window, the language on the login screen is displayed in English, as is the language on the account sign up screen.

With the filter enabled, in the same window, the login screen instructions are turned to Kinyarwanda, and the custom profile field labels on the sign up screen are displayed in Arabic.

berthelemy commented 2 years ago

It looks like the translation table is completely corrupted since adding the Atto plugin (that's the only correlating factor... which implies it might be the cause, but I can't be definite).

I'm coming across other content that is now appearing in a translated language (French in this case), when it should be displaying in English, the source language.

I'm on the verge of disabling the filter, deleting all the translations, and starting again. Is that my best course of action? I hope not, given the amount of money we've already spent on Google Translate.

andrewhancox commented 2 years ago

There was a serious bug in the caching that is now fixed - my suspicion is this was the root cause here.

I don't think the contents of the translation table will be corrupted.

berthelemy commented 2 years ago

All seems to be sorted. Thanks.