I would opt for readability and use a rather verbose solution:
if ( 1 == $hours and 1 == $mins )
{
_e( 'One hour and one minute', 'your_text_domain' );
}
elseif ( 1 == $hours )
{
printf( __( 'One hour and %d minutes', 'your_text_domain' ), $mins );
}
elseif ( 1 == $mins )
{
printf( __( '%d hours and one minute', 'your_text_domain' ), $hours );
}
else
{
printf( __( '%d hours and %d minutes', 'your_text_domain' ), $hours, $mins );
}
Related Posts:
- How to get a translated string from a language other than the current one?
- Working with l10n contexts (_x etc)
- WordPress localization – gettext and git
- localization of theme and plugins to English (originally in another language)
- How to ‘manually’ load translations/test domain outside theme context?
- Different Language for Frontend vs Backend
- Custom strings for translation using Polylang plugin
- How to get a localized version of WordPress from a repository?
- How-to: Translate plural forms for themes/plugins with PoEdit
- generating po mo translating files from scratch in a wordpress theme
- How to handle text with function __(?
- Disabling Translation Update
- Gettext details
- How to save a translation of a plugin in “CodeStyling Localization”?
- Set language per post
- List of Default Translated Phrases
- How to extract translatable (double underscores and _e) strings?
- How to set locale in ajax requests?
- Localization works but still get “This plugin is not properly prepared for localization” msg in directory
- Translate content, not instance, per-post
- Why should I escape translatable strings? and how shall i do that?
- How to load theme textdomain from plugin?
- Make theme translatable for WPML
- get_the_date() for translating date format
- Custom translation of Month names
- Should i use _n for pronouns in translation?
- 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?
- New plugin translation does not work
- POEdit with Custom mu-plugins code
- Make changes to translation?
- Gutenberg not all editor text translated
- How does WordPress choose which translation file to use?
- Is this a correct usage of esc_html_e?
- WPML Translated Term
- How to translate functions like get_the_date()?
- translating wordpress with poedit
- WPML custom string translation get outside of container
- Change template copy with po/mo files
- Implementing conditional gettext translation
- How to add LTR to a custom theme which in RTL by default
- _e() function get text_string from function
- Updating WordPress Theme/Plugin POT file without losing line numbers consistency
- Translations not returning translated strings
- Translation for frontend
- Can’t generate pot file using wp cli
- How to translate timestamp?
- How to override default WordPress core language file
- Translate pages and URLs without duplicating
- How can you locate the .po file used for translation of a page?
- Single translation for many locales
- Translating dynamic strings
- How do I troubleshoot translation issues?
- Easy export/import of data for Translation
- How to change a word in theme?
- Using _e() or __() to translate text with div
- Translation from .mo file not working in theme
- Is it best practice to use English as the base of a translation-ready theme?
- How to solve a translation function issue with no arguments and missing a text-domain?
- WordPress Translation Issue
- How to translate “$before” with get text in get_the_term_list?
- Translation is not being output in one instance
- Get Text Domain For Transalation
- Why translations?
- Found a translation function that is missing a text-domain. Function _n
- Can I set WordPress to display languages based on system language without a plugin?
- Fix Problem With Textdomain Translation
- /languages/ folder missing in default themes
- POEDIT – Continue with translations
- WordPress Translations
- Trying to localize a Underscores starter theme [duplicate]
- mo / po translation files does not seem to work
- WPML icl_register_string() throws fatal error but works [closed]
- Internationalize plugin so strings can be translated in WPML [closed]
- Problem with Language translation
- 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
- Making WP theme / plugin multii-lingual without plugins
- Translate string inside twig template
- How to call wordpress API to translate a post request
- Changing text for “Continue reading…” translation
- Can’t translate child theme
- How to get dashboard langauge not the website language?
- Translate wordpress without duplicate custom post
- How to Convert Date to Thai
- WordPress does not translate
- How to use translation functions inside WordPress page
- Plugin localization persistance (woocommerce)
- Translate Plugin with french as base language
- WordPress translation
- Tweak the loop for translation
- White Space on translated strings lost
- String translation with or without po file
- Theme translation file translating some strings and not translating others
- multisite same language different translation
- How to find posts that are missing translation? (wpml)
- Translate via URL parameter working only in localhost
- .po file is loaded but changes are not appearing