Forums

Locales problem

Marysia 27 Sep, 2015
Hello🙂

I have a problem with locales.

I have the page with the form and the page is going to be multilingual, so I copied original "only English" form and I'm trying to prepare it to be multilingual. Everything worked fine to some point.

I have dynamic dropdown. I'm not sure if this is the right name for it: user chooses type of tunnel and dependently on his/her choice, he/she sees different colors and lenghs. Lenghs are multilingual by definition, but colors are not. The problem is, colors are not translated... I attached you printscreens.

Any tips?
Marysia 27 Sep, 2015
Comment: I stopped preparing multilingual form when I've met that problem, so problem is visible only in the first line.
GreyHead 27 Sep, 2015
1 Likes
Hi Marysia,

That's a new bug. I think I have found a fix though.

Open the file /administrator/components/com_chronoforms5/chronoforms/actions/html/html.php - look for this code around line 641 and add the marked line.
		if($event_data['action'] == 'set_options'){
			$return .= $target_field.'.find("option").remove();';
			$options = array();
			if(!empty($event_data['options'])){
				$lines = explode("\n", $event_data['options']);
				foreach($lines as $line){
					$opts = explode("=", $line);
					$opts[1] = $form->translate($opts[1]);  // << add this line
					$options[$opts[0]] = $opts[1];
					$return .= $target_field.'.append(\'<option value="'.$opts[0].'">'.trim($opts[1]).'</option>\');'."\n";
				}
			}
		}

Bob
Marysia 27 Sep, 2015
Thank you GreyHead, it seems to work nicely🙂
Marysia 21 Mar, 2017
GreyHead, you still haven't fixed that, so after every update I have to manually add missing line😟
GreyHead 22 Mar, 2017
Hi Marysia,

Max is the developer - he gets to fix the bugs, not me. By all means remind him using the Contact us menu and linking to this thread.

Bob
This topic is locked and no more replies can be posted.