Code Monkey home page Code Monkey logo

aura.intl's Introduction

Aura.Intl

The Aura.Intl package provides internationalization (I18N) tools, specifically package-oriented per-locale message translation.

Installation and Autoloading

This package is installable and PSR-4 autoloadable via Composer as aura/intl.

Alternatively, download a release, or clone this repository, then map the Aura\Intl\ namespace to the package src/ directory.

Dependencies

This package requires PHP 5.6 or later; it has been tested on PHP 5.6-8.2. We recommend using the latest available version of PHP as a matter of principle.

Aura library packages may sometimes depend on external interfaces, but never on external implementations. This allows compliance with community standards without compromising flexibility. For specifics, please examine the package composer.json file.

Quality

Scrutinizer Code Quality codecov Continuous Integration

This project adheres to Semantic Versioning.

To run the unit tests at the command line, issue composer install and then phpunit at the package root. This requires Composer to be available as composer, and PHPUnit to be available as phpunit.

This package attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.

Community

To ask questions, provide feedback, or otherwise communicate with other Aura users, please join our Google Group, follow @auraphp, or chat with us on Freenode in the #auraphp channel.

Documentation

This package is fully documented here.

aura.intl's People

Contributors

bcrowe avatar frederikbosch avatar harikt avatar jhuet avatar koriym avatar lorenzo avatar mapthegod avatar pborreli avatar ttsuruoka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aura.intl's Issues

PHP Fatal error: Trait 'Aura\Framework\Test\WiringAssertionsTrait' not found

I'm having issues trying to test a CakePHP 3 plugin and the problem comes when Cake internally loads aura.intl. This is the error shown:

PHP Fatal error:  Trait 'Aura\Framework\Test\WiringAssertionsTrait' not found in /home/elboletaire/www/projectes/metropolitan/web-2015/vendor/cms/files/vendor/aura/intl/tests/WiringTest.php on line 8

Fatal error: Trait 'Aura\Framework\Test\WiringAssertionsTrait' not found in /home/elboletaire/www/projectes/metropolitan/web-2015/vendor/cms/files/vendor/aura/intl/tests/WiringTest.php on line 8

I've found this: auraphp/Aura.Marshal#21 but it is not a valid solution. Making a search on the whole code I can see that the Trait does not exist.

Searching in all your Aura repositories I can see that the trait exists in Aura.Framework, but this framework is not present in the Aura.intl composer file as a requirement.

So, IMHO, this can be due to:

  • Aura.intl does not properly require the libraries in its composer file (adding the framework dependency should fix the issue).
  • CakePHP is not properly loading aura.intl, instead they should load aura.framework + aura.intl.
  • I'm totally wrong and I'm making some stupid error on my tests.

2.x release

Hi @pmjones ,

I would like to hear how you would love to release Aura.Intl. Can we push a 2.x release or do you think it is going for 3.x release ?

May be we need a few betas or can we push this to a stable x.0.0 on the fly for there is little changes.

I will be happy to do the releases if you raise the green flag :) .

Thank you.

Plugin aura/installer-default is missing a require statement for a version of the composer-plugin-api package.

I'm getting a [RuntimeException] when I try to install a aura using composer.

this is the composer.json file

{
    "name": "aura/installer-default",
    "version": "1.0.0",
    "type": "composer-installer",
    "license": "BSD-2-Clause",
    "description": "Installs Aura packages using the Composer defaults.",
    "keywords": ["aura", "installer"],
    "authors": [
    {
        "name": "Paul M. Jones",
        "email": "[email protected]",
        "homepage": "http://paul-m-jones.com"
    }
    ],
    "autoload": {
    "psr-0": {
        "Aura\\Composer\\": "src/"
    }
    },
    "extra" : {
    "class" : "Aura\\Composer\\DefaultInstaller"
    }
}

and this is the output I get:

waspinator@waspinator-pc:~$ composer create-project --prefer-dist cakephp/app poopsy -vvv
Downloading https://packagist.org/packages.json
Writing /home/waspinator/.composer/cache/repo/https---packagist.org/packages.json into cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2013.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2014.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2015.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2015-04.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2015-07.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2015-10.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2016-01.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-latest.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$app.json from cache
Installing cakephp/app (3.1.2)
  - Installing cakephp/app (3.1.2)
Reading /home/waspinator/.composer/cache/files/cakephp/app/4fc9e693fac8bf987e69c0e5072e6761e4acc907.zip from cache
    Loading from cache
    Extracting archive
Executing command (CWD): unzip 'poopsy//a09f70742b51d057ae7b643acff5cb64' -d '/home/waspinator/vendor/composer/663ac86b' && chmod -R u+w '/home/waspinator/vendor/composer/663ac86b'

Created project in poopsy
Reading ./composer.json
Loading config file ./composer.json
Failed to initialize global composer: Composer could not find the config file: /home/waspinator/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing /home/waspinator/.composer/cache/repo/https---packagist.org/packages.json into cache
Installing dependencies (including require-dev)
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2013.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2014.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2015.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2015-04.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2015-07.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2015-10.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-2016-01.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/p-provider-latest.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$app.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$cakephp.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-mobiledetect$mobiledetectlib.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$migrations.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$plugin-installer.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-nesbot$carbon.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-ircmaxell$password-compat.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-aura$intl.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-psr$log.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-robmorgan$phinx.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-aura$installer-default.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-symfony$console.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-symfony$config.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-symfony$class-loader.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-symfony$yaml.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-symfony$filesystem.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-symfony$polyfill-mbstring.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-psy$psysh.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-nikic$php-parser.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-dnoegel$php-xdg-base-dir.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-jakub-onderka$php-console-highlighter.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-jakub-onderka$php-console-color.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-symfony$var-dumper.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$debug-kit.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-jdorn$sql-formatter.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$bake.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$cache.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$collection.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$core.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$datasource.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$database.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$event.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$filesystem.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$i18n.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$log.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$orm.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$utility.json from cache
Reading /home/waspinator/.composer/cache/repo/https---packagist.org/provider-cakephp$validation.json from cache
Analyzed 1562 packages to resolve dependencies
Analyzed 12415 rules to resolve dependencies
  - Installing aura/installer-default (1.0.0)
