Download the PHP package webiik/translation without Composer

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

Translation

The translation provides i18n with user-extensible translation formatting.

Installation

Example

Setting

setLang

setLang() sets current lang of translation. This lang is used for setting and getting values to/from Translation class.

inject

inject() injects dependencies to specific parser. It is useful when you make your custom parser and you need to inject some external dependencies.

Adding

add

add() adds translation by key. Read more about supported translation formats.

addArr

addArr() adds translations from array.

Note about resolving the key conflicts:

Arrays values - New value that is an array is merged with old value that is an array. If array key is a string, value of the new key replaces value of the old key.

Mixed values - New value that is a different type than old value, replaces old value. e.g. New string value replaces old array value and vice-versa.

Getting

get

get() gets translation by key. Key supports dot notation. If key is missing it returns empty string. After calling, all missing keys and contexts can be obtained with method getMissing().

getAll

getAll() gets all translations. After calling, all missing contexts can be obtained with method getMissing().

getMissing

getMissing() returns array of all missing keys and contexts from callings of methods get() and getAll().

Parsing

Translations can contain special formatting which help to update translation values on the fly.

Basic Syntax

You can add any variable to translation with folded brackets.

Plural Syntax

Sometimes a translation depends on some specific count. Int allowed values are: int, int-int, int-, int+

Select Syntax

Sometimes a translation depends on some specific value. In the select syntax, string represents that value.

Link Syntax

If you need to generate links and don't want to use HTML.

⚠️ Notice the true parameter when calling the method get. Without it, the link would be not generated, and the text of translation would be displayed in the original format.

Custom Parser Syntax

or

You can write your own parser. Every custom parser must:

Look at Select parser to get better insight.

Resources


All versions of translation with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
webiik/arr Version ^1
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 webiik/translation contains the following files

Loading the files please wait ....