Support » Plugins and Hacks » Hacks » Load custom language file in template

Load custom language file in template

  • Hi, guys!

    I’m working on a project right now that needs 3 different language support and i don’t want to use any kind of plugins that switch and add languages.

    I have downloaded all three language .mo and .po files and would like to serve them according to a page where user is located (using some simple if) but what i don’t know is how to tell wordpress code to use this or that language file.

    I’m thinking about something like this:

    if is_page('Russian'){
        define ('WPLANG', 'rus');
    esle if is_page('Spanish'){
        define ('WPLANG', 'spain');
    else ...

    How to accomplish this, maybe someone knows and has had some experience previously?

    Thanks in advance!

  • The topic ‘Load custom language file in template’ is closed to new replies.