WordPress.org

Make WordPress Core

#27610 closed defect (bug) (fixed)

JS Translations being looked for in the wrong place

Reported by: Ipstenu Owned by: azaozz
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.9
Component: TinyMCE Keywords:
Focuses: Cc:

Description

In both cases, the plugin is failing because it's looking for JS files that don't exist.

Failed to load: http://domain.tld/wp-content/plugins/cforms/js/langs/ro_RO.js

The actual file is ro.js

NetworkError: 404 Not Found - http://domain.tld/wp-content/plugins/slideshow-gallery/js/tinymce/langs/nl_NL.js
nl_NL.js

There is no such file.

The errors don't happen in English. While TinyMCE changed their standards to the normal two-named (ro_RO vs ro), this shouldn't error out, but fallback to (I guess) the plain-jane named version if the file isn't there.

Attachments (1)

27610.patch (2.6 KB) - added by azaozz 11 months ago.

Download all attachments as: .zip

Change History (8)

comment:1 @ircbot11 months ago

This ticket was mentioned in IRC in #wordpress-dev by ipstenu. View the logs.

comment:2 @SergeyBiryukov11 months ago

  • Component changed from I18N to TinyMCE
  • Milestone changed from Awaiting Review to 3.9

comment:3 @SergeyBiryukov11 months ago

Similar report: https://wordpress.org/support/topic/plugin-breaks-visual-editor-39b1-missing-enjs

NetworkError: 404 Not Found - [domain]/wp-content/plugins/google-document-embedder/js/langs/en.js

Caused by tinymce.PluginManager.requireLangPack('gde') (which doesn't seem necessary):
https://plugins.trac.wordpress.org/browser/google-document-embedder/tags/2.5.12/js/editor_plugin.js#L2

comment:4 @SergeyBiryukov11 months ago

Same reason in Slideshow Gallery plugin:
https://plugins.trac.wordpress.org/browser/slideshow-gallery/tags/1.3.1/js/tinymce/editor_plugin.js#L7

tinymce.PluginManager.requireLangPack() doesn't cause any issues in 3.8, but leads to a 404 error in 3.9.

comment:5 @Ipstenu11 months ago

Slideshow Gallery actually has (kinda) translations: https://plugins.trac.wordpress.org/browser/slideshow-gallery/tags/1.3.1/js/tinymce/langs

So is this due to TinyMCE 4, WP 3.9, or an unholy combo?

@azaozz11 months ago

comment:6 @azaozz11 months ago

In 27610.patch:

  • Bring back loading of /langs/[locale].js and /langs/[locale]_dlg.js from PHP.
  • Back to using ISO 639-1 (two letter) locales.

comment:7 @azaozz11 months ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 27922:

TinyMCE:

  • Bring back loading of /langs/[locale].js and /langs/[locale]_dlg.js from PHP. Prevents errors with missing translation files when custom plugins use requireLangPack() without second argument.
  • Back to using ISO 639-1 (two letter) locales as the locale is used as part of the translation file name.

See #24067, fixes #27610

Note: See TracTickets for help on using tickets.