diff options
author | Derek Jones <derek.jones@ellislab.com> | 2011-07-02 00:40:48 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2011-07-02 00:40:48 +0200 |
commit | 4b9c62980599228f070b401c7673dce8085b0c61 (patch) | |
tree | 314bd87831a09913cbbfd1ffe1447b3c38b394c5 /user_guide/libraries/language.html | |
parent | 114ab0988e20ac6be39ad363ff897a1a3b85e565 (diff) |
backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance
Diffstat (limited to 'user_guide/libraries/language.html')
-rw-r--r-- | user_guide/libraries/language.html | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 1b253fa00..75863c2ac 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -60,30 +60,30 @@ Language Class <p>The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.</p> -<p>In your CodeIgniter system folder you'll find one called <dfn>language</dfn> containing sets of language files. You can create +<p>In your CodeIgniter system folder you'll find one called <dfn>language</dfn> containing sets of language files. You can create your own language files as needed in order to display error and other messages in other languages.</p> -<p>Language files are typically stored in your <dfn>system/language</dfn> directory. Alternately you can create a folder called <kbd>language</kbd> inside -your <kbd>application</kbd> folder and store them there. CodeIgniter will look first in your <dfn>application/language</dfn> -directory. If the directory does not exist or the specified language is not located there CI will instead look in your global +<p>Language files are typically stored in your <dfn>system/language</dfn> directory. Alternately you can create a folder called <kbd>language</kbd> inside +your <kbd>application</kbd> folder and store them there. CodeIgniter will look first in your <dfn>application/language</dfn> +directory. If the directory does not exist or the specified language is not located there CI will instead look in your global <dfn>system/language</dfn> folder.</p> -<p class="important"><strong>Note:</strong> Each language should be stored in its own folder. For example, the English files are located at: +<p class="important"><strong>Note:</strong> Each language should be stored in its own folder. For example, the English files are located at: <dfn>system/language/english</dfn></p> <h2>Creating Language Files</h2> -<p>Language files must be named with <kbd>_lang.php</kbd> as the file extension. For example, let's say you want to create a file -containing error messages. You might name it: <kbd>error_lang.php</kbd></p> +<p>Language files must be named with <kbd>_lang.php</kbd> as the file extension. For example, let's say you want to create a file +containing error messages. You might name it: <kbd>error_lang.php</kbd></p> <p>Within the file you will assign each line of text to an array called <var>$lang</var> with this prototype:</p> <code>$lang['language_key'] = "The actual message to be shown";</code> <p><strong>Note:</strong> It's a good practice to use a common prefix for all messages in a given file to avoid collisions with -similarly named items in other files. For example, if you are creating error messages you might prefix them with <var>error_</var></p> +similarly named items in other files. For example, if you are creating error messages you might prefix them with <var>error_</var></p> <code>$lang['<var>error</var>_email_missing'] = "You must submit an email address";<br /> $lang['<var>error</var>_url_missing'] = "You must submit a URL";<br /> @@ -92,12 +92,12 @@ $lang['<var>error</var>_username_missing'] = "You must submit a username";</code <h2>Loading A Language File</h2> -<p>In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:</p> +<p>In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:</p> <code>$this->lang->load('<samp>filename</samp>', '<dfn>language</dfn>');</code> <p>Where <samp>filename</samp> is the name of the file you wish to load (without the file extension), and <dfn>language</dfn> -is the language set containing it (ie, english). If the second parameter is missing, the default language set in your +is the language set containing it (ie, english). If the second parameter is missing, the default language set in your <kbd>application/config/config.php</kbd> file will be used.</p> @@ -109,7 +109,7 @@ is the language set containing it (ie, english). If the second parameter is miss <p>Where <samp>language_key</samp> is the array key corresponding to the line you wish to show.</p> -<p>Note: This function simply returns the line. It does not echo it for you.</p> +<p>Note: This function simply returns the line. It does not echo it for you.</p> <h3>Using language lines as form labels</h3> |