Multi Language HTML - Block

Hi Everyone!

Can soem tell me how I can make a Multi Language Block For Dolphin 7.0.2

I have one but for the old version but is not working on Dolphin 7.0.2

can you please help

Thank's

This my old code from >> dolphinbugfixing

_________________________________________________________________________

EXPERTX 2010 -- dolphinbugfixing.com@gmail.com


========================================================================
MULTINGUAL HTML BLOCK

1) Edit inc\classes\BxDolPageView.php

Look for this line :

function getBlockCode_Echo( $iBlockID, $sContent ) {

After the above line insert this lines :

$sC alt=  "XXX ".$sContent;     
$res = db_res("select `ID`,`Key` from sys_localization_keys");  // FOR 7.0.0 only
$res = db_res("select `ID`,`Key` from LocalizationKeys");  // FOR 6.1.6 only

while ( $arr = mysql_fetch_array($res) )
{
if ( strpos($sContent,$arr[Key]) > 0 )
$sC alt= str_replace($arr[Key],_t($arr[Key]),$sContent);
}
$sC alt= str_replace("XXX","",$sContent); 


2) In the Admin Panel >> Builders >> PageBuilders
HTML block editing, add underscoce infront of the string you wish to make it multilingual.

Example : _multilanguageHTMLblock    


3) In the Admin Panel >> Manage Languages  -- http://<yoursite>/admin/lang_file.php     << 6.1.6
In the Admin Panel >> Manage Languages  -- http://<yoursite>/administration/lang_file.php     << 7.0.0

click the link "Add a new language key" window will popup, fill up the fields


New language key name: _multilanguageHTMLblock

Category: Misc

String texts for available languages: testing me viewing a multilanguage HTML block

Post Reply - if you going to help - No for - bla bla bla bla
Quote · 7 Jul 2010

I never thought this mod is useful, My partners and I are happy to release a new version for 7.0.2, I will do this in few minutes before going to fetch kids in school

Live Support http://dolphinbugfixing.com
Quote · 9 Jul 2010

Sorry, I was not about to add the mods in my store it wont let me because I'm not a premium member anymore Embarassed my paypal has no balance I guess I'll just wait on this.

Live Support http://dolphinbugfixing.com
Quote · 9 Jul 2010

you can send to my email or upload the file to easy-share or rapidshare and i can download this

Thank's a lot man

Sorry, I was not about to add the mods in my store it wont let me because I'm not a premium member anymore Embarassed my paypal has no balance I guess I'll just wait on this.

Post Reply - if you going to help - No for - bla bla bla bla
Quote · 9 Jul 2010

Yes, that works fine, I just modified it (d7.3)

\inc\classes\BxDolPageView.php
    function getBlockCode_Echo( $iBlockID, $sContent )
    {
        // BEGIN
        // last keys should be the good ones, so begin by the end
        $res = db_res("select `ID`,`Key` from sys_localization_keys order by ID DESC");  // FOR 7.0.0 only
        while ( $arr = mysql_fetch_array($res) )
        {
            if ( strpos($sContent,$arr[Key]) > 0 ) {
                $sContent= str_replace($arr[Key],_t($arr[Key]),$sContent);
                // Not to parse all keys, we assume there is only one paragraph to translate
                return '<div class="dbContentHtml">' . $sContent . '</div>';

            }
        }
        // END
        return '<div class="dbContentHtml">' . $sContent . '</div>';
       
    }

You could add only one key language in the html block and so select the corresponding key directly for performance... Depends on what you want to do.

Quote · 8 May 2016
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.