WordPress.org

Ready to get started?Download WordPress

Forums

Change language at runtime (4 posts)

  1. Benji007
    Member
    Posted 2 years ago #

    Hi there,

    I was wondering if anyone could help me.. I created a small site and it has 2 languages.. To devide the posts, I simply give them a different language-category...

    To determine which images to put I simply do a check, for example:
    " <?php if (in_category('fr')) { ?>". You get the idea..

    Now, that leaves me with one problem.. I'd like to switch the wordpress language on runtime also.. but I can't seem to find how?
    Is it possible at all?

    I'd like to somehow do it when the page is being loaded:
    Something like:
    <?php if (in_category('fr')) {
    define('WPLANG', 'fr_FR');
    ?>

    Any help would be much appreciated!

    thanks in advance,

    Ben

  2. JGeo
    Member
    Posted 2 years ago #

    I am looking for the same thing. Can't get it to work.

  3. Andrew Bartel
    Member
    Posted 2 years ago #

    Did you try that? It might work assuming you have the MO file installed.

  4. JGeo
    Member
    Posted 2 years ago #

    Maybe I didn't put the lines in the right place. Which file/location (Twentyten theme I'm using) should I paste the code?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags