Download the PHP package rougin/transcribe without Composer
On this page you can find all versions of the php package rougin/transcribe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rougin/transcribe
More information about rougin/transcribe
Files in rougin/transcribe
Package transcribe
Short Description Yet another language library for PHP
License MIT
Homepage https://github.com/rougin/transcribe
Informations about the package transcribe
Transcribe
Transcribe is a simple localization package for PHP. A localization source can be file-based (similar to Laravel's Localization) or from a database connection.
Installation
Install Transcribe
through Composer:
Basic Usage
Load a list of texts from a directory
The Transcribe
package needs to have a localization file which contains the list of texts with its translations (e.g., fil_PH.php
):
Specify the path of the localization files in the Transcribe
class:
Load a list of texts from a database
Alternatively, the localization source can be from a database. It should have the following fields in a specified table:
name
- name of the database tablelanguage
- language name based from a locale (e.gen_GB
)text
- a keyword or a text to be translatedtranslation
- translation from the based language
Load list of texts from different sources
If having multiple localization sources, the SourceCollection
class can be used to store them into a single class:
Getting a text from the vocabulary
Use the get
method to get a specified translation. While use the all
method to get all the available texts:
Adding new source
Adding custom sources is possible by implementing them to SourceInterface
:
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
Credits
License
The MIT License (MIT). Please see LICENSE for more information.