Create Block per language

Hello,

We  would like create BLOCKS per LANGUAGE... and give right 

Example : Italian can see only bloc with "right" ITALIAN...

Do you think its possible ?

A mod in Market ?

That's will be better, because i can't create 1 boonex per language...  

Quote · 25 Jun 2013

You can add multiple languages and people can select their language.

There also might be a mod available that automates this for you.

Dedicated servers for as little as $32 (28 euro) - See http://denre.com for more information
Quote · 25 Jun 2013

Be a bit more specific in the content of the block.

However, this is probably going to be a bit tricky.  Unless you have a profile field with language; the member's country is part of the standard join form.

The php block code would have to check for the user's language.  Now here is a trick, php blocks will not be displayed if they are empty.  So what you would do is to check for the users language and if not correct just return from the script.  Anyway, so check if !correct_language; return (that is not correct code, just pseudo code).  This will return an empty block so it will then not be displayed to the member.

Geeks, making the world a better place
Quote · 25 Jun 2013

No, because if i create a block with French text, all member can read this text...

For an italian member, its impossible to understand the text... 

This block must be see by French member only ... and not Italian member... normal

Its a real problem, because i can't create 10 boonex for the world and content are always different

Quote · 25 Jun 2013

 

No, because if i create a block with French text, all member can read this text...

For an italian member, its impossible to understand the text... 

This block must be see by French member only ... and not Italian member... normal

Its a real problem, because i can't create 10 boonex for the world and content are always different

I gave you the answer.  You will create a php block.  If the block is just going to be text, then you can use PHP to output the text.  The PHP script will do a check for the person's language, or I am guessing that country will work just as well and that is already a part of the join.  If the language is not correct; and you would code that into each block, it will simply return, and that block will not be displayed.  $lang = "italy"; check to see if the current user country matches $lang; if not, then return.  That block will not be shown to anyone unless their country is Italy.

If you can not do this coding, then contact a Dolphin coder or Dolphin module developer; it should not take long to make a module that can do this with you choosing the language in a backend interface.  Or, they code a php block for you and all you would need to do is to change the language string.

Geeks, making the world a better place
Quote · 25 Jun 2013

Thanks for your messages..

The method seems good... 

I'll try to find a good developper for this job...

If you can, contact me... 

Quote · 26 Jun 2013

Or you can just use whats already available.

Create a php block that displays the content of a language key.

echo _t('_myLanguageKey');

Then in the languages, create the key _myLanguageKey and set the proper text for each of your installed languages.


https://www.deanbassett.com
Quote · 26 Jun 2013

Whaouuuu..... That seem a very good solution.

I will test quicky and i inform you...

Thanks a lot !!!

Quote · 26 Jun 2013

OK, I think I misunderstood the question.

If the text you are wanting to display is going to be the SAME for all members, then yes, Dean's simple solution is perfect.  It is why language keys are part of Dolphin, to make it easy to have text presented in different languages.

Geeks, making the world a better place
Quote · 26 Jun 2013

 

Or you can just use whats already available.

Create a php block that displays the content of a language key.

echo _t('_myLanguageKey');

Then in the languages, create the key _myLanguageKey and set the proper text for each of your installed languages.

 I created a new block php with DEANOS TOOL on index page... but my syntax seems bad

I write :   echo _t('_myLanguageKey');  in field   PHP Code

PS : The key is just for test...

Can you help me...

Thanks per advance

PS... image on attachments

Php block.png · 97.7K · 119 views
Quote · 11 Dec 2013

Why do you think the syntax is bad?

If your getting a error then show the error. Because the code looks fine to me. So i need more details.

https://www.deanbassett.com
Quote · 11 Dec 2013

In fact, in the block, appear  :     

__sbs_txt_title_bx_poll ....  

but not the equivalence with the Key in langage file

PS : Attachment...

Php block_plus.png · 54.6K · 144 views
Quote · 11 Dec 2013

Sorry, it's Ok....   2 underscore...

Thank's a lot !!!

Quote · 11 Dec 2013

Something else. I would like to insert a photo which would be on my server.

What is the code ?

In fact, I am afraid that the file language becomes too heavy. We can use of the HTML code ?

What intrigues me, it is the syntax :   echo _t('_myLanguageKey');

Thanks per advance

Quote · 11 Dec 2013

 

Something else. I would like to insert a photo which would be on my server.

What is the code ?

In fact, I am afraid that the file language becomes too heavy. We can use of the HTML code ?

What intrigues me, it is the syntax :   echo _t('_myLanguageKey');

Thanks per advance

Language keys can hold HTML markup.  So you could have a language key with <img src="http://mysite.com/media/images/my_image.ext" />  and then when you echo out the language key it will display the image.  Of course you can echo out the markup directly.  For larger echos, use heredoc:


$mystring
 = <<<EOT
    This is some PHP text.
    It is completely free
    I can use "double quotes"
    and 'single quotes',
    plus $variables too, which will
    be properly converted to their values,
    you can even type EOT, as long as it
    is not alone on a line, like this:
EOT;

Geeks, making the world a better place
Quote · 11 Dec 2013

Thanks to you all. It opens interesting perspectives

Thank you again !

Quote · 11 Dec 2013
 
 
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.