PHP Класс Bolt\Translation\TranslationFile

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Silex\Application $app, string $domain, string $locale ) Constructor.
content ( ) : string Gets all translatable strings and returns a translationsfile for messages or contenttypes.
isWriteAllowed ( ) : boolean Checks if translations file is allowed to write to.
path ( ) : array Get the path to a tranlsation resource.

Приватные методы

Метод Описание
addTranslatable ( string $text ) Adds a string to the internal list of translatable strings.
buildNewContent ( array $newTranslations, array $savedTranslations, array $hinting = [] ) : string Builds the translations file data with added translations.
buildPath ( string $domain, string $locale ) : array Get the path to a tranlsation resource.
contentContenttypes ( ) : string Gets all translatable strings and returns a translationsfile for messages or contenttypes.
contentInfo ( ) : string Get the content of the info translation file or the fallback file.
contentMessages ( ) : string Gets all translatable strings and returns a translationsfile for messages or contenttypes.
gatherTranslatableStrings ( ) : array Find all twig templates and bolt php code, extract translatables strings, merge with existing translations.
readSavedTranslations ( ) : array Parses translations file and returns translations.
scanContenttypeFields ( ) Add fields names and labels for contenttype (forms) to the list of translatable strings.
scanContenttypeRelations ( ) Add relation names and labels to the list of translatable strings.
scanPhpFiles ( ) Scan php files for __('.
scanTaxonomies ( ) Add name ans singular names for taxonomies to the list of translatable strings.
scanTwigFiles ( ) Scan twig templates for __('.

Описание методов

__construct() публичный метод

Constructor.
public __construct ( Silex\Application $app, string $domain, string $locale )
$app Silex\Application
$domain string Requested resource
$locale string Requested locale

content() публичный метод

Gets all translatable strings and returns a translationsfile for messages or contenttypes.
public content ( ) : string
Результат string

isWriteAllowed() публичный метод

Checks if translations file is allowed to write to.
public isWriteAllowed ( ) : boolean
Результат boolean

path() публичный метод

Get the path to a tranlsation resource.
public path ( ) : array
Результат array [absolute path, relative path]