esc_html_e()
and esc_attr_e()
are merely wrapper functions for _
to save a little bit of typing and help with readability. You’re right, there isn’t one for _n
, so you’ll just need to do the “wrapping” yourself:
printf(
esc_attr(
_n(
'%s item',
'%s items',
$count,
'textdomain'
)
),
number_format_i18n( $count )
);
Related Posts:
- How to get a translated string from a language other than the current one?
- How to get a localized version of WordPress from a repository?
- Working with l10n contexts (_x etc)
- How to escape the single quote character in i18n translation strings?
- What are the most used WordPress localization?
- Difference between 2 internationalization (i18n) functions __() & _e()
- Localization works but still get “This plugin is not properly prepared for localization” msg in directory
- How to load theme textdomain from plugin?
- get_the_date() for translating date format
- Should i use _n for pronouns in translation?
- POEdit with Custom mu-plugins code
- How does WordPress choose which translation file to use?
- Proper way to create / manage gettext (.po, .pot) files?
- Should I include colon in my msgid in PO file?
- _e() function get text_string from function
- Translations not returning translated strings
- Force translated language on front
- Translating dynamic strings
- WordPress translation loading english file
- Easy export/import of data for Translation
- WordPress Theme .mo-file won’t load
- How to become a translator on wordpress.org?
- Translation from .mo file not working in theme
- Localization, escape html elements mid-sentence
- WordPress localization – gettext and git
- Can I set WordPress to display languages based on system language without a plugin?
- /languages/ folder missing in default themes
- How to translate functions.php?
- WordPress Translations
- Post types translation
- Translate arguments of a user added custom code [closed]
- Internationalize plugin so strings can be translated in WPML [closed]
- localization of theme and plugins to English (originally in another language)
- Interface translation without plugins
- Plugin localization persistance (woocommerce)
- WordPress Localization error within return value
- Custom theme .mo translation file not working
- Plugin translation not displaying
- WordPress translation
- Tweak the loop for translation
- Translating form labels shortcode output
- Website Language/Locale Switching
- .po file is loaded but changes are not appearing
- How to create .pot files with POedit?
- How to make a WordPress plugin translation ready?
- Different Language for Frontend vs Backend
- How-to: Translate plural forms for themes/plugins with PoEdit
- generating po mo translating files from scratch in a wordpress theme
- custom theme: english .mo file not working
- Unknown language json files
- Set language per post
- What is the purpose of an extra file for translation?
- Problems with localization
- Why should I escape translatable strings? and how shall i do that?
- Can’t we use strings defined as PHP constants if we want to translate them in a plugin?
- I can’t translate text in my plugin using a .mo file, load_plugin_textdomain() function is always false
- How to add translation for a string
- How to translate a WordPress.org plugin?
- How do I translate this string – PHP syntax question
- New plugin translation does not work
- Make changes to translation?
- Gutenberg not all editor text translated
- WPML Translated Term
- How to i18n text coming from the db or from an external source
- How to translate functions like get_the_date()?
- translating wordpress with poedit
- variables in translatable text
- How to add LTR to a custom theme which in RTL by default
- Generate PO File
- Updating WordPress Theme/Plugin POT file without losing line numbers consistency
- Use translated taxonomy labels in plugin
- Translation for frontend
- Translate pages and URLs without duplicating
- How can you locate the .po file used for translation of a page?
- Single translation for many locales
- Is there a way to test that readme looks in other language before submitting translation?
- Using _e() or __() to translate text with div
- How to solve a translation function issue with no arguments and missing a text-domain?
- Translation is not being output in one instance
- Why translations?
- Translation issue with global variables
- How to ignore extra whitespaces in translation functions like _e?
- Fix Problem With Textdomain Translation
- POEDIT – Continue with translations
- Plugin not properly prepared for localization
- WordPress translator plugin: Google Webmaster’s Tools shows hundreds of 404 not found errors. How to clean the mess?
- POT file generated using WP-CLI does not retrieve strings from translation functions with FQN (Qualifier)
- Using wp-cli to create a .pot file that interprets .twig files as well
- String translation within WordPress multisite with i18n not working on all sites
- Translate string inside twig template
- How to call wordpress API to translate a post request
- How to get dashboard langauge not the website language?
- Translate wordpress without duplicate custom post
- WordPress in French Language [closed]
- I dont know why my localization is not working
- How to ‘manually’ load translations/test domain outside theme context?
- Locale changed but plugin still showing default language
- White Space on translated strings lost
- Can’t load text domain in a mu-plugin
- Admin Notice is only localized when displaying the “Plugins” Backend Page