WordPress.org

Ready to get started?Download WordPress

Forums

Bilingual, div fonts getting mixed up (5 posts)

  1. Harvey
    Member
    Posted 8 years ago #

    Hello everyone, my site is biligual, using a solution I found here

    http://frenchfragfactory.net/ozh/archives/2004/05/11/a-solution-for-a-bilingual-wordpress/

    that was mentioned on another thread. If you click the upper right English and Japanese on my site, you'll see that the language in the latest post will flip from one to the other.

    As you can see at http://www.japannewbie.com the font in the latest post, and the posts below, are different. This is what I want to fix.

    In order to make the posts bilingual, I have to use code like this when posting my entries.

    <div lang="en">ENGLISH TEXT</div>
    <div lang="jp">日本語 Japanese TEXT</div>

    I tried to force in P tags around the div tags to make it follow the regular style, but seems that after I save, it's always revered back and my P tags have been removed...

    Any ideas on how I can implement this Bilingual DIV tag solution, while retaining my theme's style?

    Any help appreciated!

  2. Kafkaesqui

    Posted 8 years ago #

    "I tried to force in P tags around the div tags to make it follow the regular style, but seems that after I save, it's always revered back and my P tags have been removed..."

    That's because it's invalid XHTML. divs cannot reside within p(aragraph) tags. Have you tried placing the paragraph tags *within* the div tags?

    Another option would be to swap the div with p, and use:

    <p lang="en">ENGLISH TEXT</p>
    <p lang="jp">日本語 Japanese TEXT</p>

    Of course, this would require changes to Ozh's javascript.

  3. Harvey
    Member
    Posted 8 years ago #

    Thanks for the tip Kafkaesqui, when putting the p(aragraph) tags within the div, they get removed out by WP as well. This system is smarter than me!

    Can I ask how I would need to modify the javascript to allow me to set the LANG with P instead of DIV?

  4. Harvey
    Member
    Posted 8 years ago #

    Is it possible to use the lang="en" attribute AND the class="?entrada?(in my case) attributes in the same DIV?

  5. Kafkaesqui

    Posted 8 years ago #

    First Q: In the javascript you *should* be able to change these various lines:

    document.getElementsByTagName("div")

    to:

    document.getElementsByTagName("p")

    Second Q: Yes, div (and p) tags accept both a lang and class attribute. I can't say if they'd affect the javascript you're using (not without being able to test it from here, that is).

Topic Closed

This topic has been closed to new replies.

About this Topic