Abstract adapter for recognizing files with translations.
package |
Default |
---|
__construct(string $dir, string|null $locale = null)
string
Directory where are located files with translation
string|null
Name of used locale
charAt(string $str, integer $pos) : string|null
string
String where is searched the char
integer
Position of the searched char
string|null
getDefaultLocale() : string
string
getDir() : string
string
getExtension() : string
string
getLocale() : string
string
loadFile(boolean $defaultLocale = false)
Throws |
|
---|
boolean
A flag if the dafault locale is used
readFile(string $filename)
string
Name of file with translations
setDefaultLocale(string $defaultLocale)
string
Name of default locale
setDir(string $dir) : \Dotpay\Locale\Adapter\AbstractAdapter
string
Directory where are located files with translation
\Dotpay\Locale\Adapter\AbstractAdapter
setLocale(string $locale) : \Dotpay\Locale\Adapter\AbstractAdapter
translate(string $sentence)
string
Input 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