Title: Doing i18n wrong
Last modified: November 30, 2018

---

# Doing i18n wrong

 *  ResolvedModerator [tobifjellner (Tor-Bjorn “Tobi” Fjellner)](https://wordpress.org/support/users/tobifjellner/)
 * (@tobifjellner)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/doing-i18n-wrong/)
 * Hi,
 * I just tried to do a bit of translation for WooCommerce… and got stuck.
 * The place I stumbled upon is [https://plugins.trac.wordpress.org/browser/woocommerce/trunk/includes/libraries/action-scheduler/classes/ActionScheduler_WPCLI_QueueRunner.php](https://plugins.trac.wordpress.org/browser/woocommerce/trunk/includes/libraries/action-scheduler/classes/ActionScheduler_WPCLI_QueueRunner.php)
 * Around line 30:
 *     ```
       public function __construct( ActionScheduler_Store $store = null, ActionScheduler_FatalErrorMonitor $monitor = null, ActionScheduler_QueueCleaner $cleaner = null ) {
       	                if ( ! ( defined( 'WP_CLI' ) && WP_CLI ) ) {
       	                        throw new Exception( __( 'The ' . __CLASS__ . ' class can only be run within WP CLI.', 'action-scheduler' ) );
       	                }
       ```
   
 * To en English eye this may look normal. But this is impossible to translate into
   most languages.
    You raise two strings for translation here: “The ” Which in 
   itself, without context means _nothing_, even when you add a space after it.
 * And: “class can only be run within WP CLI.” But without any indication that a
   Class name will be injected before it.
 * Obviously, you need to tie this all together into one phrase that means something.
   And you know how to do it. Just scroll down to line 137-138, for instance:
 *     ```
                       /* translators: %s refers to the action ID */
       	                WP_CLI::log( sprintf( __( 'Started processing action %s', 'action-scheduler' ), $action_id ) );
       ```
   
 * This is so much better: a comment to the translator so they’ll know what’s being
   inserted. And then the whole phrase, so that the German can put their verb towards
   the end and the Russians can use the right forms of all words.
 * I hereby officially declare that I’m not ready to translate the short string “
   The”. Please fix it when you can.
    -  This topic was modified 7 years, 6 months ago by [tobifjellner (Tor-Bjorn “Tobi” Fjellner)](https://wordpress.org/support/users/tobifjellner/).
      Reason: Noted that "The " even ends in a space, which is even weirdier

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Hannah S.L.](https://wordpress.org/support/users/fernashes/)
 * (@fernashes)
 * Automattic Happiness Engineer
 * [7 years, 6 months ago](https://wordpress.org/support/topic/doing-i18n-wrong/#post-10934326)
 * Hey there [@tobifjellner](https://wordpress.org/support/users/tobifjellner/)!
 * I see where you’re coming from and this would require a change to the WooCommerce
   code. Can you please go ahead and report it on the WooCommerce Github repo?
    
   [https://github.com/woocommerce/woocommerce/issues](https://github.com/woocommerce/woocommerce/issues)
 * Thanks!
 *  Moderator [tobifjellner (Tor-Bjorn “Tobi” Fjellner)](https://wordpress.org/support/users/tobifjellner/)
 * (@tobifjellner)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/doing-i18n-wrong/#post-10935503)
 * Oh, Hi there, [@fernashes](https://wordpress.org/support/users/fernashes/)
    Good
   to see ya. Hope it’s not too chilly where you are. I created [https://github.com/woocommerce/woocommerce/issues/22098](https://github.com/woocommerce/woocommerce/issues/22098)
   so closing here. Oh. By the way: that class imported from some other project.
   But I won’t navigate the issue that deep. I’ve got other windwills to hunt for
   🙂
 *  Plugin Support [Hannah S.L.](https://wordpress.org/support/users/fernashes/)
 * (@fernashes)
 * Automattic Happiness Engineer
 * [7 years, 6 months ago](https://wordpress.org/support/topic/doing-i18n-wrong/#post-10944542)
 * Stockholm is boring and grey without snow. 🙂 Hope it’s lovely where you are.
 * Thanks for the update and for sharing the link. Good luck with the other windfalls!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Doing i18n wrong’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [i18n](https://wordpress.org/support/topic-tag/i18n/)

 * 3 replies
 * 2 participants
 * Last reply from: [Hannah S.L.](https://wordpress.org/support/users/fernashes/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/doing-i18n-wrong/#post-10944542)
 * Status: resolved