Commit 0726fb8e authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #1415 from j20/patch-1

Update laravel/documentation/localization.md
parents e1d081bd 39320dc8
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
Localization is the process of translating your application into different languages. The **Lang** class provides a simple mechanism to help you organize and retrieve the text of your multilingual application. Localization is the process of translating your application into different languages. The **Lang** class provides a simple mechanism to help you organize and retrieve the text of your multilingual application.
All of the language files for your application live under the **application/language** directory. Within the **application/language** directory, you should create a directory for each language your application speaks. So, for example, if your application speaks English and Spanish, you might create **en** and **sp** directories under the **language** directory. All of the language files for your application live under the **application/language** directory. Within the **application/language** directory, you should create a directory for each language your application speaks. So, for example, if your application speaks English and Spanish, you might create **en** and **es** directories under the **language** directory.
Each language directory may contain many different language files. Each language file is simply an array of string values in that language. In fact, language files are structured identically to configuration files. For example, within the **application/language/en** directory, you could create a **marketing.php** file that looks like this: Each language directory may contain many different language files. Each language file is simply an array of string values in that language. In fact, language files are structured identically to configuration files. For example, within the **application/language/en** directory, you could create a **marketing.php** file that looks like this:
...@@ -23,7 +23,7 @@ Each language directory may contain many different language files. Each language ...@@ -23,7 +23,7 @@ Each language directory may contain many different language files. Each language
); );
Next, you should create a corresponding **marketing.php** file within the **application/language/sp** directory. The file would look something like this: Next, you should create a corresponding **marketing.php** file within the **application/language/es** directory. The file would look something like this:
return array( return array(
...@@ -50,7 +50,7 @@ Need to retrieve the line in a language other than your default? Not a problem. ...@@ -50,7 +50,7 @@ Need to retrieve the line in a language other than your default? Not a problem.
#### Getting a language line in a given language: #### Getting a language line in a given language:
echo Lang::line('marketing.welcome')->get('sp'); echo Lang::line('marketing.welcome')->get('es');
<a name="replace"></a> <a name="replace"></a>
## Place Holders & Replacements ## Place Holders & Replacements
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment