Download the PHP package eden/language without Composer
On this page you can find all versions of the php package eden/language. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eden/language
More information about eden/language
Files in eden/language
Package language
Short Description Eden language component.
License MIT
Homepage http://eden-php.com
Informations about the package language
Eden Language
- Install
- Introduction
- API
- get
- getLanguage
- save
- translate
- Contributing
====
Install
composer install eden/language
====
Introduction
Languages in Eden are fairly robust, simply defined and designed to work with other translating services such as Google Translate. The follow figure shows how to set up a french translator.
Figure 1. French Translator
For ease of use we also made the language object accessable as an array. The next figure shows the same as Figure 1
except that it's usings arrays to manipulate the object.
Figure 2. Languages as Arrays
Most commonly, websites using languages usually start and end with loading and saving translation files. Using Eden's language object through the life of the page and later saving will keep your languages file always up to date.
Note: Eden does not do the actual translating on its own. Once the file is generated and saved you should run it through a translating service.
Figure 3. Loading and Saving a Language File
====
API
====
get
Returns the translated key. if the key is not set it will set the key to the value of the key
Usage
Parameters
string
Returns string
Example
====
getLanguage
Return the language set
Usage
Parameters
Returns array
====
save
Saves the language to a file
Usage
Parameters
string|null $file
- The file to save to
Returns this
Example
====
translate
Sets the translated value to the specified key
Usage
Parameters
*string $key
- The translation key*string $value
- The default value if we cannot find the translation
Returns this
Example
====
Contributing to Eden
Contributions to Eden are following the Github work flow. Please read up before contributing.
Setting up your machine with the Eden repository and your fork
- Fork the repository
- Fire up your local terminal create a new branch from the
v4
branch of your fork with a branch name describing what your changes are. Possible branch name types:- bugfix
- feature
- improvement
- Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")
Making pull requests
- Please ensure to run
phpunit
before making a pull request. - Push your code to your remote forked version.
- Go back to your forked version on GitHub and submit a pull request.
- An Eden developer will review your code and merge it in when it has been classified as suitable.
All versions of language with dependencies
eden/core Version 4.*
eden/string Version 4.*
eden/array Version 4.*
eden/path Version 4.*
eden/file Version 4.*