WordPress.org

Ready to get started?Download WordPress

Forums

Load custom language file in template (1 post)

  1. Streamline
    Member
    Posted 3 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic