Download the PHP package codecollab/i18n without Composer

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

I18n

Internationalization package of the CodeCollab project

Build Status

Requirements

PHP7+

Installation

Include the library in your project using composer:

{
    "require-dev": {
        "codecollab/i18n": "^1"
    }
}

Usage

This library uses simple php files containing an array of translations based on key/value pairs. The array should be named $texts.

The filename of the translations should be based on the language it targets, e.g. en_US.php. An simple example of translations in a file:

<?php

$texts = [
    'translation.title'        => 'Translation',
    'translation.description'  => 'This is an example translation.',
    'translation.variable.%'   => 'Copyright %d Some Company',
];

To use translations in your application first create an instance of the translation class by passing the directory in which the translation files are and the language to translate to:

<?php

$translator = new \CodeCollab\I18n\FileTranslator('/path/to/translations', 'en_US');

echo $translator->translate('translation.title'); // Translation
echo $translator->translate('translation.variable.%', [2015]); // Copyright 2015 Some Company

Exceptions

When a translation file could not be found a \CodeCollab\I18n\UnsupportedLanguageException will be thrown.

When loading a translation file it will be checked to ensure it has the correct format. if the file is not a valid translation file a \CodeCollab\I18n\InvalidFileException will be thrown.

Interface

When using translators in your application always hint against the \CodeCollab\I18n\Translator interface instead of the concrete implementation. This allows you to use different translation implementations later without having to change you classes.

Contributing

How to contribute

License

MIT

Security issues

If you found a security issue please contact directly by mail instead of using the issue tracker at [email protected]


All versions of i18n with dependencies

PHP Build Version
Package Version
Requires php Version ^7
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 codecollab/i18n contains the following files

Loading the files please wait ....