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?
- Post meta vs separate database tables
- How to add a javascript snippet to the footer that requires jQuery
- Enhance Media Manager for Gallery
- Replace audio/video enclosure with player?
- Contact Form 7: wp_mail doesn’t work after update to 4.6
- Gutenberg ServerSideRender is deprecated, how to work with new wp.serverSideRender component?
- Add an image gallery to a custom post type?
- Unit testing wordpress plugins with plugin options
- Create a clickable name in WP_List_Table for Plugin Admin
- Plugin development without Theme adjustments?
- How to Make a Category Always Selected?
- WordPress Localization and Templating
- Why after a file is programmatically deleted, is there still a reference in the media library?
- Ethics question: what qualifies as a fork? [closed]
- Plugin settings not saving
- How to replicate Media Library “Add New” on Plugin Settings Page
- Best way to save custom css for an block
- How to hook a custom user function to a wordpress core ajax action?
- Sending post request with wp_remote_post not working correctly
- Plugin callback page
- Is nonce in PHP form and Ajax both necessary?
- Input value from metabox is not found in $_POST after post save
- CMB2 Form Throws No Input File Specified in custom WordPress Plugin
- Input in plugin widget does not allow spaces
- Enqueue script globally
- White screen when activating plugin that sends form via WordPress
- dbDelta SQL Query Not Working
- Plugin README.txt isn’t updating in the Directory (stable tag is correct)
- How to display the categories on page using shortcode?
- How to call code when adding WooCommerce menu items via woocommerce_account_menu_items
- jquery in wordpress plugin with depdendency
- Plugin creation, restricting access to specific roles
- Ajax +wordpress onClick link redirect to new page and create html content
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- Script to replace default blogroll with links to my social media URLs
- Posts form with AJAX request – Plugin development
- Save meta box data from selected dropdown list in bbpress reply form
- Events Manager: Create custom Placeholder for use in Email notification
- WC REST API Error Handling
- woocommerce add a new bulk action in the bulk actions dropdown in the orders list
- Creating a virtual page without exit
- Building WordPress Themes With Bootstrap with Adi Purdila → TutsPlus
- Allow user to change homepage
- Need to change buddypress profile url by add_rewrite_rule
- Generate activation url
- Use different archive template for plugin
- Get custom wp_query search results to appear on search.php
- Is it safe to use PUT and DELETE requests
- Sharing changes to a post (preview changes) with another user
- Checking if the query is empty does not work
- Remove default wordpress roles
- What is the meta_query key name for the woo product average rating? [closed]
- Why my admin-ajax url returns 0 even after adding echo and die() at the end of function?