Abstract adapter for recognizing files with translations.
| package |
Default |
|---|
__construct(string $dir, string|null $locale = null)
stringDirectory where are located files with translation
string|nullName of used locale
charAt(string $str, integer $pos) : string|null
stringString where is searched the char
integerPosition of the searched char
string|null
getDefaultLocale() : string
string
getDir() : string
string
getExtension() : string
string
getLocale() : string
string
loadFile(boolean $defaultLocale = false)
| Throws |
|
|---|
booleanA flag if the dafault locale is used
readFile(string $filename)
stringName of file with translations
setDefaultLocale(string $defaultLocale)
stringName of default locale
setDir(string $dir) : \Dotpay\Locale\Adapter\AbstractAdapter
stringDirectory where are located files with translation
\Dotpay\Locale\Adapter\AbstractAdapter
setLocale(string $locale) : \Dotpay\Locale\Adapter\AbstractAdapter
translate(string $sentence)
stringInput sentence to translate
dir : string
| var |
Directory where are located files with translation |
|---|
string
locale : string
| var |
Name of used locale, for example pl_PL, en_US |
|---|
string
extension : string
| var |
Extension of files recognized by the concrete instance of adapter |
|---|
string
defaultLocale : string
| var |
Name of default locale which is used if the given locale is not found |
|---|
string
loaded : boolean
| var |
Flag if content of the adapter is loaded |
|---|
boolean