In the __()
documentation, it says
If there is no translation, or the text domain isn’t loaded, the original text is returned.
Also, if you don’t provide a textdomain, then 'default'
is used.
So, essentially, __( 'Name' )
will try to find a translation in the 'default'
domain, and, failing that, return 'Name'
.
If you do provide your own textdomain (eg __( 'Name', 'my-plugin-text-domain' )
) but no translations, then the untranslated string will be used. There is, as far as I know, no downside to this, and it has the upside of making your theme or plugin translatable by you or others who wish to do it in the future.
Related Posts:
- Localizing text from XML files
- What is the difference between the .po .mo and .pot localization files?
- How to make a text with hyperlink translatable in WordPress?
- What’s the point on gettext syntax?
- Translate a string to a language with masculin/feminine nouns
- Change locale manually at runtime?
- Text Domains Across Multiple Plugins & Themes
- Can we load “load_theme_textdomain” multiple times with different domains?
- Where are the official i18n WordPress versions stored (SVN)?
- localize inline css
- Can we use a variable hook for language string?
- Locale filter in conjunction with new datepicker localization
- How to use is_rtl with my main style.css?
- Localizing strings that come from outside of plugin?
- Alphabetical sorting – local language
- How to detect if text domain is already loaded?
- does a translation (i18n) have to start from an english PO?
- _n() Single and Plural for search results?
- Can’t we use strings defined as PHP constants if we want to translate them in a plugin?
- __() with sprintf returns untranslated string
- How to add i18n to a plugin’s Twig template files?
- load_child_theme_textdomain doesn’t work in function.php
- How to prepare SimplePie_Item’s get_date() for l10n?
- The effect of x() family of functions
- How to translate multi-line strings?
- get_locale() behaving strange in same functions.php file
- Do I need the .po file for my plugin?
- WordPress theme with frontend in different language than backend?
- Change WordPress Language
- Strings including html for localisation
- Is it possible to set a different frontend- and backend-language?
- Possibility to use WordPress built-in localization
- Can any users change locale language?
- Localized version offers upgrade to en-us version
- Using WordPress gettext functions in a library outside plugin or theme scope
- Local WordPress installs don’t verfiy against wp-cli checksum check and how to fix that issue.
- Loading custom language file for plugin
- sprintf bloginfo odditie
- Unable to find where to translate certain tooltip string
- WP core emails translated
- How to translate theme content using site language?
- How can i localized html or php source code from wordpress [closed]
- Setting frontend locale based on postmeta not loading translation
- Using esc_attr function
- Change WordPress language based on user setting
- Define locale WordPress uses with gettext functions?
- Site does not display translations
- Theme doesn’t want to load localization files
- How to prevent someone from entering strings without making it available for translation?
- User specified Timezone
- Plugin translation ready – mo file not loaded
- Problem with adding a new post type
- Do I have to use load_plugin_textdomain() or is there any default folder for languages?
- Get localized user roles
- Can I set WordPress to display languages based on system language without a plugin?
- How to ignore extra whitespaces in translation functions like _e?
- Internationalization of strings with html tags and numbers in WordPress
- Localization of WP theme
- Change post date format to hebrew calendar
- failed to open stream: Permission denied warning while load_textdomain
- Requiring Once into plugin PHP File not working
- Where does the locale come from?
- When localizing a theme do I create the .mo and .po
- Localization Problem: Doesn’t Display Translated Words
- wordpress localization extending
- How to localize built-in strings in a future-proof manner?
- How to find which .mo file is responsible for displaying a particular localized string?
- Is there some ways to autofix the mo or po files instantly?
- I want to dynamically create i18n ecosystem in WordPress
- Language string not detecting used within the function
- Why does my WordPress Upgrade version have a language suffix?
- How to disable gettext feature?
- WordPress in French Language [closed]
- How do I make this plugin translation-ready?
- Translation not working for Constant strings in Plugin
- how to use a default MO file
- Localization of menu items
- Warning: The actual loaded translation content contains mixed textdomains and is not pure translateable within one textdomain
- Is it wrong to use the English version of WordPress to server a site in a different language?
- Hack nav menu to add gettext() to menu items?
- WordPress NavXT plugin localization
- Why is setlocale() returning false on WPEngine?
- WordPress emails translate to French
- How to create some sort of word mapping?
- Is this really always bad? (variables in l10n functions)
- How to change text depending on the country
- How to dynamically change the locale?
- How to show the front end in a different language? I am using the twentytwentythree theme
- i18n: How do I load translations for a language specified in the request?
- How does printf( __( ) ); work?
- How to integrate get_post_time with date_i18n function?
- Multiple Permalinks for Same Post
- Should I always prefer esc_attr_e & esc_html_e instead of _e?
- How to translate get_intermediate_image_sizes?
- Localization: I want the backend: english and frontend in defined language
- Multisite WPLANG won’t save
- redirect to a child theme based on the town of Internet users in france with the verification of the ip address
- Prevent Company Name From Translating
- Enqueue Stylesheets After Theme’s “rtl.css”
- Import js variables loaded via wp_localize_script() into js module without global scope connection