Download the PHP package stantabcorp/i18n without Composer

On this page you can find all versions of the php package stantabcorp/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 library for PHP This library allows you to translate your website with ini files, Auto Detecting the language and much more!

Latest Stable Version Total Downloads

Documentation

Information

i18n will create a folder named "i18n" please make sure it is readable

Installation

  1. Via composer: composer require stantabcorp/i18n
  2. Via manually download and install

Initialization

In the i18n constructor your must-have 3 parameters:

  1. The language you want to display your website or true to use AutoDetect
  2. The default language
  3. An array of available languages
  4. An array of options

Example: Without AutoDetect:

This will set the language to en (English), set the default language to en (English) and set that en (English) and fr (French) are available

With AutoDetect:

This will set the language to AutoDetect, set the default language and set available language for AutoDetect

AutoDetect, use the Accept-Language HTTP Header to determine the best matching locale to use.

Usage

In order to get a translation you just need to:

If you want to use sections in your ini file use the following syntax:

If you want to get the current language:

You want to change the language?

You don't want to use sprintf?! No problem:

Want to change the translation folder on the fly?

Want to get the active folder?

Want to set the available languages?

Want to get the available languages?

Now, let set and get the default language

File syntax

Sections are supported by i18n, see options to enable it

Example file:

Options

The fourth parameter when initializing the i18n class is an array.
Accepted values are:

Twig Extension

i18n provide a simple Twig extension. To enable it, simply add a new extension to twig:

In order to use it in a twig template, simply call (with the same syntax for section):


All versions of i18n with dependencies

PHP Build Version
Package Version
No informations.
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 stantabcorp/i18n contains the following files

Loading the files please wait ....