Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
harikt opened this issue Apr 16, 2014 · 0 comments

Comments

@harikt
Copy link
Member

harikt commented Apr 16, 2014

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."'
@harikt harikt closed this as completed in f70c45e Apr 16, 2014
pmjones pushed a commit that referenced this issue Apr 16, 2014
Fixes #9, add a test for failure. The expected exception need to be fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant