From 123bb20c52e0e9d6a622e14bac33e05b10ffc013 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 19 Jul 2013 16:37:51 -0700 Subject: Updating user guide :php:func: refs to :func: --- user_guide_src/source/libraries/language.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src/source/libraries/language.rst') diff --git a/user_guide_src/source/libraries/language.rst b/user_guide_src/source/libraries/language.rst index d288cd65e..e772e8e27 100644 --- a/user_guide_src/source/libraries/language.rst +++ b/user_guide_src/source/libraries/language.rst @@ -79,7 +79,7 @@ Using language lines as form labels ----------------------------------- This feature has been deprecated from the language library and moved to -the :php:func:`lang()` function of the :doc:`Language Helper +the :func:`lang()` function of the :doc:`Language Helper <../helpers/language_helper>`. Auto-loading Languages -- cgit v1.2.3-24-g4f1b From ae72dc60a833b60f9def05ff3c4bc68f5407d80d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 3 Jan 2014 18:15:24 +0200 Subject: [ci skip] Update the Language library docs --- user_guide_src/source/libraries/language.rst | 39 +++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'user_guide_src/source/libraries/language.rst') diff --git a/user_guide_src/source/libraries/language.rst b/user_guide_src/source/libraries/language.rst index e772e8e27..3cee5d7f6 100644 --- a/user_guide_src/source/libraries/language.rst +++ b/user_guide_src/source/libraries/language.rst @@ -19,11 +19,18 @@ your **application/language/** directory. .. note:: Each language should be stored in its own folder. For example, the English files are located at: system/language/english +.. contents:: + :local: + +.. raw:: html + +
+ Creating Language Files ======================= -Language files must be named with **_lang.php** as the file extension. For -example, let's say you want to create a file containing error messages. +Language files must be named with **_lang.php** as the filename extension. +For example, let's say you want to create a file containing error messages. You might name it: error_lang.php Within the file you will assign each line of text to an array called @@ -89,4 +96,30 @@ If you find that you need a particular language globally throughout your application, you can tell CodeIgniter to :doc:`auto-load <../general/autoloader>` it during system initialization. This is done by opening the **application/config/autoload.php** file and adding the -language(s) to the autoload array. \ No newline at end of file +language(s) to the autoload array. + +*************** +Class Reference +*************** + +.. class:: CI_Lang + + .. method:: load($langfile[, $idiom = ''[, $return = FALSE[, $add_suffix = TRUE[, $alt_path = '']]]]) + + :param string $langfile: Language file to load + :param string $idiom: Language name (i.e. 'english') + :param bool $return: Whether to return the loaded array of translations + :param bool $add_suffix: Whether to add the '_lang' suffix to the language file name + :param string $alt_path: An alternative path to look in for the language file + :returns: void or array if the third parameter is set to TRUE + + Loads a language file. + + .. method:: line($line[, $log_errors = TRUE]) + + :param string $line: Language line key name + :param bool $log_errors: Whether to log an error if the line isn't found + :returns: string or FALSE on failure + + Fetches a single translation line from the already loaded language files, + based on the line's name. \ No newline at end of file -- cgit v1.2.3-24-g4f1b From de1fe7d504898bc6a42e24b4c73da3887a9933d6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 20 Jan 2014 17:06:16 +0200 Subject: [ci skip] Add 'Using the X class' headings to Session & Language lib docs Fixes 2 doc compile warnings --- user_guide_src/source/libraries/language.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'user_guide_src/source/libraries/language.rst') diff --git a/user_guide_src/source/libraries/language.rst b/user_guide_src/source/libraries/language.rst index 3cee5d7f6..10449b935 100644 --- a/user_guide_src/source/libraries/language.rst +++ b/user_guide_src/source/libraries/language.rst @@ -26,6 +26,10 @@ your **application/language/** directory.
+************************ +Using the Language Class +************************ + Creating Language Files ======================= -- cgit v1.2.3-24-g4f1b From 28c2c975b118016d07212ed8e7c22ff280309f82 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 8 Feb 2014 04:27:48 +0200 Subject: [ci skip] Add return types to library docs --- user_guide_src/source/libraries/language.rst | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'user_guide_src/source/libraries/language.rst') diff --git a/user_guide_src/source/libraries/language.rst b/user_guide_src/source/libraries/language.rst index 10449b935..3014d8f09 100644 --- a/user_guide_src/source/libraries/language.rst +++ b/user_guide_src/source/libraries/language.rst @@ -110,20 +110,22 @@ Class Reference .. method:: load($langfile[, $idiom = ''[, $return = FALSE[, $add_suffix = TRUE[, $alt_path = '']]]]) - :param string $langfile: Language file to load - :param string $idiom: Language name (i.e. 'english') - :param bool $return: Whether to return the loaded array of translations - :param bool $add_suffix: Whether to add the '_lang' suffix to the language file name - :param string $alt_path: An alternative path to look in for the language file - :returns: void or array if the third parameter is set to TRUE + :param string $langfile: Language file to load + :param string $idiom: Language name (i.e. 'english') + :param bool $return: Whether to return the loaded array of translations + :param bool $add_suffix: Whether to add the '_lang' suffix to the language file name + :param string $alt_path: An alternative path to look in for the language file + :returns: Array of language lines if $return is set to TRUE, otherwise void + :rtype: mixed Loads a language file. .. method:: line($line[, $log_errors = TRUE]) - :param string $line: Language line key name - :param bool $log_errors: Whether to log an error if the line isn't found - :returns: string or FALSE on failure + :param string $line: Language line key name + :param bool $log_errors: Whether to log an error if the line isn't found + :returns: Language line string or FALSE on failure + :rtype: string Fetches a single translation line from the already loaded language files, based on the line's name. \ No newline at end of file -- cgit v1.2.3-24-g4f1b