Language Switcher

Posted on

I have found a great plugin for WordPress: Language Switcher.

Just one issue so far: NextGEN Gallery widget does not allow to edit its title to switch between languages.

Well, and it’s nesessary to edit theme files — replace „smth” with __(‘smth”), and «correct» language file (<lang>.po, and converting to .mo with command msgfmt <lang>.po -o <lang>.mo).

2 Replies to “Language Switcher”

  1. Yes, i’ll try :-)

    1. NGGallery is great. To display its widget title in different languages you simply need to have you specific title translated in WP’s “global” .mo file (is it clear? my english is poor, sorry) — and find in nggwidget.php line like
    echo $before_widget . $before_title . $options[$number][‘title’] . $after_title;
    and replace it with:
    echo $before_widget . $before_title . __($options[$number][‘title’]) . $after_title;

    2. You theme files often may be “untranslated” — they often contain english names for titles etc. To have them translated, you need replace every displayed “word” with (or _e(‘word’) in place of __(‘word’) — depending of ‘word’ is printed on screen or used in variables to be printed later).

    3. Sometimes (as with NextGen Gallery) you need to add some word to you language’s .po file (uk.po, or uk_UA.po for Ukrainian) and then convert this .po to .mo (every software with gettext support looks into .mo files for translated messages)

    Topic 2 covered great at Language Switcher Home.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.