[resolved] [Plugin: Codestyling Localization] Translations partially don't work (1 post)

  1. floridiculous
    Posted 5 years ago #

    I just wanted to post a short solution for a problem I had when using the Codestyling Localization plugin to translate some phrases, that I introduce in two custom taxonomies. Maybe someone else can profit from it.

    My code containing the terms which shall be translated looks like this:

    function create_eventlocation_taxonomy() {
    $labels = array(
       'name' => _x( 'Locations', 'taxonomy general name', 'my_textdomain' ),
       'singular_name' => _x( 'Location', 'taxonomy singular name', 'my_textdomain' ),
       'search_items' =>  __( 'Search Locations', 'my_textdomain' ),
    add_action( 'init', 'create_eventlocation_taxonomy', 0 );

    Then I used "Codestyling Localization" to translate those phrases. This worked up to a certain point: Many (about 40) phrases got translated correctly, the rest just stayed in English. Furthermore my translated slug for the taxonomies did not work within the frontend.

    I figured out that the hook should not be called with a priority that low. By changing the hook to
    add_action( 'init', 'create_eventlocation_taxonomy', 0 );
    (and therefore giving it the default priority "10") I got the entire translation to work.

    Unfortunately I'm not knowledgable enough about the action hooks to tell why the translation process stops right in the middle.


Topic Closed

This topic has been closed to new replies.

About this Topic