Theme Support Forum

Support Forum for Free and Premium Themes. Premium Theme Forums are Private! Please log in first to see the Premium forums

If you Like the Asteria Lite Theme and want to Keep it free forever Please Rate it on Wordpress.org (It only takes a few seconds)
Viewing 25 posts - 1 through 25 (of 35 total)

Home page and options translation

Home Forums Free Theme Support Asteria Lite Home page and options translation

  • #73172

    Lumiere de Lune

    Actually, I thought I had posted it, but the question is : how do I translate the homepage and other options, when I have a multilingual website ? They don’t appear in the string translation page of WPML (which is the most used WP Plugin for multilingual websites)

    #73267

    Towfiq I.

    administrator

    Yes I saw that while developing the theme, I followed the instruction that they described in their documentation, but strangely none worked.

    You can translate your strings using shortcodes, First add this to your functions.php
    http://pastebin.com/5WSeiK33

    and then add your shortcodes like this from your theme options page:

    [wpml_translate lang="en"]Your English Text Here...[/wpml_translate]

    #89216

    Aldo

    Hoi,

    I’m using mqTranslate to translate.
    Is there a possible way to translate the homepage with this?

    Kind regards,
    Aldo

    #89219

    Towfiq I.

    administrator

    you can if they have shortcode support. do they have shortcodes?

    #89223

    Aldo

    Thnx for the quick response.

    I don’t know for mqTranslate, but qTranslate has shortcodes 🙂

    example:
    [:en] English text [:de] Deutsch text [:off] Text for all languages

    PS: Thanks for Asteria

    #89234

    Towfiq I.

    administrator

    can you try this shortcode in the “welcome text” field from the theme options page and see if works?

    #91373

    Aldo

    Found a little problem trying to get all languages after an shortcode.
    But found a solution:
    <!--:en-->English text<!--:--><!--:de-->Deutsch text<!--:--><!--:hu-->Hungarian text<strong><!--:--></strong>All language text

    Source

    My “welcome text” field is currently

    <!-- Intro -->
    [:nl]
    <h2>Welkom op de officiële website van Jolien De Gendt</h2>
    <p>Kies een andere taal:</p>
    
    [:en]
    <h2>[:en]Welcome to the official website of Jolien De Gendt</h2>
    <p>Choose a language:</p>
    
    [:fr]
    <h2>Bienvenue sur le site officiel de Jolien De Gendt</h2>
    <p>Choisissez une langue: </p>
    
    [:ja]
    <h2>JolienデGendtの公式サイトへようこそ</h2>
    <p>言語の選択:</p>
    
    [:de]
    <h2>Willkommen auf der offiziellen Website von Jolien De Gendt</h2>
    <p>Wählen Sie eine Sprache:</p>
    
    [:es]
    <h2>Bienvenido a la página oficial de Jolien De Gendt </h2>
    <p>Elija un idioma: </p>
    
    <!--:-->
    
    <a href="http://www.joliendegendt.be/_preview/nl" title="Nederlands">Nederlands</a> |
    <a href="http://www.joliendegendt.be/_preview/fr" title="Français">Français</a> |
    <a href="http://www.joliendegendt.be/_preview/en" title="English">English</a> |
    <a href="http://www.joliendegendt.be/_preview/de" title="Deutsch">Deutsch</a> |
    <a href="http://www.joliendegendt.be/_preview/ja" title="日本語">日本語</a> |
    <a href="http://www.joliendegendt.be/_preview/es" title="Español">Español</a> 
    
    #91461

    Towfiq I.

    administrator

    how is this displayed on the frontend?

    and can you check if there is “do_shortcode” text in your content-welcome-text.php file?

    #91622

    Aldo


    English:
    Welcome to the official website of Jolien De Gendt

    Choose a language:
    Nederlands | Français | English | Deutsch | 日本語 | Español

    Français
    Bienvenue sur le site officiel de Jolien De Gendt

    Choisissez une langue:
    Nederlands | Français | English | Deutsch | 日本語 | Español

    <hr/>

    This is the full code of the content-welcome-text.php

    <?php global $asteria;?>
    <?php $welcome = $asteria['home_sort_id']; if(!empty($welcome['welcome-text'])){ ?>
    <!--Text Block START-->
    	<?php if ( asteria_is_mobile() && (!empty($asteria['hide_mob_welcm'])) ) { ?>
        <?php }else{ ?>
        <div class="text_block">
        <div class="text_block_wrap"><div class="center"><?php echo do_shortcode($asteria['welcm_textarea_id']); ?></div></div>
        </div>
        <?php } ?>
    <!--Text Block END-->
    <?php } ?>

    There is a do_shortcode on line 7
    <?php echo do_shortcode($asteria['welcm_textarea_id']); ?>

    PS: Can’t you show a preview of the text you post on this forum?
    Or change it afterwards?

    #92284

    Towfiq I.

    administrator

    Just checked your site. the Shortcode works great I see..

    #95831

    Cecilia

    I’ve try to add this http://pastebin.com/5WSeiK33 in functions.php but there is a parse error in line 21 in this code, can you help me?
    Thank you

    #97450

    Towfiq I.

    administrator

    @Cecilia open up functions.php and add this:

    /***WPML Translation Shortcode****/
    if(! function_exists('wpex_wpml_lang_translate')) {
            function wpex_wpml_lang_translate( $atts, $content = null ) {
                    extract(shortcode_atts(array(
                            'lang' => '',
                    ), $atts));
     
                    $current_lang = ICL_LANGUAGE_CODE; //get WPL current language
     
                    if($lang == $current_lang){
                        return do_shortcode($content);
                    }  
            }
            add_shortcode('wpml_translate', 'wpex_wpml_lang_translate');
    }

    after this:

    add_action( 'pre_get_posts', 'asteria_home_query' );

    #98413

    Cecilia

    Thank you!
    Unfortunately continues to report an error. Parse error: syntax error, unexpected T_RETURN in /var/www/virtual/nomesito/htdocs/wordpress/wp-content/themes/asteria-lite/functions.php on line 30

    I tried also to insert it in an editor (dreamweaver) and also reports the error. You will find the image of the screen here: https://www.dropbox.com/s/ik815wwy73k4677/code.jpg

    #98472

    Towfiq I.

    administrator

    copy all the code of your fucntions.php after adding the code and paste it in a pastebin.com page and share it here.

    #99178

    Cecilia
    #99765

    Towfiq I.

    administrator

    there is a sytanx error in the code. a bracket was missing. try this:

    /***WPML Translation Shortcode****/
    if(! function_exists('wpex_wpml_lang_translate')) {
            function wpex_wpml_lang_translate( $atts, $content = null ) {
                    extract(shortcode_atts(array(
                            'lang' => '',
                    ), $atts));
     
                    $current_lang = ICL_LANGUAGE_CODE; //get WPL current language
     
                    if($lang == $current_lang){
                        return do_shortcode($content);
                    }  
            }
            add_shortcode('wpml_translate', 'wpex_wpml_lang_translate');
    }
    #100072

    Cecilia

    Thank you. Now there isn’t syntax errors, I can save “functions.php” without problems. But i tried to add your shortcodes like this:
    [wpml_language language=”en”]Your English Text Here…[/wpml_language] in the welcome text and doesn’t work. Can you help me?
    Thanks in advance the theme is very cute.

    #100323

    Towfiq I.

    administrator

    does your content-welcome-text.php contains this:

    <?php echo do_shortcode($asteria['welcm_textarea_id']); ?>

    #100482

    Cecilia

    Yes, there is.
    But the shortcode like this [wpml_language language=”en”]Your English Text Here…[/wpml_language] doesn’t work.
    I see the same code in the front end.
    Thank you.

    #100591

    Towfiq I.

    administrator

    are you adding the code in text mode or html mode? try in both modes and see if that worked…

    #102533

    Cecilia

    I tried all (visual and html) and doesn’t work.

    #102801

    Isis

    Hi Towfiq,

    I made a website in two different languages using the Polylang plugin. How can I make two different homepages (one in English and one in Spanish) using your theme?

    Kind regards,

    Isis

    #102858

    Towfiq I.

    administrator

    @Cecilia send me your site’s id/pass through this page:

    Contact

    I will look into it when I have some time.

    @Isis whats your site address?

    #105437

    Cecilia

    Thank you, I sent you an email with site’s id / pass and address.

    #108250

    Towfiq I.

    administrator

    sorry guys. it should have been:

    [wpml_translate lang="en"]Your English Text Here...[/wpml_translate]
    [wpml_translate lang="it"]Your Italian Text Here...[/wpml_translate]
    

    @Cecilia check your site. Fixed it.

1 2

The topic ‘Home page and options translation’ is closed to new replies.