Download the PHP package qcubed/i18n without Composer

On this page you can find all versions of the php package qcubed/i18n. 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 i18n

QCubed\i18n

An attempt to put together a comprehensive, standalone language translation tool for PHP.

This was originally a fork of the excellent work by Raúl Ferràs ([email protected]
https://github.com/raulferras/PHP-po-parser) That code has been moved to its own section of this repository for maintainability, and is also licensed under MIT. This project builds on that work.

Why another translation tool?

There are lots of translation tools available on the internet for PHP. The problem is they are scattered all over, embedded deep within existing frameworks, and only solve a part of the problem, and sometimes not very well.

The gold standard, GNU's gettext, is rather dated, requires offline precompilation of .po files into .mo files, placement of those files in a specially formatted hierarchy (which makes it rather difficult to implement translation files with Composer), and requires that the language pack of whatever language you are translating be installed into the operating system.

There is a php-geettext, which improves things a little, but its not quite comprehensive, and still requires .mo files to operate.

Goals

Implementations

Detailed descriptions of each implementation is available in the header of each file. These are described in general below.

You are expected to include the i18n.inc.php file that is in the tools directory into your project so that you can directly use the _t and _tp functions there in your source code to call for translations. This will make everything easy to use.

GettextTranslator

Uses the GNU gettext translation module buiit-in to PHP. Not ideal, but if you have .mo files, its a good way to go.

SimpleCacheTranslator

Can use a PSR-16 compliant simple cache as a store for translations (we are working on an APCu and Redis implementation of these now.) Directly reads .PO files from a directory. Will work without a cache, but its better if your provide one.

Supply a temp directory, and it will convert the .po files into json and cache the json, making subsequent reads faster.

Typical Use

Setup

Including the helper library

For applications:

If you are developing a library to be used by other applications:

Getting a translation

RoadMap


All versions of i18n with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
psr/simple-cache Version ^1.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 qcubed/i18n contains the following files

Loading the files please wait ....