Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#30293 closed enhancement (fixed)

Enable direct calls to _WP_Editors::wp_mce_translation()

Reported by: azaozz's profile azaozz Owned by: azaozz's profile azaozz
Milestone: 4.1 Priority: low
Severity: minor Version: 3.9
Component: TinyMCE Keywords:
Focuses: Cc:

Description

When a plugin loads TinyMCE directly (without using wp_editor()) it is quite hard to include the translation. The plugin would have to include and maintain 50-60 JS files and load them "by hand". Enabling direct calls to _WP_Editors::wp_mce_translation() makes translating TinyMCE much easier.

Attachments (1)

30293.patch (1.6 KB) - added by azaozz 10 years ago.

Download all attachments as: .zip

Change History (5)

@azaozz
10 years ago

#1 @azaozz
10 years ago

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

In 30296:

TinyMCE: enable direct calls to _WP_Editors::wp_mce_translation(). When using TinyMCE directly, this makes it easier to load the translation of the default strings. Fixes #30293.

#2 @nacin
10 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I like the intention of this, but I'm not sure we should keep it in. _WP_Editors is by its nature private, and desperately need a rewrite. Does this block us from changing it? Should we actually be encouraging/supporting direct TinyMCE usage without wp_editor()? If you don't use wp_editor(), do you deserve to piggyback off on the API to get translations? Is there a valid use case here I am missing?

#3 @azaozz
10 years ago

Right, _WP_Editors is just a wrapper for the 10 or so functions used to output all that is needed for the default editor.

The way TinyMCE translations work changed in 3.9. Before that they were in a separate file in langs subdirectory that was loaded independently.

It is still possible to use _WP_Editors::wp_mce_translation() directly, the changes here only make it a bit more convenient.

#4 @nacin
10 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.