protected function execute(InputInterface $input, OutputInterface $output)
 {
     $textWriter = new TextBundleWriter();
     $textWriter->write(CACHE_PATH . 'intl/text_bundle', 'en', ['data' => ['Ok']]);
     $textWriter->write(CACHE_PATH . 'intl/text_bundle', 'ru', ['data' => ['Хорошо']]);
     $phpWriter = new PhpBundleWriter();
     $phpWriter->write(CACHE_PATH . 'intl/php_bundle', 'en', ['data' => 'php bundle: Ok', 'nested' => ['message' => 'Hi!']]);
     $phpWriter = new PhpBundleWriter();
     $phpWriter->write(CACHE_PATH . 'intl/php_bundle', 'ru', ['data' => 'php bundle: Хорошо', 'nested' => ['message' => 'Привет!']]);
     $compiler = new GenrbCompiler();
     $compiler->compile(CACHE_PATH . 'intl/text_bundle', CACHE_PATH . 'intl/compiled');
     $phpReader = new PhpBundleReader();
     $data = $phpReader->read(CACHE_PATH . 'intl/php_bundle', 'en');
     $output->writeln($data['data']);
     $data = $phpReader->read(CACHE_PATH . 'intl/php_bundle', 'ru');
     $output->writeln($data['data']);
     $reader = new BundleEntryReader($phpReader);
     $data = $reader->readEntry(CACHE_PATH . 'intl/php_bundle', 'ru', ['nested', 'message']);
     $output->writeln($data);
     $language = Intl::getLanguageBundle()->getLanguageName('ru', 'RU', 'en');
     $output->writeln($language);
     $language = Intl::getLanguageBundle()->getLanguageName('ru', 'RU', 'de');
     $output->writeln($language);
     $language = Intl::getLanguageBundle()->getLanguageName('ru', 'RU', 'ru');
     $output->writeln($language);
     $currencyName = Intl::getCurrencyBundle()->getCurrencyName('RUB', 'en');
     $output->writeln($currencyName);
     $currencyName = Intl::getCurrencyBundle()->getCurrencySymbol('USD', 'en');
     $output->writeln($currencyName);
     $output->writeln('<comment>Ok</comment>');
 }
 /**
  * {@inheritdoc}
  */
 protected function compileTemporaryBundles(GenrbCompiler $compiler, $sourceDir, $tempDir)
 {
     $compiler->compile($sourceDir . '/lang', $tempDir);
     $compiler->compile($sourceDir . '/misc/metadata.txt', $tempDir);
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 protected function compileTemporaryBundles(GenrbCompiler $compiler, $sourceDir, $tempDir)
 {
     $compiler->compile($sourceDir . '/region', $tempDir);
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 protected function compileTemporaryBundles(GenrbCompiler $compiler, $sourceDir, $tempDir)
 {
     $compiler->compile($sourceDir . '/curr', $tempDir);
     $compiler->compile($sourceDir . '/misc/currencyNumericCodes.txt', $tempDir);
 }