This is “normal” in WordPress 5 as this is what the new wp_set_script_translations function is for.
The function tells WordPress to associate a JSON file containing translations with a specific script that will make use of them. It makes use of them as you see, by embedding the translations as JavaScript objects.
You say this is not secure, but you don’t say what you’re concerned about. I would say it’s as secure as any file you allow onto your server. You install PHP code from trusted sources and allow it to execute. Likewise with JavaScript. So apply the same caution to translations and don’t install language packs from untrusted sources!
Related Posts:
- How to get a localized version of WordPress from a repository?
- generating po mo translating files from scratch in a wordpress theme
- How to escape the single quote character in i18n translation strings?
- Changing the language of a single page
- what’s different between _x() and _()
- Obtain a list of available translations
- custom theme: english .mo file not working
- Unknown language json files
- How to escape single and plural i18n text strings?
- What are the most used WordPress localization?
- How to add extra language packs to WordPress
- load_plugin_textdomain in `plugins_loaded` or `init`?
- How to Translate Contact Form 7 using qTranslate? [closed]
- Translate Navigation Menu & Sidebar Widget Titles
- How to handle single quote in a translatable string in WordPress
- Translation of plugin in MU-PLUGINS directory not working
- How can I make “Leave a comment” translation ready?
- I can’t translate text in my plugin using a .mo file, load_plugin_textdomain() function is always false
- Multiple text-domains per single plugin – admin and frontend
- Where the WordPress Core Translation is “actually” taking place?
- Do i have make the content() also translation ready in theme?
- Transfer from English page to Arabic page
- How to translate theme name
- How to get menu strings, categories and tags into po file for translation
- How to save a translation of a plugin in “CodeStyling Localization”?
- Compile errors during translation compile
- Using polylang, how can I see which post is the “original” and which are the “translated children”? [closed]
- Proper way to create / manage gettext (.po, .pot) files?
- Where is the right .mo file inside the language repository?
- setlocale for date
- where to set the PO file for a plugin?
- Change / tweak existing wordpress translations
- Should I include colon in my msgid in PO file?
- How to display get_post_type() translated?
- Replace text string on individual page
- loco translate plugin edits file in plugin folder
- How to add LTR to a custom theme which in RTL by default
- How to syntax Json output for translation?
- Translating a word with locotranslate, but wordpress does display another by default
- Translating publish dates to Arabic
- Translation for frontend
- How do I translate month names in post metadata?
- Can’t have a Persian website with a completely English admin panel!
- How can i merge the translations from one .po file into the source on another .po file?
- Translatable Categories
- Force translated language on front
- Translate theme only
- Translating plugin or locale file
- what’s different between _x() and _()
- WordPress translation loading english file
- Is there any way to use @wordpress/i18n for
- How can I see my theme’s text domain?
- Language file doesn’t work
- Making a string translation ready with html in it
- Translation for plugin
- How to become a translator on wordpress.org?
- Translation from .mo file not working in theme
- Plugin has no US english translation file
- Localization, escape html elements mid-sentence
- English version of my site show french strings [closed]
- Translation with wordpress what does the process involve?
- How to translate custom Divi module using POEDIT and Polylang [closed]
- How to translate functions.php?
- How do you translate comments_number function text in a theme?
- How to add a translatable string to post date
- Proper way to use esc_html__ and esc_attr__ etc for escaping value for translation
- How to use esc_attr__ with custom translation function?
- Programmatically choose language for translation
- Post types translation
- Translate arguments of a user added custom code [closed]
- How to define theme translation file?
- WordPress translator plugin: Google Webmaster’s Tools shows hundreds of 404 not found errors. How to clean the mess?
- String translation for esc_html__() when registering string [closed]
- Automatic translation with different domains per languages?
- Translations not working on Safari
- __() function inside html tags
- How to do translations in WordPress?
- How to get dashboard langauge not the website language?
- printf, translation function and date_i18n adds extra characters
- Qtranslate-X get raw post title value
- How to deal with differently translated prepositions?
- qtranslate loading the wrong language
- issue in translating a wordpress them
- Understanding WordPress Default Theme – twentyfifteen.1.4 >> Languages Folder
- WordPress Localization error within return value
- Custom theme .mo translation file not working
- Plugin translation not displaying
- Adding a translation phrase to WordPress Theme
- Language & translation
- Translating form labels shortcode output
- How to translate placeholder?
- Archive widget numbers translation?
- Poedit ASCII errors ( WordPress )
- Does WPML translate numbers automatically, or do I have to do the string translation? [closed]
- WPML & Events Manager translatable fields after duplication
- Translating “comments”, “leave a comment”, “prev”, “next”, “share”
- Website Language/Locale Switching
- Can’t load text domain in a mu-plugin
- multisite same language different translation
- Translate via URL parameter working only in localhost