How to translate text and textfields with Joomfish

From JReviews Documentation
Jump to: navigation, search


In JReviews, text fields and textrea fields have to be added to a file to get to be known to Joomfish.


1. How to make listing fields (text, textarea) translatable

The red cornered fields should be made translatable. There are 2 textfields and one textarea.

Joomfish1.jpg


Create a new file named "jreviews_content.xml" with the following code:

<?xml version="1.0" ?>
<joomfish type="contentelement">
<name>jReviews Content</name>
<author>Thorsten</author>
<version>1.0</version>
<description>Definition for JReviews custom field content</description>
  <reference>
    <table name="jreviews_content">
      <field type="referenceid" name="contentid" translate="0">ID</field>
      <field type="titletext" name="contentid" translate="1">ID</field>	  
      <field type="text" name="jr_name" translate="1">Name</field>
      <field type="text" name="jr_hersteller" translate="1">Hersteller</field>
	  <field type="textarea" name="jr_herstellerdescription" translate="1">Herstellerbeschreibung</field>
    </table>
  </reference>
</joomfish>


For every text field you have to create another line like this:

<field type="text" name="Field Name" translate="1">Title</field>


Field Name: Text in jReviews -> Field Manager -> Field Name Title: Text in jReviews -> Field Manager -> Title


2. How to make review fields (text, textarea) translatable

The red cornered field should be made translatable. There is one textfield.

Joomfish2.jpg


Create a new file named "jreviews_review_fields.xml" with the following code

<?xml version="1.0" ?>
<joomfish type="contentelement">
<name>jReviews Review Fields</name>
<author>Thorsten</author>
<version>1.0</version>
<description>Definition for JReviews custom field content</description>
  <reference>
    <table name="jreviews_review_fields">
      <field type="referenceid" name="reviewid" translate="0">ID</field>
      <field type="titletext" name="reviewid" translate="1">ID</field>	 
      <field type="text" name="jr_reviewfield" translate="1">Review Field1</field>
 
    </table>
  </reference>
</joomfish>


For every text field you have to create another line like this:

<field type="text" name="Field Name" translate="1">Title</field>


Field Name: Text in JReviews -> Field Manager -> Field Name Title: Text in JReviews -> Field Manager -> Title

Upload the 2 files into this folder:

  • /administrator/components/com_joomfish/contentelements

Here a screenshot from Joomfish menu with the 2 new menu items for the custom fields:


Joomfish3.jpg