Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#27610 closed defect (bug) (fixed)

JS Translations being looked for in the wrong place

Reported by: ipstenu's profile Ipstenu Owned by: azaozz's profile 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 years ago.

Download all attachments as: .zip

Change History (8)

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


11 years ago

#2 @SergeyBiryukov
11 years ago

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

#3 @SergeyBiryukov
11 years 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

#4 @SergeyBiryukov
11 years 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.

#5 @Ipstenu
11 years 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?

@azaozz
11 years ago

#6 @azaozz
11 years 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.

#7 @azaozz
11 years 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.