Download the PHP package datingvip/cldr without Composer

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

CLDR

Packagist Code Quality Code Coverage Downloads

The CLDR package provides means to internationalize your application by leveraging the data and conventions defined by the Unicode Common Locale Data Repository (CLDR). It offers many helpful locale information and data (such as locale names for territories, languages, days…) as well as formatters for numbers, currencies, dates and times, units, sequences, lists…

Note

The package targets CLDR version 36.

Example usage

Installation

Repository

The CLDR is represented by a Repository instance, from which data is accessed. When required, data is retrieved through a provider. The web provider fetches data from the JSON distribution hosted on GitHub. In order to avoid hitting the web with every request, a collection of caches is used, each with its own strategy.

The following example demonstrates how a repository can be instantiated:

Accessing the repository

The repository can be accessed like a big array, but it also provides interfaces to the most important data such as locales, territories, numbers, currencies…

The following example demonstrates how the repository can be used to access locales and supplemental data:

Locales

The data and conventions of a locale are represented by a Locale instance, which can be used as an array to access various raw data such as calendars, characters, currencies, delimiters, languages, territories and more.

Locales provide a collection of calendars, and the calendar property is often used to obtain the default calendar of a locale.

Localized objects

Locales are also often used to localize instances such as Territory, or even Locale. The method localize is used to localize instances. The method tries its best to find a suitable localizer, and it helps if the instance to localize implements Localizable, or if a ICanBoogie\CLDR\Localized<class_base_name> class is defined.

Instances that can be localized usually implement the localize() method.

Localized locales

A localized locale can be obtained with the localize() method, or the localize() method of the desired locale.

Context transforms

Several capitalization contexts can be distinguished for which different languages use different capitalization behavior for dates, date elements, names of languages/regions/currencies. The context_transform() method helps capitalizing these elements:

Calendars

Calendars are represented by a Calendar instance, they can be accessed as arrays, and also provide magic properties to rapidly access days, eras, months and quarters:

This works with days, eras, months, quarters and the following widths: abbreviated, narrow, short, and wide. Here are some examples:

Dates and times formatters

From a calendar you can obtain formatters for dates and times.

The following example demonstrates how the dates and times formatters can be accessed and used.

Dates and Times

Calendars provide a formatter for dates and times. A width, a skeleton or a pattern can be used for the formatting. The datetime can be specified as an Unix timestamp, a string or a DateTime instance.

Date formatter

Calendars provide a formatter for dates. A width or a pattern is used for the formatting.

Time formatter

Calendars provide a formatter for times. A width or a pattern is used for the formatting.

Localized DateTime

DateTime can be localized by wrapping them inside a LocalizedDateTime instance, or by using the localize method of the desired locale:

Number formatting

NumberFormatter can be used to format numbers.

Note: You can also obtain a number formatter, or format a number from the repository.

Localized number formatting

A localized number formatter can be obtained with the localize() method (if the instance was created with a repository), or the localize() method of the desired locale. By default, the list is formatted with the standard type, but you can also provide your own pattern.

Note: You can also obtain a localized number formatter, or format a number from a locale.

List formatting

ListFormatter can be used to format variable-length lists of things such as "Monday, Tuesday, Friday, and Saturday".

Note: You can also obtain a list formatter, or format a list from the repository.

Localized list formatting

A localized list formatter can be obtained with the localize() method (if the instance was created with a repository), or the localize() method of the desired locale. By default, the list is formatted with the "standard" type, but more types are available, and you can also provide your own list patterns.

Note: You can also obtain a localized list formatter, or format a list from a locale.

Units

Quantities of units such as years, months, days, hours, minutes and seconds can be formatted— for example, in English, "1 day" or "3 days". It's easy to make use of this functionality via a locale's units:

Many units are available.

Per unit

Combination of units, such as miles per hour or liters per second, can be created. Some units already have 'precomputed' forms, such as kilometer_per_hour; where such units exist, they should be used in preference.

Units in composed sequence

Units may be used in composed sequences, such as 5° 30m for 5 degrees 30 minutes, or 3 ft, 2 in. For that purpose, the appropriate width can be used to compose the units in a sequence.

Plurals

Languages have different pluralization rules for numbers that represent zero, one, tow, few, many or other. ICanBoogie's CLDR makes it easy to find the plural rules for any numeric value:

Territories

The information about a territory is represented by a Territory instance, which aggregates information that is actually scattered across the CLDR.

Localized territories

A localized territory can be obtained with the localize() method, or the localize() method of the desired locale.

Currencies

Currencies are represented by instances of Currency. You can create the instance yourself or get one through the currency collection.

Localized currencies

A localized currency can be obtained with the localize() method, or the localize() method of the desired locale, it is often used to format a currency using the convention of a locale.


Continuous Integration

The project is continuously tested by GitHub actions.

Tests Static Analysis

Code of Conduct

This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you are expected to uphold this code.

Contributing

Please see CONTRIBUTING for details.

License

icanboogie/cldr is released under the BSD-3-Clause.


All versions of cldr with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-curl Version *
ext-json Version *
ext-mbstring Version *
icanboogie/common Version ^1.3|^2.0|^6.0
icanboogie/accessor Version ^3.0|^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 datingvip/cldr contains the following files

Loading the files please wait ....