Help - Search - Members - Calendar
Full Version: Bilingualize my movabletype
Movable Type Community Forum > Additional Resources > Tips and Tricks
thesthn
Hi, I'm currently learning spanish in school right now and what could be better to imrove my skills than a blog in spanish? I want to write my blog in both spanish and english and provide a way of switching between them. I was wondering if there was a plugin or way of adding this feature in. More specifically, I was looking for an added box in the MT post section, which would be labeled Spanish translation. So when I go to post something, I'll type it in English in the English box. and then maybe below the English box, there would be a box titled Spanish Translation. I would then type out the translation into Spanish.
Then after posting it, the actual webpage would have this small button somewhere where you could switch between the spanish version of the site and the english version.

uhh, do you get what I'm trying to say?
thesthn
I've just thought of a way to accomplish this but I haven't implemented it yet. It involves CSS and a style switcher. If I enclosed my english post with a p tag with a class of 'english', and enclosed my Spansih part of the post in a p tag with a class of 'spanish'. and then make two stylesheets, one would be the default of english with p.spanish {display: none;} and the other one would be the spanish stylesheet with p.english {display: none;}. And then by using a stylesheet switcher to switch between English and Spanish.

As a summary, it'll be roughly something like this:
the english stylesheet would have:
CODE
p.spanish {display: none;}

and the spanish stylesheet would have this:
CODE
p.english {display: none;}


the html of the page would be
CODE
<link type="text/css" rel="stylesheet" title="English stylesheet" href="english.css" />
<link type="text/css" rel="alternate stylesheet" title="Spanish Stylesheet" href="spanish.css" />

<p class="english">Hello, Welcome to my page</p>
<p class="spanish">Hola, Bienvenidos a mi pagina</p>


So the english will be hidden with the spanish stylesheet and the spanish will be hidden with the english stylesheet

So I hope you can understand what I'm trying to do. If there is no other way, I guess I'll be doing it like this. There must be an easier way!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.