ExpressionEngine module that supports Multilanguage features by leveraging underlying Codeigniter's language structure
ExpressionEngine 2.7+
- Added new method, does_translation_exists()
- Updated get_translation() to return empty string if it cannot find language variable
- Implemented get_translation()
- Updated README
- Initial implementation
Use this to check if a language variable exists
{exp:ci_multilanguage:does_language_exists name="heading_company_name"}
Parameters
- name
- The key of the language variable
Use this function to get a language variable
{exp:ci_multilanguage:get_translation name="heading_company_name" file="application"}
Parameters
- name
- The key of the language variable
<dt>args</dt>
<dd>
This is used to pass data for language variable strings that need to be "printf"'ed.
An example would be a string like
<pre>This is a %s.</pre>
or
<pre>This %s is better than %s.</pre>
To pass multiple values, pass a string using || as a separator
<pre>Apples||Oranges||Lemons</pre>
</dd>
<dt>file</dt>
<dd>
The language file to find the language variable. Keep in mind that you don't need to pass the <code>_lang</code> suffix
So if the file is named <code>application_lang.php</code> just pass <code>application</code>.
</dd>
Use this to get the id of the language that is currently being used
Documentation coming soon
Use this to get the list of languages available for the
{exp:ci_multilanguage:switch_language_list} {preferred_user_language_id} {preferred_user_language_name} {other_languages} {link_url} {language_id} {language_name} {/other_languages} {/exp:ci_multilanguage:switch_language_list}
Variables
- preferred_user_language_name
- The id of the preferred user language
<dt>preferred_user_language_name</dt>
<dd>The name of the preferred user language</dd>
<dt>other_languages</dt>
<dd>
A list of languages and their data that are not currently selected
<dl>
<dt>link_url</dt>
<dd>the url to go to change the current language into this language</dd>
<dt>language_id</dt>
<dd>The id of the language</dd>
<dt>language_name</dt>
<dd>The name of the language</dd>
</dl>
</dd>