Skip to content

arvinsim/CI_Multilanguage_Module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

#CI Multilanguage Module

ExpressionEngine module that supports Multilanguage features by leveraging underlying Codeigniter's language structure

Requirements

ExpressionEngine 2.7+

Changelog

0.3

  • Added new method, does_translation_exists()
  • Updated get_translation() to return empty string if it cannot find language variable

0.2

  • Implemented get_translation()
  • Updated README

0.1

  • Initial implementation

How to use

{exp:ci_multilanguage:does_language_exists}

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

{exp:ci_multilanguage:get_translation}

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>

{exp:ci_multilanguage:get_user_language_id}

Use this to get the id of the language that is currently being used

{exp:ci_multilanguage:switch_language_form}

Documentation coming soon

{exp:ci_multilanguage:switch_language_list}

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>

About

ExpressionEngine module that supports Multilanguage features by leveraging underlying Codeigniter's language structure

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages