WordPress.org

Ready to get started?Download WordPress

Forums

HOW-TO: manage a multi-language blog (13 posts)

  1. _mf_
    Member
    Posted 10 years ago #

    After seing this blog's way of dealing with multiple languages, I realized all one needs is multiple categories.
    I often post in french, spanish or english depending on timing / mood / source of stuff being blogged. I currently use pMachine (so no multiple categories) and I ended up coding some automatic translation support...Not ideal, but enough to calm down some readers :) The solution may seem stupid or obvious (or both!) but I hope this entry will save someone else the time this has been running in my mind... so...
    1) Create a category for each language you post in
    2) Assign the language category in addition to other categories to your posts
    For example, a posting in french about Technology would be in French category AND Technology category. ;)
    I should get some sleep...

  2. Fernán
    Member
    Posted 10 years ago #

    And.... what if you wanted to post something in several languages but not to show it unless the other person clicks on "Spanish translation" or "XXXX translation". It would be cool if those translations were filled in some extra fields, a sort of hack that allows you to post in several languages, not posting different entries, having it all in once, so that the comments are together.
    For example...
    Headline
    bla bla bla bla in English (Spanish flag) (Swedish flag)
    Body in English
    X comments
    That would be the idea ^^ it could also work with one of those hideable things... you know, you click on it and the text enlarges down, you click it again, and it goes up again.... that would be easier perhaps.

  3. KAShirow
    Member
    Posted 10 years ago #

    Easy. Make a new filter for the_content which would cut the posting by tags (<english> </english><spanish></spanish> or just explode by [nextlanguage] or something, if the order of the languages is always the same) and only return one of these segments depending on a cookie set by clicking them flags.
    Extra fields are possible, but much harder to do compared to that.

  4. Fernán
    Member
    Posted 10 years ago #

    Cool if I knew how to do that :D where can I find some help?

  5. KAShirow
    Member
    Posted 10 years ago #

    I'd suggest studying the tabbed sidebar hack in the wiki. Duplicating the method the tabbed sidebar uses to switch sidebar tabs to make it switch your text between languages shouldn't be too hard. Use this as an opportunity to learn something new. :) Learning by doing is by far the best way.

  6. Fernán
    Member
    Posted 10 years ago #

    I'm having problems with my ISP, so I can't edit my blog now, though I can post here. I've saved the code... I'll edit and show you when it's ready. ^^

  7. michelv
    Member
    Posted 10 years ago #

    KAShirow wrote:
    <i>Easy. Make a new filter for the_content which would cut the posting by tags (<english> </english><spanish></spanish> or just explode by [nextlanguage] or something, if the order of the languages is always the same)</i>

    This is what I do on my blog.
    It is workable, but you would have to slightly modify WP if you want to use the same method in your category titles and post titles.
    One day, someone will come up with a much better solution (it's pretty much a nightmare to design in SQL, unless you have a fixed list of languages your site is going to use).

  8. Lilandra
    Member
    Posted 10 years ago #

    okay, all i'm going to say is this sounds cool
    but my blog needs loads of work

  9. Fernán
    Member
    Posted 10 years ago #

    I tried putting it in my everypost, to show every translation and it didn't work in one even... :( It returns some error which I forgot to write down :\
    Any ideas?

  10. KAShirow
    Member
    Posted 10 years ago #

    Writing the error down seems like a good idea. :)

  11. Fernán
    Member
    Posted 10 years ago #

    Yes, it does :D, it was some warning shit... and I have trouble when sending html through forms, there's something wrong with my hosting service... I guess I'll have to move to another server, because it happens to many people and they don't know how to solve it.
    But anyway... here's another good way instead of the tabs thing, the problem is that I haven't been able to find the code anywhere :(
    Have a look at this: http://www.esreality.com/?a=post&id=634181
    If you click on those links, some text drops and then hides... It would be perfect for translations... you could add there as many as you want, and hide/display them whenever. Does anyone know where we can find the code for that? :\

  12. KAShirow
    Member
    Posted 10 years ago #

    There is a hack for WP just like this, it's in the wiki, (More/Less for extended entries hack) but the original file the wiki links to somehow ended up 404. :( What's funny is that I didn't keep a copy for some reason.
    Modifying it to do what you want would have been easy, if you can track down a copy. Try emailing the author and asking him where'd the file go?

  13. Fernán
    Member
    Posted 10 years ago #

    I think I will use the <spanish></spanish> thing or [spanish] whatever that works as a tag...
    Where can I see the way to code that?
    Thank you again.
    ZombiekE

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.