PHP Trait Spatie\Translatable\HasTranslations

ファイルを表示 Open project: spatie/laravel-translatable

Public Methods

Method Description
forgetTranslation ( string $key, string $locale )
getAttributeValue ( string $key ) : mixed
getCasts ( ) : array
getTranslatableAttributes ( ) : array
getTranslatedLocales ( string $key ) : array
getTranslation ( string $key, string $locale ) *
getTranslations ( $key ) : array
isTranslatableAttribute ( string $key ) : boolean
setTranslation ( string $key, string $locale, $value )
setTranslations ( string $key, array $translations )
translate ( string $key, string $locale = '' ) : mixed

Protected Methods

Method Description
guardAgainstUntranslatableAttribute ( string $key )
normalizeLocale ( string $key, string $locale ) : string

Method Details

forgetTranslation() public method

public forgetTranslation ( string $key, string $locale )
$key string
$locale string

getAttributeValue() public method

public getAttributeValue ( string $key ) : mixed
$key string
return mixed

getCasts() public method

public getCasts ( ) : array
return array

getTranslatableAttributes() public method

public getTranslatableAttributes ( ) : array
return array

getTranslatedLocales() public method

public getTranslatedLocales ( string $key ) : array
$key string
return array

getTranslation() public method

*
public getTranslation ( string $key, string $locale )
$key string
$locale string

getTranslations() public method

public getTranslations ( $key ) : array
return array

guardAgainstUntranslatableAttribute() protected method

isTranslatableAttribute() public method

public isTranslatableAttribute ( string $key ) : boolean
$key string
return boolean

normalizeLocale() protected method

protected normalizeLocale ( string $key, string $locale ) : string
$key string
$locale string
return string

setTranslation() public method

public setTranslation ( string $key, string $locale, $value )
$key string
$locale string
$value

setTranslations() public method

public setTranslations ( string $key, array $translations )
$key string
$translations array

translate() public method

public translate ( string $key, string $locale = '' ) : mixed
$key string
$locale string
return mixed