PHP Class lajax\translatemanager\services\scanners\ScannerFile
Language elements detected in JavaScript files:
~~~
lajax.t('language element);
lajax.t('language element {replace}', {replace:'String'});
lajax.t("language element");
lajax.t("language element {replace}", {replace:'String'});
~~~
Language elements detected in PHP files:
"t" functions:
~~~
::t('category of language element', 'language element');
::t('category of language element', 'language element {replace}', ['replace' => 'String']);
::t('category of language element', "language element");
::t('category of language element', "language element {replace}", ['replace' => 'String']);
~~~
Language elements detected in constant arrays:
~~~
**
* @translate
*\/
private $_GENDERS = ['Male', 'Female'];
**
* @translate
*\/
private $_STATUSES = [
self::STATUS_ACTIVE => 'Active',
self::STATUS_INACTIVE => 'Inactive'
];
~~~
Translation of constant arrays:
Translation to site language:
~~~
$genders = \lajax\translatemanager\helpers\Language::a($this->_GENDERS);
~~~
Translating to the language of your coice:
~~~
$statuses = \lajax\translatemanager\helpers\Language::a($this->_STATUSES, [], 'de-DE');
~~~
Afficher le fichier
Open project: lajax/yii2-translate-manager
Méthodes publiques
Protected Properties
Свойство |
Type |
Description |
|
$files |
|
Array to store patsh to project files. |
|
Méthodes publiques
Méthodes protégées
Private Methods
Méthode |
Description |
|
_getRoots ( ) : array |
Returns the root directories to scan. |
|
Method Details
__construct()
public méthode
public __construct ( Scanner $scanner ) |
$scanner |
lajax\translatemanager\services\Scanner |
|
checkTokens()
protected méthode
protected checkTokens ( $options, $translatorTokens, $tokens ) |
$options |
|
Definition of the parameters required to identify language elements. |
$translatorTokens |
|
Translation identification |
$tokens |
|
Tokens to search through |
containsTranslator()
protected méthode
Determines whether the file has any of the translators.
getLanguageItem()
abstract protected méthode
If there is no recognisable language element in the array, returns null.
initFiles()
protected méthode
isValidCategory()
protected méthode
Determines whether the category received as a parameter can be processed.
Property Details
$files protected_oe static_oe property
Array to store patsh to project files.
$module public_oe property
$scanner public_oe property