PhpBotFramework  2.0.2
A framework for Telegram Bots' APIs.
Public Member Functions | Public Attributes | Protected Attributes | List of all members
PhpBotFramework\Localization\Localization Class Reference
Inheritance diagram for PhpBotFramework\Localization\Localization:
PhpBotFramework\Localization\File PhpBotFramework\Localization\LocalizedString

Public Member Functions

 __construct (BasicBot &$bot)
 
string getLanguageDatabase ()
 Get current user's language from the database, and set it in $language. More...
 
bool setLanguageDatabase (string $language)
 Set the current user language in database and internally. More...
 
string getLanguageRedis (int $expiring_time=86400)
 Get current user language from Redis (as a cache) and set it in language. More...
 
bool setLanguageRedis (string $language, int $expiring_time=86400)
 Set the current user language in both Redis, database and internally. More...
 
- Public Member Functions inherited from PhpBotFramework\Localization\File
bool loadAllLanguages (string $dir='./localization')
 Load all localization files (like JSON) from a folder and set them in $local variable. More...
 
bool loadCurrentLocalization (string $dir='')
 
 setLocalizationDir (string $dir)
 Change source directory for localization files. More...
 
- Public Member Functions inherited from PhpBotFramework\Localization\LocalizedString
 getLanguageRedis (string $default_language='en', int $expiring_time=86400)
 
 loadCurrentLocalization (string $dir='')
 
string getStr ($index)
 Get a localized string giving an index. More...
 

Public Attributes

 $user_table = 'User'
 Table containing bot users data into database.
 
 $id_column = 'chat_id'
 Name of the column that represents the user ID into database.
 
 $language
 Current user/group language.
 
- Public Attributes inherited from PhpBotFramework\Localization\LocalizedString
 $language
 

Protected Attributes

 $bot
 Reference to the bot.
 
- Protected Attributes inherited from PhpBotFramework\Localization\File
 $local
 
 $localization_dir = './localization'
 Source for localization files.
 
- Protected Attributes inherited from PhpBotFramework\Localization\LocalizedString
 $bot
 
 $local
 

Additional Inherited Members

- Protected Member Functions inherited from PhpBotFramework\Localization\File
bool loadSingleLanguage (string $lang='en', string $dir='./localization')
 

The documentation for this class was generated from the following file: