Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 19:00 – 22:00 -

Supporter timezone: Europe/Paris (GMT+02:00)

This topic contains 15 replies, has 3 voices.

Last updated by omerA-2 5 years, 3 months ago.

Assisted by: Yvette.

Author Posts
June 4, 2019 at 8:23 pm #3955119

Marco

Fatal error:
Fatal error: Uncaught RuntimeException: Language of /home/REMOVED/public_html/wp-content/languages/pt_PT_ao90-1bba9045bb07c89671c88a3f328548e8.json cannot be recognized in /home/infusoescomhisto/public_html/wp-content/plugins/wpml-string-translation/classes/translations-file-scan/translations-file/wpml-st-translations-file-locale.php:54

This happens because on wpml-st-translations-file-locale.php line 49 the "#([a-z]+[_A-Z]*)-[-_a-z0-9]+\.json$#i" pattern can't extract "pt_PT_ao90" from the "https://cdn.wpml.org/home/REMOVED/public_html/wp-content/languages/pt_PT_ao90-1bba9045bb07c89671c88a3f328548e8.json" file name.

This needs to be fixed because it's a bug.

June 5, 2019 at 10:33 am #3959579

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

Hello

I need some more information on how to reproduce this error.

I have installed a new sandbox site and defined a new language with this locale.

Do you have a theme or plugin that uses this locale? Could you reproduce this error here?
hidden link

Thanks for your collaboration on this matter

June 5, 2019 at 11:02 am #3959743

Marco

Hi there,

WooCommerce has a pt_pt_ao90 translation: hidden link

I've activated WooCommerce on this sandbox site, as well as all the necessary WPML companion plugins.

If you try to add a pt_pt_ao90 translation to Hello World or add a new post directly on pt_pt_ao90 you'll get a fatal error.

June 5, 2019 at 12:29 pm #3960573

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

Hello

I am not able to get any error.

Here is a brand new post directly in pt_PT_ao90: hidden link

And here is a Woocommerce product translated to pt_PT_ao90:
hidden link

I did have to complete the full configuration of Woocommerce and WCML however. Once I did this - I imported sample products and then tried to translate to PT.

Can you please check?

June 5, 2019 at 12:36 pm #3960595

Marco

When I replied I was getting the fatal error. I disn't even tried WooCommerce products, just a regular post.

Let me check my configuration and replicate it on this test website.

June 5, 2019 at 12:50 pm #3960645

Marco

Even if we are unable to replicate it on the sandbox website, the problem is in the

PATTERN_SEARCH_LANG_JSON

constant on

wpml-string-translation/classes/translations-file-scan/translations-file/wpml-st-translations-file-locale.php

:

#DOMAIN_PLACEHOLDER([a-z]+[_A-Z]*)-[-_a-z0-9]+\.json$#i

does not expect a locale like "xx_xx_xx99", as stated on lines 24 to 29:

* It extracts language code from mo file path, examples
* 'https://cdn.wpml.org/wp-content/languages/admin-pl_PL.mo' => 'pl'
* 'https://cdn.wpml.org/wp-content/plugins/sitepress/sitepress-hr.mo' => 'hr'
* 'https://cdn.wpml.org/wp-content/languages/fr_FR-4gh5e6d3g5s33d6gg51zas2.json' => 'fr_FR'
* 'https://cdn.wpml.org/wp-content/plugins/my-plugin/languages/-my-plugin-fr_FR-my-handler.json' => 'fr_FR'

I'll investigate when this is needed so we can replicate it on the sandbox website, but the information I'm providing on this reply is enough to understand that there is, in fact, a problem.

June 5, 2019 at 1:23 pm #3960805

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

I don´t doubt at all that there is an issue as you describe.

However, on my end I do need to follow our own protocols so that I can escalate the problem to development. For this, my job is to replicate the issue on a clean sandbox site.

They will then work directly on this site with the recreated issue to investigate the problem and develop a solution.

Thanks for your ongoing collaboration on this.

June 5, 2019 at 1:34 pm #3960895

Marco

I know. I'm debugging the issue as we speak so we can replicate it on the sandbox website.

June 5, 2019 at 2:27 pm #3961483

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

Mil gracias!

June 5, 2019 at 4:34 pm #3962705

Marco

This happens if your wp-admin language is set to PT_pt_a90 or default (and PT_pt_ao90 is the default language).

I've changed the "demo" user language to "default" and you can test it now.

Additional debug:

This happens when:

WPML_ST_Translations_File_Locale->get

(this is the functions that fails when parsing the filename to get the locale)

is called by

WPML_ST_Script_Translations_Hooks->get_file_locale

that is called by

WPML_ST_Script_Translations_Hooks->override_jed_file

that is added to the

load_script_translation_file

filter on

WPML_ST_Script_Translations_Hooks

which is instantiated on

WPML_ST_Script_Translations_Hooks_Factory->get_filtering_hooks
June 6, 2019 at 9:37 am #3967863

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

Hello

This is great - thanks. You´re ticket is now escalated to our 2nd tier group for further investigation.

June 12, 2019 at 8:43 am #4002029

Marco

Any news on this?

June 12, 2019 at 8:47 am #4002065

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

Sorry no news yet. I´ve placed a comment in the internal ticket indicating that you have written asking for an update.

I´ll forward any news here. But please do keep pinging me for updates so that the issue does not get lost in my day-to-day queue.

July 2, 2019 at 8:04 am #4124861

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+02:00)

Hello

I wanted to update you on the work regarding this issue. Our 3rd tier support has been able to confirm/replicate the problem and it is now in the hands of our development team for fixing.

Kind regards.

July 2, 2019 at 8:07 am #4124889

Marco

OK