Title: Extract strings from JavaScript files
Last modified: January 7, 2019

---

# Extract strings from JavaScript files

 *  Resolved [asafm7](https://wordpress.org/support/users/asafm7/)
 * (@asafm7)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/extract-strings-from-javascript-files/)
 * Hi,
 * I saw there is a new feature for extracting strings from JS files.
 * I followed the instructions here: [https://localise.biz/wordpress/plugin/manual/settings](https://localise.biz/wordpress/plugin/manual/settings)
 * I used __() function but got this error on the console:
 * “__ is not defined”
 * How it should be done?
 * Thanks,
    Asaf

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/extract-strings-from-javascript-files/#post-11060739)
 * I cannot help you write JavaScript. String extraction is separate from code execution.
   See the documentation for whatever JavaScript localization framework you are 
   using.
 * WordPress includes a framework for localizing JavaScript, but note that Loco 
   Translate does not currently compile the JSON language packs required by wp_set_script_translations.
 *  Thread Starter [asafm7](https://wordpress.org/support/users/asafm7/)
 * (@asafm7)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/extract-strings-from-javascript-files/#post-11061315)
 * Thanks.
 * This page can help the next person:
 * > [New! JavaScript i18n support in WordPress 5.0](https://make.wordpress.org/core/2018/11/09/new-javascript-i18n-support-in-wordpress/)
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/extract-strings-from-javascript-files/#post-11065454)
 * Support for JSON language packs in Loco Translate is coming. Keep an eye on progress
   here:
 * [https://wordpress.org/support/topic/wp_set_script_translations/#post-11065440](https://wordpress.org/support/topic/wp_set_script_translations/#post-11065440)
 * Note that WordPress itself does not currently install JSON language packs for
   themes and plugins. This is coming soon I’m told.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Extract strings from JavaScript files’ is closed to new replies.

 * ![](https://ps.w.org/loco-translate/assets/icon-256x256.png?rev=1000676)
 * [Loco Translate](https://wordpress.org/plugins/loco-translate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/loco-translate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/loco-translate/)
 * [Active Topics](https://wordpress.org/support/plugin/loco-translate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/loco-translate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/loco-translate/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/extract-strings-from-javascript-files/#post-11065454)
 * Status: resolved