Author:
jensscherbl
Version:
1.1.0
Released:
15 September 2014
Category:
Multilingual

Browse

Description

Configuration

Go to System › Preferences and provide a comma-separated list of ISO 639-1 language codes in the "Multilingual"-section of your preferences screen.

Preferences

The first language in your list is considered the default language.

The $languages and $language parameters will be added to your XML output.

<params>
    <languages>
        <item handle="en">en</item>
        <item handle="de">de</item>
    </languages>
    <language>en</language>
</params>

Sections: Fields

The very special approach of this extension (reduce reliance on too many third party extensions, leave as much to core functionality as possible) doesn't require special multilingual field types.

Use whatever (non-multilingual) field type you like by adding a dedicated field for each of your supported languages.

Sections: Fields

You just need to make sure that each translation of field shares the same field handle, followed by a dash and the language code as specified in your settings.

In most cases, it's recommended to mark at least all fields for the default language as required.

Translations for a field can always be optional.

Sections: UI

To provide your clients with a clean and simple user interface, you should use an additional UI extensions like Parenthesis Tabs.

Sections: UI

Data Sources: Filters

You only have to add the fields by which you want to filter your data sources in the default language.

Data Sources: Filters

The extension takes care of filtering your entries in the current language and falls back to the default language for a specific filter, if no translation is provided.

Data Sources: Output

Make sure to select all languages for a field in the data source editor's "XML Output"-section.

Data Sources: Output

The extension removes the language segment from the field name and provides lang- and translated-attributes instead.

<entry>
    <title lang="en" translated="yes" handle="the-extremes-of-good-and-evil">
        The Extremes of Good and Evil
    </title>
    <title lang="de" translated="yes" handle="das-hoechste-gut-und-uebel">
        Das höchste Gut und Übel
    </title>
</entry>

In your XSLT, you can now use the $language-parameter to get the translation for the current language.

<xsl:value-of select="title[@lang = $language]"/>

If a translation isn't provided for a specific language, the extension provides a fallback to the default language in your XML output.

<entry>
    <title lang="en" translated="yes" handle="the-extremes-of-good-and-evil">
        The Extremes of Good and Evil
    </title>
    <title lang="de" translated="no" handle="the-extremes-of-good-and-evil">
        The Extremes of Good and Evil
    </title>
</entry>

You can check if a field has actually been translated or uses fallback content by testing the translated-attribute.

<xsl:if test="title[@lang = $language]/@translated = 'yes'">
    <xsl:value-of select="title[@lang = $language]"/>
</xsl:if>

Repository

https://github.com/jensscherbl/multilingual

Discuss this Extension

Compatibility

2.7.10 Unsure
2.7.9 Unsure
2.7.8 Unsure
2.7.7 Unsure
2.7.6 Unsure
2.7.5 Unsure
2.7.4 Unsure
2.7.3 Unsure
2.7.2 Unsure
2.7.1 Unsure
2.7.0 Unsure
2.6.11 Unsure
2.6.10 Unsure
2.6.9 Unsure
2.6.8 Unsure
2.6.7 Unsure
2.6.6 Unsure
2.6.5 Unsure
2.6.4 Unsure
2.5.4 Unsure

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details