- Posts: 14
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Muli-Lingual Site Question: How to translate Extra Fields + Content?
Muli-Lingual Site Question: How to translate Extra Fields + Content?
- SPOTTERON
- Topic Author
- Offline
- New Member
Less
More
4 years 10 months ago #174580
by SPOTTERON
Old member
Muli-Lingual Site Question: How to translate Extra Fields + Content? was created by SPOTTERON
One question regarding K2 and using more then one language:
As far as I could see, K2 is not being able to set language translations for the Extra Field names and contents.
For building a multi-language site, this is one of the biggest issues currently. We have a project for a page in Switzerland, which by the country's requirements needs to be available both in French and German. We would need to have dynamic translations for both title and the contents of the extra field (from given selections to text field content, which is input by the administrators)
Is there any other way to do multi language translations with extra fields or am I simply missing something?:)
Furthermore we include Extra Fields in the item.php in the html override section of the template like:
<?php if($this->item->extraFields->Country && $this->item->extraFields->Country->value != ''): ?>
<div class="extra country">
<b>Region:</b> <?php echo $this->item->extraFields->Country->value; ?></div>
<?php endif; ?>
"Region" here is hardcoded, this should display the Extra Field Name.
thank you and best regards from Vienna!
As far as I could see, K2 is not being able to set language translations for the Extra Field names and contents.
For building a multi-language site, this is one of the biggest issues currently. We have a project for a page in Switzerland, which by the country's requirements needs to be available both in French and German. We would need to have dynamic translations for both title and the contents of the extra field (from given selections to text field content, which is input by the administrators)
Is there any other way to do multi language translations with extra fields or am I simply missing something?:)
Furthermore we include Extra Fields in the item.php in the html override section of the template like:
<?php if($this->item->extraFields->Country && $this->item->extraFields->Country->value != ''): ?>
<div class="extra country">
<b>Region:</b> <?php echo $this->item->extraFields->Country->value; ?></div>
<?php endif; ?>
"Region" here is hardcoded, this should display the Extra Field Name.
thank you and best regards from Vienna!
Old member
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
4 years 10 months ago #174592
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Muli-Lingual Site Question: How to translate Extra Fields + Content?
Since multi-lingual handling in Joomla is now essentially separate content that you simply map to a language, all you need to do is simply create separate extra field sets (groups), map them to separate categories and accordingly to separate items.
In other words, you create content in German, map it to categories designated for German, with associated extra field groups for the German language. Repeat the same for French.
Since content from extra fields is tied to each item, you would never see a German item with data from the French equivalent.
The only thing that is missing from K2 is a way to map cross language content (associate translations). In other words, when you visitors read item X in German and then click the language switcher for French, they won't get the translation for that item but rather be redirected to the French home page.
But this will be launched pretty soon (as in next week) in the form of a new K2 plugin. This plugin allows you to easily associate one K2 item with one or more in other languages, so language switching in the frontend is transparent to your visitors.
In other words, you create content in German, map it to categories designated for German, with associated extra field groups for the German language. Repeat the same for French.
Since content from extra fields is tied to each item, you would never see a German item with data from the French equivalent.
The only thing that is missing from K2 is a way to map cross language content (associate translations). In other words, when you visitors read item X in German and then click the language switcher for French, they won't get the translation for that item but rather be redirected to the French home page.
But this will be launched pretty soon (as in next week) in the form of a new K2 plugin. This plugin allows you to easily associate one K2 item with one or more in other languages, so language switching in the frontend is transparent to your visitors.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Okan
- Offline
- New Member
Less
More
- Posts: 8
4 years 2 months ago #176900
by Okan
Replied by Okan on topic Muli-Lingual Site Question: How to translate Extra Fields + Content?
You can do it like this
add this codes to your override files
<?php echo JText::_($extraField->name); ?>
<?php echo JText::_($extraField->value); ?>
and than create your extra field with override language constant.
add this codes to your override files
<?php echo JText::_($extraField->name); ?>
<?php echo JText::_($extraField->value); ?>
and than create your extra field with override language constant.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
4 years 2 months ago #176906
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Muli-Lingual Site Question: How to translate Extra Fields + Content?
Good thought Okan ;)
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Muli-Lingual Site Question: How to translate Extra Fields + Content?