ComponentTranslations
trait ComponentTranslations
View component translations trait
Methods
array
getComponentTranslations(string $componentName, string $type = 'components')
Get package view components translations
array|false
readTranslation(string $componentName, string|null $language, string $type = 'components')
Read language translation
string
getTranslationRelativeFileName(string $componentName, string|null $language, string $type = 'components')
Get translation relative file name path
string
getTranslationFileName(string $componentName, string|null $language, string $type = 'components')
Get translation file name
bool
saveTranslation(array $data, string $componentName, string|null $language, string $type = 'components')
Save translation
mixed
readTranlationProperty(array|string $data, string $key, string $separator = '_', string|null $language = null, string $type = 'components')
Get translation property value
array
setTranslationProperty(array $data, string $key, mixed $value, string $separator = '_')
Set translation property value
string
resolveTranslationFileName(string $path, string|null $language)
Resolve translation file name
bool
hasLanguage(array $translations, string|null $language)
Return true if component have language
array
getComponentLanguages(array $componentFiles)
Get component languages
Details
at line 39
array
getComponentTranslations(string $componentName, string $type = 'components')
Get package view components translations
at line 67
array|false
readTranslation(string $componentName, string|null $language, string $type = 'components')
Read language translation
at line 82
string
getTranslationRelativeFileName(string $componentName, string|null $language, string $type = 'components')
Get translation relative file name path
at line 97
string
getTranslationFileName(string $componentName, string|null $language, string $type = 'components')
Get translation file name
at line 119
bool
saveTranslation(array $data, string $componentName, string|null $language, string $type = 'components')
Save translation
at line 145
mixed
readTranlationProperty(array|string $data, string $key, string $separator = '_', string|null $language = null, string $type = 'components')
Get translation property value
at line 166
array
setTranslationProperty(array $data, string $key, mixed $value, string $separator = '_')
Set translation property value
at line 178
string
resolveTranslationFileName(string $path, string|null $language)
Resolve translation file name
at line 193
bool
hasLanguage(array $translations, string|null $language)
Return true if component have language
at line 206
array
getComponentLanguages(array $componentFiles)
Get component languages