auraphp / aura.intl Goto Github PK
View Code? Open in Web Editor NEWInternationalization tools, particularly message translation.
Home Page: http://auraphp.com/packages/3.x/Intl.html#3-2
License: MIT License
Internationalization tools, particularly message translation.
Home Page: http://auraphp.com/packages/3.x/Intl.html#3-2
License: MIT License
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>]
There's a few things I'm not seeing any documentation for:
Am I just missing it?
$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.
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.
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."'
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:
This package is not compatible with PHP8 because your composer package is limiting against it.
Hi @pmjones ,
It looks to me the todo is already done https://github.com/auraphp/Aura.Intl/blob/2.x/TODO.md .
Can you make sure if there is anything that need to be done ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.