Hello,
iam trying to:
a.)redirect with a button to external dynamical url based on selected language
b.)changing the form-mehod to Get request to get the form params
a.)how to build a action-url dynamically based on selected language???
maybe it is easier to build different forms for different languages?
custom code for button at the moment:
b.)ok.. could this be done better than this?
iam trying to:
a.)redirect with a button to external dynamical url based on selected language
b.)changing the form-mehod to Get request to get the form params
a.)how to build a action-url dynamically based on selected language???
maybe it is easier to build different forms for different languages?
custom code for button at the moment:
jQuery(function() {
jQuery('#Submit_id').click(function(){
jQuery('#chronoform-FormA_id').attr('method', 'get').attr('action', 'url');
});
});
b.)ok.. could this be done better than this?
i have seen here:https://www.chronoengine.com/faqs/64-cfv4/cfv4-using-the-datepicker/3330-how-do-i-set-the-date-picker-language.html
there is
would this be usable for something like this?
i need url dynamic like
urlpart1.urlpart2 /?field=params&field=..
urlpart1=http://domain
urlpart2=selected lang???
there is
<?php
$lang =& JFactory::getLanguage();
$tag = $lang->getTag();
echo "Locale.use('{$tag}');";
?>
would this be usable for something like this?
i need url dynamic like
urlpart1.urlpart2 /?field=params&field=..
urlpart1=http://domain
urlpart2=selected lang???
Hi mdma,
Where is the language being selected? That makes a big difference to how you do this. Is it the site language, (or the browser language), or is the user selecting in the form?
Bob
Where is the language being selected? That makes a big difference to how you do this. Is it the site language, (or the browser language), or is the user selecting in the form?
Bob
Hi!
Site language, selected by user.
multilingual site, (de, en, it, fr )
Joomla onboard language switcher
Why i ask:
1.) i have html inside custom-code to translate
is there a way to add php/html to locale settings?
a big bunch of code somehow with " , '
2.)i need to switch javascript based on language set..
Site language, selected by user.
multilingual site, (de, en, it, fr )
Joomla onboard language switcher
Why i ask:
1.) i have html inside custom-code to translate
is there a way to add php/html to locale settings?
a big bunch of code somehow with " , '
2.)i need to switch javascript based on language set..
Hi mdma,
You can resolve most of these question (perhaps all of them) using the code that you already have plus a PHP switch statement:
You can use the same code in a Load JavaScript action to load different scripts or parts of scripts.
Bob
You can resolve most of these question (perhaps all of them) using the code that you already have plus a PHP switch statement:
<?php
$lang = \JFactory::getLanguage();
$tag = $lang->getTag();
switch ( $tag ) {
case 'de-DE':
default:
//set some value here or add some code
break;
case 'fr-FR':
// French code here
break;
. . .
}
?>
ChronoForms also supports Locales which will use search and replace to change labels in the form HTML and some other places.
You can use the same code in a Load JavaScript action to load different scripts or parts of scripts.
Bob
...Locales:
are these only one-liners like:
#String to be replaced#=some Text
or would it also be possible to enclose in some way like:
#String#={alot of html containing =, " <div class=blabla><h1>oirfroinf....}
You can use the same code in a Load JavaScript action to load different scripts or parts of scripts:
you mean i can mix javascript with php inside javascript-action?
or is it meant to switch(include) different javascript based on php-code
are these only one-liners like:
#String to be replaced#=some Text
or would it also be possible to enclose in some way like:
#String#={alot of html containing =, " <div class=blabla><h1>oirfroinf....}
You can use the same code in a Load JavaScript action to load different scripts or parts of scripts:
you mean i can mix javascript with php inside javascript-action?
or is it meant to switch(include) different javascript based on php-code
Hi mdma,
or would it also be possible to enclose in some way like: No - you can't do that - use the Switch structure instead.
you mean i can mix javascript with php inside javascript-action? as long as the result is valid JavaScript e.g.
Bob
or would it also be possible to enclose in some way like: No - you can't do that - use the Switch structure instead.
you mean i can mix javascript with php inside javascript-action? as long as the result is valid JavaScript e.g.
<?php
$lang = \JFactory::getLanguage();
$tag = $lang->getTag();
echo "alert($tag);";
?>
Bob
thank you i am nearly getting it completely my last question regarding this:
i stumbled upon:http://www.chronoengine.com/faqs/2669-how-can-i-translate-emails.html
which should be called "advanced multilanguage" in faq 😀
regarding this code snippet:
how would that look like for including js-files? instead of "include"
i stumbled upon:http://www.chronoengine.com/faqs/2669-how-can-i-translate-emails.html
which should be called "advanced multilanguage" in faq 😀
regarding this code snippet:
<?php
$lang =& JFactory::getLanguage();
$tag =& $lang->getTag();
include (JPATH_SITE."/components/com_chronoforms/includes/{$form->form_details->name}/email_template.{$tag}.php");
?>
how would that look like for including js-files? instead of "include"
include (JPATH_SITE."/components/com_chronoforms/includes/custom.{$tag}.js
i have seen this but dont know if/how this can be combined:
<?php
$jdoc =& JFactory::getDocument();
$jdoc->addScript('file_url');
?>
<?php
$lang =& JFactory::getLanguage();
$tag =& $lang->getTag();
$jdoc =& JFactory::getDocument();
$jdoc->addScript(JURI::root().'libraries/cegcore/assets/js/c1.$tag.js');
echo $tag;
?>
...in custom code action...
the script doesnt get loaded: 404 c1.$tag.js
also
$jdoc->addScript(JURI::root().'libraries/cegcore/assets/js/c1.{$tag}.js');
404 c1.%7B$tag%7D.js
This topic is locked and no more replies can be posted.