English > General Questions
Blank Screens
jstead:
Hehe no doubt, its great!
Was more so from the translation agency CAT program xliff export/import process side of things as we did a fair bit of back and forth when I was originally testing the process.
Quick question - Just noticed that the menu alias, aren't available in the menus-item xliff export. (i remember these being included?) Is there anything required to have them included?
Harald Leithner:
The menu alias will not be exported because there is no function that normalizes the input.
If you enter a space or a Uppercase character you have a problem with the url.
Maybe I should fix this.
You can change the export setting in the xml file. (there is something with export="false" or so)
jstead:
Hi Harald,
Which xml would i need to alter to have the alias field appear in an xliff export?
Could JFilterOutput::stringURLSafe() be utilized on this field during either saving (manual update) or importing?
http://docs.joomla.org/Supporting_SEF_URLs_in_your_component#The_Alias
Also trying to add in the K2 extra fields so they can be translated (even just manually). Would along the lines of adding
--- Code: ---<field type="text" name="K2ExtraField_6">Extra Fields</field>
--- End code ---
to the jdiction.xml in com_k2 be on the right track? (using the field name that I use [matches k2 input name])?
Basically would love to be able to get the extra field from image 1 attached, and have it appear under the translation menu like the other fields in image 2? As at the moment this one line will remain in english. Guessing this one is so tricky as everyone's Extra fields are different.
Thanks again for the great support on a great extension. Very much appreciated.
Harald Leithner:
The menu aliases are at /libraries/jdiction/tables/menus.xml in line 21 (remove export="false")
I know the function JFilterOutput::stringURLSafe() (btw the correct function is JApplicationHelper::stringURLSafe) but it needs to be tested and written.
I use this code in the translate function if you enter it by hand:
--- Code: --- if (version_compare(JVERSION, '3.2.0', 'ge') && (string)$this->reference->form->getField($k)->getAttribute('type') == 'jdalias') {
$refField = (string)$this->reference->form->getField($k)->getAttribute('field');
switch($status[$language->lang_code][$k]) {
case 'remove':
unset($langdata[$language->lang_code][$k]);
$isUpdated = true;
break;
case 'unchanged':
case 'changed':
default:
if ($langdata[$language->lang_code][$k] == '') {
$langdata[$language->lang_code][$k] = $langdata[$language->lang_code][$refField];
}
}
$langdata[$language->lang_code][$k] = JApplicationHelper::stringURLSafe($langdata[$language->lang_code][$k]);
if (trim(str_replace('-','',$langdata[$language->lang_code][$k])) == '') {
unset($langdata[$language->lang_code][$k]);
$isUpdated = true;
} else {
if ($data['value'][$k] != $langdata[$language->lang_code][$k]) {
$isUpdated = true;
}
}
unset($refField);
} else {...
--- End code ---
But this code works only for Joomla 3.2+, because some xml restrictions with 2.5.
I should also give the option to export the alias because many translator don't understand this field or do double work.
So yes I will include it but need some time ;-)
Harald Leithner:
The k2 thing is much more tricky because the fields are saved in json array and splitted in multiple tables.
the only thing you can do is to uncomment:
--- Code: ---<!--
<field type="text" name="extra_fields">Extra Fields</field>
<field type="text" name="extra_fields_search" maxlength="255">Extra Field Search</field>
-->
--- End code ---
by removing <!-- and -->
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version