ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Multilanguage Locales in Chronoforms V5

slon777 18 Jan, 2017
1 Likes
Hello

I have some problems with setting locales up in Chronoforms V5. I have created languages tags like en-GB and uk-UA (also tried with lowercase letters en-gb and uk-ua) but everything doesn't work.
I put constants like NAME_LABEL into label field for text box and assigned this constant value in locale like NAME_LABEL=Your name. I've tried to do it with brackets and without - but the result was the same - it didn't work.

Tell me please, where is my fault? Because it is stupid to clone the same form for different languages.

Best regards.
GreyHead 18 Jan, 2017
1 Likes
Hi sion777,

The 4 characters language identifier for your language, e.g: en_gb or fr_fr or de_de...

Please try en_gb and uk_ua as suggested.

Bob
slon777 19 Jan, 2017
Yeah, thanks
I have already found that solution. I didn't pay attention at the sign "_".

Go on here...
The task: I wanted to assign language for datepicker according to site language.
So I tried to set up different languages for datepicker (https://www.chronoengine.com/faqs/70-cfv5/5216-date-control-using-cfv5-date-picker-element.html). I would like to know if it is possible to assign if..then...else statements for extra params where it is required to use param_name=param_value. I tried to add statements in that field, but nothing worked.
This string didn't work:
data-shortdays=<?php if ($tag == "ru-RU") { 
	echo '["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"]';  
} elseif ($tag == "uk-UA") { 
	echo '["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"]'; 
} ?>

Of course I have solved this problem in another way (using custom code onLoad form), but isn't it possible to use extra params for this? Why is data-start_date=<?php echo date("d-m-Y"); ?> permitted, but the same with if...then statements not?
GreyHead 19 Jan, 2017
HI sion777,

Hmm . . . I've never tried to do this, I suspect that the problem may be that $tag isn't defined in this code. Please try
<?php
$jlang = \JFactory::getLanguage();
$tag = $jlang->getTag();
if ( $tag == "ru-RU" ) { 
  echo 'data-shortdays=["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"]';  
} elseif ( $tag == "uk-UA" ) { 
  echo 'data-shortdays=["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"]'; 
}
?>

Bob
slon777 21 Jan, 2017
Bob,
thanks for your answer. That was just part of code. Of course $tag was defined:)
Anyway, this problem has been already done with custom code.

I have another question, it is about dragging elements in visual builder between containers in Setup tab. Is it possible to drag into/out off blocks? I mean, for instance, we have custom event switcher, then we add show message into success field. And NOW, we try to move it from "success" to "fail", but we can't. So, what is the problem? I tried to use the latest jquery and mootools scripts for admin theme, but it didn't help me (V4 even stopped work at all).
GreyHead 21 Jan, 2017
1 Likes
Hi slon777,

Good to hear that you solved the previous problem.

You can't drag and drop elements or actions once they are placed. You can copy + paste + delete elements but there is no equivalent for actions. I usually end up opening up two copies of the Form Editor in different browser windows then drag in the new elements in one of them and copy and paste over the settings from the other. Works OK as long as you save the right one.

Bob
slon777 22 Jan, 2017
Hi Bob,
Thanks for your help. I wish drag function had implemented in full.
Ah, even if developers added real button copy (which saved all stack of configurations of selected element), and real button paste (which pasted the same element into new place) it would be also the best!!!
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com