install LOGATY using Composer.
composer require phptricks/logaty
{
"require": {
"phptricks/logaty": ">=3.0"
}
}
Once you download the Library, you can see a folder with several files and sub folders. You can read description of some important files in continue.
-
Logaty
Core folder its include Base Classes of library
-
Helpers
-
Switcher
-
Select.php
trite - create language switch from <select> element.
-
Ul.php
trite - create language switch as list from <ul> element.
-
Config.php
Config Class - handel and get configuration values
-
Detect.php
Detect Class - Detect User Language from browser.
-
Link.php
Link Class - to create correct links with selected language.
-
Switcher.php
Switcher Class - create and customize Languages Switch.
-
Translate
-
Translator.php
Base Class for handel translation / get translation from files.
-
App.php
Logaty Application Main Class
-
Logaty.php
Logaty Application Container Class
-
ILogatyService.php
Logaty Application Container Interface
-
start.php
Initializing Logaty library .
-
Exceptions
-
Exceptions
Contain Logaty Exceptions classes.
-
Config
Configuration variables (files).
-
options.php
General Settings.
-
direction.php
languages direction (ltr or rtl).
-
enabled.php
enabled languages in your website.
-
flags.php
language flag name (icon name en.png).
-
name.php
Language Name ( Name in English & Natural Name ).
-
supported.php
all languages supported in your website.
-
paths.php
directory paths of (languages directory & flags directory).
-
code.php
languages ISO-2 Codes - optional if you want to use it.
-
local
contain translation files
-
languages
contain translations files & directories.
-
composer.json
composer file - using composer for psr-4 auto-loader only.