Download the PHP package libra/libra-locale without Composer

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

Libra Locale Module

Description

This module adds locale to yours modules. Also it set default locale site-widely. It makes application locale aware, add locale short aliases like usually used en, fr, ru, instead of long locale tags like en-US.UTF8, en-GB etc.

Note!

You can easily add this module to your project as LibraLocale keep path for default alias and using any things in the same manner.

Using

For enabling locale add it modules in application configuration. To disable locale behavior for any module add to root level route of module parameter disable_locale => true in routes options

    'router' => array(
        'routes' => array(
            'application' => array(
                'type' => 'Segment',
                'options' => array(
                    'route' => '/application',
                    'disable_locale' => true,
                    'constraints' => array(
                        'alias'      => '[a-zA-Z][a-zA-Z0-9_-]*',
                    ),
                    'defaults' => array(
                        ....
                    ),
                    'may_terminate' => true,
                    'child_routes' => array(
                        ....
                    )
                )
            ),
        ....

After this you can get locale alias from RouteMatch parameter. In Controller by code:

    $locale = $this->params('locale');
    //or
    $locale = $this->getEvent()->getRouteMatch()->getParam('locale');

It has a switcher, use by router with param 'to' for locale alias:

    echo $this->url('libra-locale/switch', array(), array('query' => array('to' => 'en')));
    echo $this->url('libra-locale/switch', array(), array('query' => array('to' => 'ru')));
    echo $this->url('libra-locale/switch', array(), array('query' => array('to' => 'fr')));

Checking if locales was enabled

To disable locales you can:

Then to check if application support locales use:

    if (\LibraModuleManager\Module::isModulePresent('LibraLocale')) {
        //put code here
    }

Note: I've just realized there may be added a flag in configuration instead of disabling module. Will be implemented on demand.

Thanks for using it module.

Installation

It available via composer package libra/libra-locale.

Changelog

0.5.0

After some experience I decided to make default locale path as '/' instead of '/locale/' hence of rare changing of default locale. Pages can be duplicated if you have locale extlang subtag like en-US and en-GB - will be almost identical. So search engines should recognize them as same text in different locales (I hope it'll be in future). There added parameters in configuration to setup redirect behavior. Separator hyphen kept (not underscore) due to (http://www.w3.org/International/articles/language-tags/) and (http://en.wikipedia.org/wiki/IETF_language_tag) and (http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html) new standards. The default locale at '/' will do smoother adding locale in projects without locale.

BC changes:

Using:

Added:
Flag _redirect_from_localetag that allow redirect from locale tag to alias. Now it will accept as alias that almost unknown. By default = false, but for BC it will be true in libra-cms globals until ver. 0.6.0.

To get proper links by navigation helper use type in page LibraLocale\Navigation\Page\Uri and LibraLocale\Navigation\Page\Mvc. Or use type of page === null and for service container - LibraLocale\Navigation\Service\DefaultNavigationFactory. It can be done by adding in application.config.php file in 'service_manager' array row:

            'Navigation' => 'LibraLocale\Navigation\Service\DefaultNavigationFactory',

All versions of libra-locale with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
zendframework/zend-mvc Version 2.*
zendframework/zend-i18n Version 2.*
libra/libra-module-manager 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 libra/libra-locale contains the following files

Loading the files please wait ....