• I’m using Roots theme and WPML. I did some research on gettext, _e and text domains. Right now WPML is set up along with Roots to translate the title, description, and keywords.

    The index.php file has the header/titles translated:

    <div class="page-header">
    <h1><?php _e('Latest Posts', 'roots');?></h1>
    </div>

    However, how do I translate the content on my page? I’m guessing I need to edit loop-page.php and the_content(). I’m not exactly sure what to do at this point?

Viewing 3 replies - 1 through 3 (of 3 total)
  • There are translation plugins for content, and things like that… or you would write in the appropriate language in the first place.

    _e and things like that are for translating parts of the theme/plugin. Static stuff.

    You can’t translate dynamic content in the same fashion

    the_content refers to a million different things. It’s dynamic, it changes in every post. So you aren’t going to have static translations sitting in a language file to translate every iterance of all content.

    The functions you are pointing to aren’t magic… they don’t translate anything in an automatic fashion. They point to a language file that can sub out terms for a different term

    Thread Starter MountainTop

    (@mountaintop)

    Thanks for explaining it to me.

    I thought maybe WPML automatically translated everything, but as I read more you can, like you said, only translate static content and everything else has to be manually translated or sent through the plugin to translators.

    You’ve got it!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘_e Function for Conent’ is closed to new replies.