Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Lingvafix

    (@lingvafix)

    Heureka!
    I finally managed to get it to work. So for anyone using the Enfold theme here is what worked for me. To insert in the functions.php and modify according to your own language slugs and divs and css styles:

    // Adds extra element to the header
    add_action(‘ava_main_header’, ‘ava_cml_shortcode_text’);

    function ava_cml_shortcode_text(){
    if(CMLLanguage::get_current_slug() == “sv”){
    ?>
    <div class=’slogan’>
    <p class=”slogan_main”>Your own text</p>
    <p class=”slogan_sub”>Your own subtext</p>
    </div><?php
    }elseif(CMLLanguage::get_current_slug() == “fi”){
    ?>
    <div class=’slogan’>
    <p class=”slogan_main”>Your own text</p>
    <p class=”slogan_sub”>Your own subtext</p>
    </div><?php
    }
    }

    Thread Starter Lingvafix

    (@lingvafix)

    Hi,
    Well, this did not work either. When I used the example it only shows the word Blastring two times and without any p-class styling, just plain text, regardless of switching languages. It seems to me that the template/theme does not recognize the language slugs or does not know what to do. This is strange because everything else works fine with the translated versions.
    Is there a way to “register” the cml language slugs so that the theme recognizes them?
    What should I do? My client is asking me what is taking so long and I feel a bit of pressure building up…
    If you have solutions, please help.

    Thread Starter Lingvafix

    (@lingvafix)

    Hi,

    This shortcode function comes halfway… it shows the Swedish, but only the Swedish, not the Finnish. When switching to Finnish the Swedish text is still shown.

    function ava_cml_shortcode_text(){ ?>
    <div class=’slogan’><?php echo “<p class=’slogan_main’>”.do_shortcode(‘[cml_translate string=”Blastring” in=”fi”]’).”</p>”;
    echo “<p class=’slogan_sub’>”.do_shortcode(‘[cml_translate string=”Effektivt” in=”fi”]’).”</p>”; ?></div>
    <?php}

    Any idea/solution for this one?

    Thread Starter Lingvafix

    (@lingvafix)

    Hello again,

    could you please give an example of how I could use the function:
    CMLLanguage::get_current_slug();
    How to write/order the parameters. Sorry, but I’m no coding pro…

    Thread Starter Lingvafix

    (@lingvafix)

    Hello,
    sorry, but it doesn’t work. I forgot to mention that the theme requires this kind of function when adding a new header element. I don’t know if I got it right because I am no php hero 🙂

    This is what it looks like now when only the language switcher works ok:

    function ava_extra_header_element() { ?>
    cml_shortcode_text( array(
    ‘sv’ => ‘<div class=’slogan’>
    <p class=”slogan_main”>Blästring</p>
    <p class=”slogan_sub”>- effektivt och skonsamt</p></div>;,
    ‘fi’ => ‘<div class=’slogan’>
    <p class=”slogan_main”>Puhallus</p>
    <p class=”slogan_sub”>- tehokasta ja hellävaraista</p></div>;,
    )
    );
    <div class=’language_switch’>
    <?php
    cml_show_flags( “cml_language”, CMLLanguage::get_current_id(), false, false );
    ?></div>
    <?php }

    Should the function come within the slogan div class? Then it would be similar to the language switch.

    Br, Rainer

    Thread Starter Lingvafix

    (@lingvafix)

    Hi,
    pages that got the /en/ was assigned to all languages during the plugin update

    there are no records with “cml_type = ‘S'” The only types in the table are ‘N’ ‘T’ and ‘W’

    Br, Rainer

    Thread Starter Lingvafix

    (@lingvafix)

    Update:

    – Noticed that via the Quick Edit of a page I was able to remove unnecessary translations, assign the right language and reconnect originals with correct translation 🙂
    This also solved the /en/ permalink issue, because for some reason pages with translations had via the update process been assigned to ‘all languages’
    – But the categories have no quick edit so them I have to redo.

    Regards,
    Rainer

    Thread Starter Lingvafix

    (@lingvafix)

    Buongiorno,

    Thanks, now the Post data box appears, BUT now it gets a bit complicated

    – pages that already had language versions now get an /en/ in the permalink instead of none for default and /fi/ for Finnish (I have installed English but I have deactivated it and my languages are Swedish, default, and Finnish. I only added English because I want the WP interface in English). Should I just edit the permalink?

    – pages that I already had translated still exist but are now listed as separate pages beside the original without any connection. They appear to have translations but the translations are only the same content. This is worse because it means that I have to redo the language versions.

    – categories both original and translations are now also listed as “originals”, so I have to redo them also.

    I am doing this site for a customer so all this makes me wonder if I can take the chance/risk of using this plugin and when a new update comes all language versions are gone and they have to be done again. I would not like that and my customer would certainly not like that.

    In this case maybe it was my own fault because I was too quick to press update the plugin… but it should anyway work.
    Let’s continue to get this working, but I cannot do any more translations now with the risk of having to do them again.

    Br, Rainer

    Thread Starter Lingvafix

    (@lingvafix)

    Hi,
    1. “Enable language filtering” is enabled
    2. No. (the box where you should see language, name of original and so on)
    3. No, I just updated the plugin, since I already had made the settings I needed.
    4. These are the latest rows:
    [03-Oct-2014 13:48:40 UTC] PHP Notice: Undefined index: page in C:\Users\Rainer Ahlvik\Documents\My Web Sites\EasyBlast_WP\wp-content\plugins\ceceppa-multilingua\admin\admin.php on line 74
    [03-Oct-2014 14:26:48 UTC] PHP Notice: Use of undefined constant CML_STORE_CATEGORY_AS – assumed ‘CML_STORE_CATEGORY_AS’ in C:\Users\Rainer Ahlvik\Documents\My Web Sites\EasyBlast_WP\wp-content\plugins\ceceppa-multilingua\admin\admin-posts.php on line 302
    [03-Oct-2014 14:26:48 UTC] PHP Notice: Use of undefined constant CML_CATEGORY_CREATE_NEW – assumed ‘CML_CATEGORY_CREATE_NEW’ in C:\Users\Rainer Ahlvik\Documents\My Web Sites\EasyBlast_WP\wp-content\plugins\ceceppa-multilingua\admin\admin-posts.php on line 302
    [03-Oct-2014 14:27:06 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘avia_wpml_language_switch’ not found or invalid function name in C:\Users\Rainer Ahlvik\Documents\My Web Sites\EasyBlast_WP\wp-includes\plugin.php on line 505
    [03-Oct-2014 14:27:07 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘avia_wpml_language_switch’ not found or invalid function name in C:\Users\Rainer Ahlvik\Documents\My Web Sites\EasyBlast_WP\wp-includes\plugin.php on line 505
    [03-Oct-2014 14:27:10 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘avia_wpml_language_switch’ not found or invalid function name in C:\Users\Rainer Ahlvik\Documents\My Web Sites\EasyBlast_WP\wp-includes\plugin.php on line 505

    Hope this helps.

    Rainer

    Thread Starter Lingvafix

    (@lingvafix)

    One more:

    4. When translating categories (there you actually see language fields) on clicking on update nothing happens. And editing the same category again your translation is not there.

    //Rainer

    Thread Starter Lingvafix

    (@lingvafix)

    Hi,
    Thanks a lot for great support!

    br, Rainer

    Thread Starter Lingvafix

    (@lingvafix)

    Hello,

    Thanks! I noticed myself from the debug.log what was the problem. It was a call to an undefined php function related to testing of another multilanguage plugin 😉
    I removed it and now the site displays as it should again 🙂

    You could however help me with another thing. If I want to place the langauage switcher in the header (flags + name), instead of in the nav or in a widget. What’s the code to use?

    br, Rainer

Viewing 12 replies - 1 through 12 (of 12 total)