Download the PHP package brightnucleus/localization without Composer
On this page you can find all versions of the php package brightnucleus/localization. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download brightnucleus/localization
More information about brightnucleus/localization
Files in brightnucleus/localization
Package localization
Short Description WordPress localization for Bright Nucleus components.
License MIT
Informations about the package localization
Bright Nucleus Localization
WordPress localization for Bright Nucleus components.
Table Of Contents
- Installation
- Basic Usage
- Filters
- Contributing
- License
Installation
The best way to use this package is through Composer:
Basic Usage
This package provides a trait to be used within Bright Nucleus components to load the translation files (compiled *.mo
-files) for a given locale.
To use the trait, import it into your class, and call the loadLocalization( $domain, $path )
method.
Example:
Filters
Each loading of localization files passes through two filters:
-
__
Localization::LOCALE_FILTER
__ - Filter the locale of a Bright Nucleus library.Arguments:
$locale
(string) - The plugin's current locale.$domain
(string) - Text domain. Unique identifier for retrieving translated strings.
Return value:
$locale
(string) - Filtered locale.
-
__
Localization::MOFILE_FILTER
__ - Filter the name of the MO-file of a Bright Nucleus library.Arguments:
$path
(string) - Path to the MO-file.$locale
(string) - The plugin's current locale.$domain
(string) - Text domain. Unique identifier for retrieving translated strings.
Return value:
$path
(string) - Fitlered path to the MO-file.
Contributing
All feedback / bug reports / pull requests are welcome.
License
Copyright (c) 2016 Alain Schlesser, Bright Nucleus
This code is licensed under the MIT License.