Wordpress Translation Header.php Question

C

chrismitchell

Guest
Ok people :) this is an interesting question.

I have used a different plugin to change my languages on the site below

WCA2012 | Buenos Aires | March 25 - 30, 2012

and it now gives me the change of language a bit easier, but it only changes the language on posts and pages not on the header etc etc. What I want it to do is when you select spanish it will change the header.php to header2.php and if possible also change the css file to cssspanish.css or something like that (so I can amend the spacing etc of the menus). If it can also make the footer change too that would be awesome too :D

Anyone know a way of doing this?
 
Have no idea without seeing scripts or an idea of what the plugin is. Btw the menu bar is wonky in firefox, mac - the contact us button is in the pic
 
yeah I need to adjust the menu slightly as it changed the titles.. its just a margin thing :)

The plug in is the translation plug in which is called: WPML Multilingual CMS its the little dropdown at the top right of the page.

It allows you to input the different languages text into the posts and pages to allow people to change the text to be the language they request (in this instance only Spanish and Portuguese from English). The other thing i need to be able to do is make it so that when you change the language it knows you've changed the language when you change to a different page.. if thats possible.
 
yep all Wordpress goodness, i like to stretch Wordpress to its limit :D its a confusing little conundrum :) I can make it change from one language to another in the posts and pages, just not on the rest of the site, because they aren't posts or pages in the menu items etc. Thats why on the change of language I was thinking that it would be great to be able to force a change of header.php and footer.php so to speak or even change the whole theme (as the theme is essentially all in english).
 
Not sure if this will help you Chris, but this plugin can add a Theme Switcher Widget. So you could potentially have one Portugese and one English theme and then have a Theme Switcher button somewhere that'll let you change the Language? Not sure how it would work dynamically though, as in if it'll update the posts/pages across both themes?

Document Details | WordPress Theme Switcher Reloaded

Does it not change across the footer and header if you just put the 'lang' attribute in header.php like <HTML lang="en">?
 
Thanks Soren, I'll have a go with that and see if that works :)
 
Good to hear you got it sorted Chris! :up:

How did you fix it? Did you end up with a theme for each language?
 
yeah I made a theme for each language and then made it change on a lang= code :D
 
Brilliant. So did that Theme Switcher thingie work? Does it update across both themes then when you create a new post/page? Sorry for bombarding you with questions, but I'm always so fascinated with the posibilities and power of WP, and was thinking of having a Danish version of a site I did. :D
 
what you need to use is 2 different plugins and then cusomise them a little bit to look and feel.. the 2 plugins are:

WPML Multilingual CMS and WP Theme Switcher

and you have to set the Theme Switcher to work when the lang= is correct for the language you want to change and just make exactly the same theme in a different language which is what I did for both Portuguese and Spanish :) might have to do it for another few languages too :) but it definitely works :D

Great learning curve for a multi language site..

The only problem i'm having is to make the option for changing languages to be a horizontal bar instead of a drop down :( I can't get the code correct for that but other than that it works like a dream :D
 
Cheers Chris!

That's really cool. I'm gonna have some fun with that I think. :D

I had to do an Arabic version of an English site once. Now that's a pain in the arse! I remember I had to copy the text for buttons etc. in to Word, take a screenshot, put that into PS, and then cut the words out manually cause you need ME version or something for PS to support Arabic text. I had to do like 40 buttons like this and everything on the site had to be flipped as well cause they read from right to left. Fun times! Took me about 3 days! Arhghh...never again...still keeps me awake at night haha! :D
 
LOL well this would still require all of the translations made by yourself into each language but instead of making images you would need to input it into different parts of Wordpress in both the theme and the posts and pages :) but all up is a lot quicker than through any dynamic translation provider or auto translation plugin, which there are a few of, none of which work particularly well :lol:

just let me know if you need me to give you a hand with it :) there was a lot to learn and loads of places to change things (I did it through trial and error :p)
 
Oh no, the actual HTML text was fine. Just had to be right aligned instead. It was all the graphical call to actions and buttons I had to do manually that way cause I couldn't just change the English text on the buttons to Arabic in PS.

What a mission it was (It did improve my written Arabic a lot though. I can write Register Now, Search, Go, Book a stand, Home and lots of other useful things now). ;)

Thanks Chris! Might pester you with some multilingual questions soon. :D
 
Back
Top