Jump to content
Sign in to follow this  
miber

How to translate Feature and Feature box

Recommended Posts

miber

Hi, Is it possible to translate the title and text for the features and feature boxes into different langugages? I have tried this with both the "CodeStyling Localization" plugin and the "WPML Multilingual CMS" plugin. But they don't seem to find the strings I want to translate. Thank you in advance, Michael

Share this post


Link to post
Share on other sites
Andrew

Do you just want it to show up in a different language? or different languages depending on who's looking at it?

Share this post


Link to post
Share on other sites
miber

Different language depending on who's looking at it. The site will have a language switch in the header. We will probably use WPMP Multilingual CMS plugin since it seems easy to use. If the user goes to http://mysite.com/de the site will be in german (and hopefully the feature boxes as well). If the user goes to http://mysite.com/sv the site will be in swedish.

Share this post


Link to post
Share on other sites
miber

Using the translation plugin "qTranslate" I managed to translate the Feature Text by typing:

<!--:en-->English text<!--:--><!--:se-->Swedish text<!--:--><!--:de-->German text<!--:-->

On the other hand, this plugin does not seem to be able to translate the Theme strings. Any suggestions helping me translate the whole site (pages, posts, theme, date formatting etc) are appreciated.

Share this post


Link to post
Share on other sites
trevis

I need to do exactly the same thing. Have you had any progress on that? Have you managed to put the list of languages in the header of the site? How did? I changed the default language of my computer, but it seems that the WPML only changes the language to access the correct address (mysite.com/en or mysite.com/es). I wish that when anyone from accessing mysite.com him to add the /en or /es according to the language of the visitor. Do you know if this is possible? Regards, Rafael Trevisan rafael@trevis.com.br

Share this post


Link to post
Share on other sites
matthewshore

seconded... anyone got a solution to this?? essentially, i can translate the rest of my site using wpml, but i cant do the home page, ie the features boxes and the feature... seems a bit bizzarre that these don't show up as strings with the rest of the site.

Share this post


Link to post
Share on other sites
Andrew

there is probably a wrapper function that needs to be added... I'll take a look at WPML; and see what's need.

Share this post


Link to post
Share on other sites
Andrew

ahhhh... I see. the output functions in the feature templates need to be wrapped in '_e()' functions. so in something like "template_feature.php" change this type output: `<?php echo $feature['title'];?>` to this: `<?php _e($feature['title'], TDOMAIN); ?>`

Share this post


Link to post
Share on other sites
Andrew

gettext consists of the _e() and __() functions you see through out the theme.

Share this post


Link to post
Share on other sites
matthewshore

So, because the $feature title is an array the individual titles don't actually 'exist' when the gettext runs... It doesn't appear in the strings. but, if you declare a single variable then it works, and it shows up in the string translation part. Any ideas how to get around this? you can see on the site now: one title is a control, with no gettext, the second title is wrapped in a gettext, and the 'NameMO' is a single variable, wrapped in gettext. the latter appears in the string translations, and changes depending on the language you select. moveoneinc.com/stage2

Share this post


Link to post
Share on other sites
Andrew

hmm.. Ok how did you go about wrapping the NameMO part?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×