Hi Bob and Max,
I have added to the top of
../components/com_chronoforms/chronoforms.php
amd
../plugins/content/chronoforms.php
JFactory::getLanguage()->load('com_chronoforms');
add to xml:
<languages folder="language">
<language tag="en-GB">en-GB.com_chronoforms.ini</language>
</languages>
since I would also like the submit button to be translated the config param input_value will be obsolete:
find in ../administrator/components/com_chronoforms/form_elements/input_submit.ctp:
<input type="button" name="submit_{n}_input_name" id="submit_{n}_input_id" value="<?php echo $element_params['input_value']; ?>" />
and adjust for:
<input type="button" name="submit_{n}_input_name" id="submit_{n}_input_id" value="<?php echo JText::_('SUBMIT'); ?>" />
find:
<input type="hidden" name="chronofield[{n}][input_submit_{n}_input_class]" id="input_submit_{n}_input_class" value="<?php echo $element_params['input_class']; ?>" />
and adjust for:
<input type="hidden" name="chronofield[{n}][input_submit_{n}_input_class]" id="input_submit_{n}_input_class" value="<?php echo JText::_('SUBMIT'); ?>" />
delete:
<?php echo $HtmlHelper->input('input_submit_{n}_input_value_config', array('type' => 'text', 'label' => 'Text', 'class' => 'small_input', 'value' => '')); ?>
find in ../administrator/components/com_chronoforms/form_elements/input_submit.php:
$element_params = array(
'input_name' => 'input_submit_{n}',
'input_id' => '',
'input_class' => '',
'input_value' => 'Submit');
and adjust for:
$element_params = array(
'input_name' => 'input_submit_{n}',
'input_id' => '',
'input_class' => '');
currently I have 77 rows in my language file. what is working fine is when using <?php echo JTEXT::_('SOMETHING'); ?> for options, label text, show empty (on elements) and in custom code actions. I can however not get the submit button (or the reset / cancel buttons introduced by Bob here:
http://chronoengine.com/forums.html?cont=posts&f=26&t=23136) to pick up the language string - language debugging confirms that (everything but the buttons are being translated)
some more observations:
this:
<input type="button" name="submit_{n}_input_name" id="submit_{n}_input_id" value="<?php echo JText::_('SUBMIT'); ?>" />
makes the submit button be displayed on admin side as 'Submit'
pls note that SUBMIT is being displayed as Submit
if I adjust this:
<input type="hidden" name="chronofield[{n}][input_submit_{n}_input_class]" id="input_submit_{n}_input_class" value="<?php echo JText::_('SUBMIT'); ?>" />
for:
<input type="hidden" name="chronofield[{n}][input_submit_{n}_input_class]" id="input_submit_{n}_input_class" value="<?php echo JText::_('SPEICHERN'); ?>" />
( user side is in German/ admin side in English)
that will be displayed as 'SPEICHERN' on user side. To get a regular spelling I would need to use:
<input type="hidden" name="chronofield[{n}][input_submit_{n}_input_class]" id="input_submit_{n}_input_class" value="<?php echo JText::_('Speichern'); ?>" />
do you happen to have an idea why the language file doesn't work for these buttons?