No, you wouldn’t use the translation functions (__()
, _e()
etc.). Those are for creating language files and must only be used on static strings. They need to be static because the tools for generating the language files don’t execute PHP, so they can’t process variables. They just parse the text of the code, essentially.
If you want to support multilingual plugins then you need to build that support in manually with whatever methods those plugins require. WordPress won’t help you here. So you’ll need to check the developer documentation of the multilingual plugins that you want to support. Here’s some documentation for adding multilingual support for custom content for WPML, for example.
Related Posts:
- Borrowing of Previously Translated Strings by Child Plugin
- How to make a WordPress plugin translation ready?
- How to provide translations for a WordPress TinyMCE plugin?
- Problems with localization
- How does gettext works for translating readme file of plugin?
- `wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin
- Can’t we use strings defined as PHP constants if we want to translate them in a plugin?
- WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
- use __($str) to translate strings (symfony/twig)
- Plugin Localization
- Is it possible to check is loaded language files correctly with WordPress plugin?
- Translate strings not recognised in plugin
- How to i18n text coming from the db or from an external source
- Should I always prefer esc_attr_e & esc_html_e instead of _e?
- Should shorcodes in i18n plugins be translated and if so, how?
- Widget translation on my plugin
- Plugin translations not installed but… strings are translated!
- .mo translation strings not loading in PHP scripts that handle AJAX calls
- Generate JSON files for language translation from po file without wp-cli i18n make-json
- Build a translation correcter plugin
- Translation per IP location [closed]
- Translate slug in WPMU with PO files
- Translate MCE button text/tooltip in custom plugin
- esc_html__() and __() not working within arrays
- How to prevent someone from entering strings without making it available for translation?
- Readme.txt seems to be cached but not the version
- Return Value of load_plugin_textdomain
- Translate javascript with WordPress built-in localization API for static strings
- Plugin language always shows WP site language, not profile language
- Is hint for translator compulsory while internationalizing a string containing variables?
- Translating plugin settings page – dropdown list
- Using HTML links within translatable string
- How to translate wordpress backend to another language
- Translations only load from `wp-content/languages/plugins` but not from the plugin’s languages folder
- Include external po file for 3th party plugin to theme
- HTML Elements in my WP Plugin being generated in JS. Security and Translated Text Question about this method being used
- Default media uploader is not showing in wordpress website
- Load custom translation in custom plugin fails
- Add language localisation to javascript alert?
- How to store in the database directly the translation?
- Translation not working for Constant strings in Plugin
- Load textdomain from global languages directory
- Plugin translation not being displayed
- Problem with Poedit [closed]
- How to translate WP plugin name?
- get the queried_object of an url
- Save translation file of third party plugin in a custom plugin?
- Translations not making it into Block UI but work in the rest of the plugin
- How to use native wordpress translation domain inside a custom plugin?
- Shortcode content is not showing. Only the [shortcode-tag] is showing
- Post is uncatagorized in publish_post action
- get_queried_object_id combined with wp_redirect gets wrong id
- Stuck on a 504 error
- When does global/main code of plug execute?
- Using WordPress Boilerplate (WPBP) for WP Multisite Plugin
- How to prevent wp_insert_post from creating a new post every second?
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)
- WordPress Filesystem create CSS-File – get Shortcode ID for Name
- WordPress5.2.3: Better File Download Plugin validation issue
- How do I make secure API calls from my WordPress plugin?
- WordPress custom block compatability with WPML
- esc_attr() on hard coded string
- How do I ensure I can loop through every enqueued script and CSS?
- Gutenberg component in a plugin admin
- Creating a return url for getting data from external api
- Always hide a page from the menu
- WordPress discards PNG file when uploading plugin file
- Hook for validating and rejecting frontend image upload
- What is the source of the $post_id in a hook argument?
- WordPress Fatal error: Uncaught Error: Call to undefined function dbDelta()
- Custom Admin Plugin – Injecting repeatable select fields (add, remove) into an Ordered List
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- Overriding the template files using a plugin for all themes
- Nested Hooks with do_action for performance reasons – safe/necessary?
- WordPress custom url without using any of the custom tags given
- Counter not working correctly
- Generate Static Page to Show Search Results/Detail for API
- User meta query using Wildcard
- How do I use a plugin to swap out the template file for a custom post type?
- WordPress with React: Saving and Using Data Collected with fetch
- use a (Polymer) web component within a plugin (or theme)?
- Custom Post not Deleting on Uninstall
- Scripts/styles not loading on cloned WP Site when logged in
- how to add security questions on wp-registration page and validate it
- Multiple instances of $opt_name in redux framework
- Don’t print customizer styles when no setting has been used
- Initializing rest endpoint issue
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- Append php file to footer
- Integrate separate web app inside wordpress [closed]
- How to avoid conflict if a plugin already have included open library?
- Can’t get wpColorPicker to work in a widget
- WordPress OOP get current user question?
- Plugin Activation Causes wp_register errors
- Add quick edit functionnality to plugin table
- How to filter an action inside class in MemberPress plugin?
- AJAX call of function containing javascript which is not loaded (Plugin development)
- XMLHttpRequest to open PHP file responds with Missing Page
- Including content into an add_shortcode() function
- Get the current post/page URL with plain permalinks