Plugin info

Total downloads: 1,097
Active installs: 0
Total reviews: 0
Average rating: 0
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 1
Last updated: 12/11/2014 (4037 days ago)
Added to WordPress: 12/11/2014 (11 years old)
Minimum WordPress version: 3.0
Tested up to WordPress version: 4.01
Minimum PHP version: f

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 4037 days ago

20/100

Is Localize js abandoned?

Possibly abandoned (last update 4037 days ago).

Compatibility

Requires WordPress: 3.0
Tested up to: 4.01
Requires PHP: f

Languages

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

Replace Default Words
Rating 4.3/5 (14 reviews)Active installs 400
PoMo Uploader
Rating 0.0/5 (0 reviews)Active installs 20
Twitter Base
Rating 0.0/5 (0 reviews)Active installs 10
Ni Purchase Order(PO) For WooCommerce
Rating 0.0/5 (0 reviews)Active installs 10
Translation Tester
Rating 0.0/5 (0 reviews)Active installs 10
DeMomentSomTres Debug Load Text Domain
Rating 5.0/5 (1 reviews)Active installs 0

Description

WordPress has the function wp_localize_scripts for translation, but the strings passed to it have to be hard-coded. Until you parse the .js-files and scan for occurrences of _e() with a fast regexp, and localize them with the data using the WordPress _e-function to localize from a .po file. *Note*. Your po-file has to include strings from javascript files. To do this in Poedit, see http://stackoverflow.com/questions/16557327/how-to-generate-po-file-from-js-file-using-poedit.

Installation

  1. Unzip the plugin in your plugin directory.
  2. Activate the plugin in WordPress.
  3. Make sure your .po-file is in your /languages directory and contains the translations from the .js-files.
  4. Place the following code in your javascript file:
function _e(s) {     return ccb_e_ccb_HANDLE[s]; } 

where you replace HANDLE with the handle for your script (you use the handle to enqueue the script in functions.php.) 5. Translate your javascripts! You can now use alert ( _e("Error! Try again in your language")). Note that there is no text-domain here as that is taken care of by PHP when it fills the array dynamically.

Frequently Asked Questions

None for the moment.

Review feed

No reviews available

Screenshots

No screenshots available

Changelog

December 11, 2014

  • First release.