• I am trying to make a theme translatable. With one term, I am having some trouble.

    This code:

    <?
    $c = get_the_category_list(', ');
    var_dump($c);
    echo $c;
    _e("$c");
    _e("Uncategorized") ?>

    Outputs:

    string(145) "Uncategorized"
    Uncategorized
    Uncategorized
    Okategoriserade

    My WordPress installation is set to use a Swedish locale. As you can see, the last call to _e() works, other doesn’t. WHY? What do I need to do to the variable before I pass it to _e()?

    Using 2.9.2

    Thank you,
    Carl

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter calleo

    (@calleo)

    Thank you! Ok, this seems to apply (from the link above):

    echo "We deleted $count spams."
    
    It won't work! Remember, the strings for translation are extracted from the sources, so the translators will see work on the phrase: We deleted $count spams.. However in the application _e will be called with an argument like We deleted 49494 spams. and gettext  won't find a suitable translation of this one and will return its argument: We deleted 49494 spams.. Unfortunately, it isn't translated correctly.

    How does one translate the category names properly then?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wierd behaviour of _e() and __()’ is closed to new replies.