Download the PHP package phalcon/incubator-translate without Composer

On this page you can find all versions of the php package phalcon/incubator-translate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package incubator-translate

Phalcon\Incubator\Translate

Discord Packagist Version PHP from Packagist codecov Packagist

Issues tracker

https://github.com/phalcon/incubator/issues

Database

You can use your database to store the translations, too.

First of all, you need to up your database. To do this, use [DI][1] (in /public/index.php). Take a look:

Then, you should get the translation through your controller. Put this on it:

To store the translations, the following table is recommended:

Optional create unique index

The columns are self-described, but pay attention to language — it's a column that stores the language that the user is using, that can be en, en-us or en-US. Now it's your responsibility to decide which pattern you want to use.

To display for your users the translated words you need to set up a variable to store the expressions/translations from your database. This step happens in your controller. Follow the example:

Then, just output thephrase/sentence/word in your view:

Or, if you wish you can use [Volt][2]:

Mongo

Implements a Mongo adapter for translations.

A generic collection with a source to store the translations must be created and passed as a parameter.

MultiCsv

This adapter extends Phalcon\Translate\Adapter\Csv by allowing one csv file for several languages.

use Phalcon\Translate\Adapter\NativeArray; use Phalcon\Translate\Interpolator\Intl;

$translate = new NativeArray( [ 'interpolator' => new Intl('en_US'), // this interpolator must be locale aware 'content' => [ 'hi-name' => 'Hello {name}, it\'s {time, number, integer} o\'clock', ], ] );

$name = 'Henry';

// Hello Henry, it's 8 o'clock $translate->_( 'hi-name', [ 'name' => $name, 'time' => 8, ] );


All versions of incubator-translate with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-phalcon Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phalcon/incubator-translate contains the following files

Loading the files please wait ....