Resolved in: 4.2.0
We have attempted to implement the string scanning feature in JS files, but we gave up for technical limitations:
– Each string should be attached to the loaded JS file.
– The loaded file is usually a compiled file (i.e. babel / webpack) in which strings cannot be detected properly.
– Even if we could ever link the compiled file to the source files, those source files are usually excluded from plugins/themes released versions so it would be useless for most users.
If you build themes or plugins with strings in JS files, we recommend to build a POT file while compiling the JS script (see also https://developer.wordpress.org/block-editor/developers/internationalization/#provide-your-own-translations).
As the Block editor code is evolving quickly, we decided to wait until it’s merged into WordPress, and with a clear and stable API. Meanwhile, all the string translations in the Block editor will be loaded through the standard WordPress API regardless of WPML localization settings. Because of this, the Block editor strings will not be translated using WPML String Translation.
This should not affect the user experience too much since this new feature is only used in the backend (Block editor) and it is already significantly translated by the community.