Site5

Menu

Support Forums

Translating the homepage.

Home Forums SimpleCorp Translating the homepage.

Tagged: 

This topic contains 57 replies, has 7 voices, and was last updated by  chanyuan 6 months, 1 week ago.

Viewing 15 posts - 16 through 30 (of 58 total)
  • Author
  • #11191

    Guido
    Participant

    Tonight I have a party, so cannot work on it.

    Can you give me the language switch code to change language, I notice it in your header. The instructions on the plugins site are not very clear.

    Btw, because I use WP in my native language I did not know page Extra is called Tools in English WP. Sorry.

    Guido

    #11192

    TokerCoughin
    Participant

    Oh! No worries dude. Do what you gotta do 🙂 I appreciate all the help so far anyways.

    And it’s very basic, as long as you’re using it as a wordpress plugin, really. Once you install the plugin, just set a few languages within the settings page ” Settings ->Language Switcher”

    And the ISO code is just set to EN for english and FR for french, and then it’s just shortcode driven from within a page / post by doing it as follows:

    [lang_en]English text goes here[/lang_en][lang_fr] French text goes here[/lang_fr]

    I hope that clears up some confusion…

    Thanks Guido,

    Sincerely,

    Chris

    #11193

    Guido
    Participant

    I mean the header code, on top of your site. To change the site language from ENG to French… Without that I am not able to test my site.

    Guido

    #11194

    TokerCoughin
    Participant

    Does this help you ?

    <div id=”langs”>

    • <?php if(function_exists(‘langswitch_list_langs’)){

      langswitch_list_langs(false, true, ‘li’);

      }?>

  • </div>

#11195

Guido
Participant

Does not work here. I guess you can reach your server via FTP? Because I will create a sample po/mo file which you can upload to your SimpleCorp ‘languages’ folder to find out if this works.

Btw, if you add code, please use the code button.

Guido

#11196

TokerCoughin
Participant

I can indeed access my sever via FTP client, I will definitely try to upload the po/mo file to see if it works.

#11197

Guido
Participant

Download this:
http://www.webmastergroningen.nl/fr.zip

Unzip it and upload the 2 files to SimpleCorp > languages (folder)

I’ve only translated the Read More (displayed on homepage)

Guido

#11198

TokerCoughin
Participant

I’ll give it a shot now, should I put it in the original theme ? or will it work fine in my child theme ? ( I’ve copied the “language” folder )

Thanks Guido.

#11199

Guido
Participant

Please try both folders.

I hope it works, otherwise I give up and you should think about using another plugin..

Guido

#11200

TokerCoughin
Participant

Crap… Doesn’t appear to work. I placed the 2 files in both language folders, and the text still reads “read more” in english…

Using another plugin, although a possibility, would not be a favorable solution, as I’ve spent a lot of time entering and formatting content with the current plugin.

I may have to bite the bullet and try my luck with another one though..

I’m still kind of hoping i can get it to work through my current configuration though, where the homepage is generated by using a page template on a static “home” page. And I enter the content through the template file itself, splitting the content into [lang_en] and [lang_fr] on the template itself.

Now if I could only figure out how to get the template files to recognize the shortcode, instead of displaying it as text.

DO you have any insight on that ?

Thanks again for everything, Guido. I appreciate your help in this matter.

#11204

Guido
Participant

Too bad man! Apparently your plugin only supports the content and excerpt (so a post or a page).

I have a question, is it very important the 404 and searchpage are translated too?
If not and you still want to use your own plugin we can change homepage to a static page. We can work with columns so your 4 boxes will be (almost) the same.

Guido

#11205

Guido
Participant

The static page is actually a very good idea.
With the theme’s shortcodes I (or you) can create columns like the homepage has.
I already created a pagetemplate with the slider on top, so you can create a static homepage and select ‘my’ homepage template on the right.
Now you can add the text in 2 languages like you always do.

Guido

#11206

TokerCoughin
Participant

That’s a shame. Well thanks for helping 🙂

And it’s not crucial that the 404 and search page are translated, I would like that they were, but the homepage is the focus.

I have already set up a page template that’s a copy of my homepage, but I can’t get the [lang] tags to be recognized in the template .php file. I have tried using:

<?php echo do_shortcode(“[lang_en]“); ?>

And it still wasn’t recognized, and upon contacting the Language Switcher’s author, she said the following:

If your theme is doing something other than WordPress standard to create the home page, then you would need to pass whatever text it is trying to display through the same PHP function that the plugin uses to filter text.

Hopefully you’re a PHP programmer and can figure out how to do that within your theme. The function you would want to call is probably langswitch_filter_langs(), which is in the plugin’s langswitch.php file.

So instead of the do_shortcode(‘the text goes here’) that you are trying, you probably want langswitch_filter_langs(‘the text goes here’).

But I can’t quite figure out how to work that…

#11211

Guido
Participant

I have created a homepage template containing the slider and the homepage blurp:
http://webmastergroningen.nl/wp/
http://webmastergroningen.nl/wp/langswitch_lang/fr

So this is a static page, you can add your content like on ‘normal’ page. With theme shortcodes I have created 2 columns for displaying homeboxes.
Because this is a ‘normal’ page you are able to add the plugin lang codes and I’m almost certain this will work, because it does at my server!

Guido

#11213

TokerCoughin
Participant

Nice, that looks pretty much perfect.

How can I get that file and work it into my own sites?

Thanks again Guido.

Viewing 15 posts - 16 through 30 (of 58 total)

You must be logged in to reply to this topic.