Download the PHP package mireiawen/translation without Composer
On this page you can find all versions of the php package mireiawen/translation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mireiawen/translation
More information about mireiawen/translation
Files in mireiawen/translation
Download mireiawen/translation
More information about mireiawen/translation
Files in mireiawen/translation
Vendor mireiawen
Package translation
Short Description Sets up the text translation domain and other settings for gettext translations
License MIT
Package translation
Short Description Sets up the text translation domain and other settings for gettext translations
License MIT
Please rate this library. Is it a good library?
Informations about the package translation
Translation
Helper class to set up the text translation domain and other settings for gettext translations
- Class name:
Translation
- Namespace:
Mireiawen\Translation
Requirements
- Intl extension
- PHP 7
Installation
You can clone or download the code from the GitHub repository or you can use composer: composer require mireiawen/translation
Methods
__construct
Translation::__construct(string $path, string $default_language, string $domain, string $codeset = 'UTF-8')
Set up the translation and try to detect the user settings
Arguments
- string
$path
- The filesystem path to the translations - string
$default_language
- The default language to use, if none can be determined - string
$domain
- The text domain to bind to - string
$codeset
- The character set to use with the translation file
Exceptions thrown
\Exception
- In case the extension is missing
- In case the translation folder does not exist
- In case the language cannot be determined
GetLanguage
Translation::GetLanguage()
Get the user's currently selected language
Return value
- string - The current language code
TranslateTo
Translation::TranslateTo(string $language, string $domain, string $codeset = 'UTF-8')
Set up the environment to load the correct translation file for the chosen language
Arguments
- string
$language
- The language to load - string
$domain
- The text domain to bind to - string
$codeset
- The character set to use with the translation file
Exceptions thrown
\Exception
- In case the language is empty
All versions of translation with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.3.0
ext-gettext Version *
ext-intl Version *
ext-gettext Version *
ext-intl Version *
The package mireiawen/translation contains the following files
Loading the files please wait ....