Reading /home/waspinator/.composer/cache/files/aura/installer-default/52f8de3670cc1ef45a916f40f732937436d028c8.zip from cache
    Loading from cache
    Extracting archive
Executing command (CWD): unzip '/home/waspinator/poopsy/vendor/aura/installer-default/9a3d9d7ea889b3fb918df436bec84cae' -d '/home/waspinator/poopsy/vendor/composer/896e397e' && chmod -R u+w '/home/waspinator/poopsy/vendor/composer/896e397e'

Reading ./composer.json
Loading config file ./composer.json
Failed to initialize global composer: Composer could not find the config file: /home/waspinator/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section


  [RuntimeException]                                                                                              
  Plugin aura/installer-default is missing a require statement for a version of the composer-plugin-api package.  


Exception trace:
 () at phar:///home/waspinator/apps/composer/composer.phar/src/Composer/Plugin/PluginManager.php:118
 Composer\Plugin\PluginManager->registerPackage() at phar:///home/waspinator/apps/composer/composer.phar/src/Composer/Installer/PluginInstaller.php:62
 Composer\Installer\PluginInstaller->install() at phar:///home/waspinator/apps/composer/composer.phar/src/Composer/Installer/InstallationManager.php:152
 Composer\Installer\InstallationManager->install() at phar:///home/waspinator/apps/composer/composer.phar/src/Composer/Installer/InstallationManager.php:139
 Composer\Installer\InstallationManager->execute() at phar:///home/waspinator/apps/composer/composer.phar/src/Composer/Installer.php:604
 Composer\Installer->doInstall() at phar:///home/waspinator/apps/composer/composer.phar/src/Composer/Installer.php:232
 Composer\Installer->run() at phar:///home/waspinator/apps/composer/composer.phar/src/Composer/Command/CreateProjectCommand.php:172
 Composer\Command\CreateProjectCommand->installProject() at phar:///home/waspinator/apps/composer/composer.phar/src/Composer/Command/CreateProjectCommand.php:130
 Composer\Command\CreateProjectCommand->execute() at phar:///home/waspinator/apps/composer/composer.phar/vendor/symfony/console/Command/Command.php:259
 Symfony\Component\Console\Command\Command->run() at phar:///home/waspinator/apps/composer/composer.phar/vendor/symfony/console/Application.php:840
 Symfony\Component\Console\Application->doRunCommand() at phar:///home/waspinator/apps/composer/composer.phar/vendor/symfony/console/Application.php:192
 Symfony\Component\Console\Application->doRun() at phar:///home/waspinator/apps/composer/composer.phar/src/Composer/Console/Application.php:167
 Composer\Console\Application->doRun() at phar:///home/waspinator/apps/composer/composer.phar/vendor/symfony/console/Application.php:123
 Symfony\Component\Console\Application->run() at phar:///home/waspinator/apps/composer/composer.phar/src/Composer/Console/Application.php:98
 Composer\Console\Application->run() at phar:///home/waspinator/apps/composer/composer.phar/bin/composer:43
 require() at /home/waspinator/apps/composer/composer.phar:25

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

Select format isn't supported by IntlFormatter

$formatter = new \Aura\Intl\IntlFormatter();
$pattern = '{name} is {gender} and {gender, select, female{she} male{he} other{it}} report bugs!';
echo $formatter->format('en_US', $pattern, array(
    'name' => 'Alexander',
    'gender' => 'male',
));

Should produce Alexander is male and he report bugs! but instead gives Alexander is male and 3 report bugs!. PHP 5.5's MessageFormatter does it properly.

Catchable fatal error: Argument 3 passed to Aura\Intl\PackageLocator::set() must be callable

https://twitter.com/codebyjeff/status/456032522950803456

if you get a moment, can you tell me what I'm doing wrong with Aura.Intl? https://gist.github.com/jrmadsen67/10724759 โ€ฆ Appreciate it!

Problem is fix the documentation with the changes. Eg from gist.

<?php
 require 'vendor/autoload.php';

use Aura\Intl\PackageLocator;
use Aura\Intl\FormatterLocator;
use Aura\Intl\TranslatorFactory;
use Aura\Intl\TranslatorLocator;
use Aura\Intl\Package;

$translators = new TranslatorLocator(
new PackageLocator,
new FormatterLocator([
    'basic' => function() { return new Aura\Intl\Formatter\BasicFormatter; },
    'intl' => function() { return new Aura\Intl\Formatter\IntlFormatter; },
]),
new TranslatorFactory,
'en_US'
);

//var_dump($translators);
$packages = $translators->getPackages();

$package = new Package;
$package->setMessages([
'FOO' => 'The text for "foo."',
'BAR' => 'The text for "bar."',
]);

// var_dump($package);die;

$packages->set('Vendor.Package', 'en_US', $package);

$translator = $translators->get('Vendor.Package', 'en_US');
echo $translator->translate('FOO'); // 'The text for "foo."'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.