Download the PHP package ali-translator/translator without Composer
On this page you can find all versions of the php package ali-translator/translator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ali-translator/translator
More information about ali-translator/translator
Files in ali-translator/translator
Package translator
Short Description Translator
License MIT
Homepage https://sli.su/
Informations about the package translator
Translator
The Translation component provides tools to internationalize your application.
Installation
Simplified translator
Example of init one direction translator (one original and one translation languages):
Complex translator
If you need few original and translation languages, this way for you:
Parameters resolving
Catchers of missing translations
Packet allow set catchers of phrases without translation, which will run after tranlsate
method failing
Phrase decorators
If you need decorate original-phrase or translated-phrase before output - this section for you.
Example, of existed decorator, which replaces numbers to "0" before saving originals,
and restoring correct number after translate.
Originals grouping
Optionality, you can add group to the originals. This can be useful for cases, when many different processes adding originals, and then when one of these processes removes its dependencies form them, to deciding whether to remove the original from the translator - use the groups. If original now does not have any group - remove them.
Available sources
- MySqlSource - recommended for using with ali-translator/buffered-translation to reduce the number of requests to Source
- CsvFileSource - csv source. Files will be look like as
en-ua.csv
Languages
For convenience, a couple of classes are integrated into this package to help with languages.
LanguageInterface
- Has getTitle()
, getIsoCode()
and getAlias()
methods
LanguageRepositoryInterface
- Has save(LanguageInterface $language, $isActive)
, find($alias)
, findByIsoCode($isoCode)
, getAll($onlyActive)
methods.
And realizations for repository interface: ArrayLanguageRepository
(ArrayLanguageRepositoryFactory
) and MySqlLanguageRepository
Suggest packets
- ali-translator/buffered-translation - Manually pasted text on document for translation, by means of buffering is translated by one approach (helpful for DB sources)
- ali-translator/translator-js-integrate - Integrate this packet to frontend js
- ali-translator/auto-html-translation - Parses html document, and translate included texts
- ali-translator/url-template - Helps on url language resolving
Tests
In packet exist docker-compose file, with environment for testing.