The MU forums have moved to WordPress.org

Multilingual support options? (11 posts)

  1. jdoyon
    Member
    Posted 15 years ago #

    Hello,

    I'm trying real hard to get proper multilingual support in MU going, but without much luck.

    One root problem seems to be that to REALLY switch language, you need to change the language setting AND the theme. Even in a standard unilingual setup, as best I can figure, I need to change the language AND the theme to match.

    Now, there does not seem to be a way simply do that with one action with a plugin (change the WPMU language/theme, but leave the content in just one language).

    There are many multilingual plugins, the best of wich seems to be Gengo. I've gotten it work with MU, but not completely. First there seem to be problems with the rewrite rules on the "root" blog, I get errors. Works ok on other blogs though. BUT, it onyl translates what is setup to be, and does not switch template. so if I go to french, I get these odd looking sites with half french and half english (french content, some french translations, and then the english out of the template, because it doesn't switch to the french templates automatically).

    Do I really need to rewrite the templates (I'm content with the out of the box/default ones right now)?

    What am I missing here?

    Help!

    Thanks,

    J.F.

  2. illutic
    Member
    Posted 15 years ago #

    Did you actually translate the theme or just add the same files again, but then with French instead of English in it?

  3. jdoyon
    Member
    Posted 15 years ago #

    Well I have the English default theme that comes with it, then while looking for translations, I wound the French version of the default theme. So now I have the translation files and the theme for each language, but no easy way to switch between the two.

    Are there truly multilingual themes out there where one theme will work with any language?

    Even if there was, I still need to find a good way to switch languages (even if only the WPMU parts but not the content).

    Like I said Gengo was misbehaving on the root blog and I didn't see any language switching links appear anywhere on the web page anyways :(

  4. banesto
    Member
    Posted 15 years ago #

    exactly my problem - i have actually two themes already localised - they both are ready to be switched. Both have latvian and russian language .mo files. If i deactivate gengo and change WPLANG to 'lv_LV' or 'ru_RU' both themes act as they are supposed to - both show appropriate language. But when gengo is activated, theme language stays the same (the one defined by WPLANG), still main language is changing (the one in /wp-content/languages/).

    I can see two possible solutions:

    1) hack Gengo
    2) write a theme snippet involving the_language(); function to switch theme language as well. But i don't know the API for this particular feature. Maybe someone can tell me?

  5. banesto
    Member
    Posted 15 years ago #

    I chose 2. option:

    change your theme's functions.php file like that:

    if (function_exists('the_language_code')) {
    $lang_code = the_language_code();
    define('WPLANG', $lang_code);
    }
    load_theme_textdomain('defusion_theme');

    and it's done! just make sure your mo files have the same name as language code. in my case it was lv.mo and ru.mo (not lv_LV.mo and ru_RU.mo).

  6. Zauker
    Member
    Posted 15 years ago #

    i'm lookin too for language switch for WPMU.
    i don't know gengo, but now i'm going look it.
    in past, in a single wordpress, not in WPMU version, i tried successfuly polyglot plugin, they switch main language and set a cookie to set same language when you come back, and if you use the polyglot tag into post text or category the plugin switch also the content...
    for semplicity i use theme that use gettext for all text phrases, so when i switch the main language i have my theme in new language thanks a .po/.mo files.
    i'd like replicate a switch language as in wordpress.com... in the next week i'll try to do it..
    bye
    Michele

  7. fest
    Member
    Posted 15 years ago #

    I have to post this here not in Gengo support forum, because my account is still not approved by their admins.

    I'm trying to use Gengo(2.5.3) with WPMU (2.6.5).
    So far, I have encountered only three problems:
    1) In administration panel, when I select Gengo'ized blog (not all of them are Gengoized), and all the blog titles at the top menu become equal to Gengo'ized blog's title.
    2) I can't translate category names. I mean, the only category which is displayed is uncategorized, but I have created others as well.
    This is a big issue and I will fix this first. Or at least, I will try to fix it.
    3) Template language doesn't get switched (the problem creator of this topic encountered). This will have to be fixed as well.

    Once I fix these problems, I hope not to run into another ones, but the idea to have seperate Wordpress installations per each language scares me. I was tired to manually update plugins for one site but now I'd have three of them (similar functionality but different themes).

  8. fest
    Member
    Posted 15 years ago #

    Okay, I managed to fix the second problem- Gengo used create_term hooks, which were called before the term id was finalized, and term_id was pseudo-random temporary id.
    It has to use created_term, edited_term, and deleted_term hooks.
    Here's a quick fix:

    215,218c215,217
    < 			//@WPMU FIX: create_term is called before finalizing term_id and some kind of pseudo-random temporary ID was passed to handler.
    <             add_action('created_term', array(& $this, 'create_term'), 10, 2);
    < 			add_action('edited_term', array(& $this, 'edit_term'), 10, 2);
    < 			add_action('deleted_term', array(& $this, 'delete_term'));
    ---
    > 			add_action('create_term', array(& $this, 'create_term'), 10, 2);
    > 			add_action('edit_term', array(& $this, 'edit_term'), 10, 2);
    > 			add_action('delete_term', array(& $this, 'delete_term'));

    Not sure if it breaks Gengo compability with ordinary Wordpress, though. In theory, Wordpress has created_term hook too, so it should work. I'll try to contact the developers of Gengo to submit this patch.

  9. fest
    Member
    Posted 15 years ago #

    I managed to solve the third problem too:
    if I comment out add_filter ( 'locale', 'mu_locale' ); in wpmu-default-filters.php everything works. I guess that this hook was called before gengo's hook and loaded a default domain which can't be changed later.
    Not sure if I haven't broken anything, but so far, everything seems to work.
    I know, that this is a dirty hack, but I really need to get WPMU to work with Gengo :>

  10. fest
    Member
    Posted 15 years ago #

    And one more issue: search page breaks everything- it looks like gengo isn't loaded at all when search is performed.

  11. icanlocalize
    Member
    Posted 15 years ago #

    You might be interested to hear that the WPML plugin implements multilingual support for WP and runs perfectly well on WPMU (in fact, we're using WPMU for our own multi-scenario testing).

    Here's the plugin page:
    http://wordpress.org/extend/plugins/sitepress-multilingual-cms/

About this Topic

  • Started 15 years ago by jdoyon
  • Latest reply from icanlocalize