• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Gettext\Translations类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Gettext\Translations的典型用法代码示例。如果您正苦于以下问题:PHP Translations类的具体用法?PHP Translations怎么用?PHP Translations使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Translations类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->writeSection($output, 'Po to Csv converter');
     $this->cwd = getcwd() . DIRECTORY_SEPARATOR;
     $output->writeln('<info>Using CWD</info> ' . $this->cwd);
     $poFiles = $this->getInputPoFiles($input, $output);
     $outputFolder = $this->getOutputFolder($input, $output);
     $useDefaults = $input->getOption('use-defaults');
     if ($useDefaults) {
         $output->writeln('<info>Po files</info>:');
         $this->writeList($output, $poFiles);
         $output->writeln(['', '<info>Output folder</info>: ' . $outputFolder]);
     }
     $poHandles = [];
     foreach ($poFiles as $poFile) {
         $key = basename($poFile, '.po');
         $output->writeln('<info>loading ' . $key . '</info>...');
         $poHandles[$key] = Translations::fromPoFile($poFile);
     }
     $output->writeln('<info>merging po files</info>...');
     $csvArray = [];
     foreach ($poHandles as $language => $poHandle) {
         foreach ($poHandle as $translation) {
             $original = trim($translation->original);
             $translation = trim($translation->translation);
             if (!isset($csvArray[$original])) {
                 $csvArray[$original] = [$language => $translation];
             } elseif (!isset($csvArray[$original][$language])) {
                 $csvArray[$original][$language] = $translation;
             } elseif ($csvArray[$original][$language] != $translation) {
                 $csvArray[$original][$language] = $this->handleConflict($input, $output, $original, $csvArray[$original][$language], $translation);
             }
         }
     }
     $output->writeln('<info>writing csv</info>...');
     $writer = Writer::createFromFileObject(new SplTempFileObject());
     $writer->setDelimiter(';');
     $header = ['original'];
     $header = array_merge($header, array_keys($poHandles));
     $writer->insertOne($header);
     foreach ($csvArray as $original => $item) {
         $row = [];
         foreach ($header as $column) {
             if ($column === 'original') {
                 $row[] = $original;
             } else {
                 $row[] = isset($item[$column]) ? $item[$column] : null;
             }
         }
         $writer->insertOne($row);
     }
     $outputFile = $outputFolder . DIRECTORY_SEPARATOR . 'translations.csv';
     file_put_contents($outputFile, $writer->__toString());
     $output->writeln('<info>done. output file is</info> ' . $outputFile);
 }
开发者ID:roopet,项目名称:potato,代码行数:55,代码来源:PoToCsvCommand.php


示例2: process

 public static function process(\Twig_Node $node, Translations $translations, $file)
 {
     $fileReference = str_replace(realpath(self::$rootDir . '/../') . '/', "", $file);
     if ($node instanceof TransNode) {
         //Process nodes that {% trans %} blocks
         $body = new \Twig_Node_Expression_Constant($node->getNode('body')->getAttribute('data'), $node->getLine());
         $compiledTranslation = eval('return ' . self::$twig->compile($body) . ';');
         $translations->insert('', $compiledTranslation)->addReference($fileReference, $node->getLine());
     }
     if ($node instanceof \Twig_Node_Expression_Function) {
         //Process nodes that are function expressions
         if ($node->getAttribute('name') == '__') {
             //Check the function name for __()
             foreach ($node->getNode('arguments') as $argument) {
                 //Grab the argument
                 $key = eval('return ' . self::$twig->compile($argument) . ';');
                 $translations->insert('', $key)->addReference($fileReference, $node->getLine());
                 break;
                 //I only needed the first argument in my implementation
             }
         }
     }
     //Recursively loop through the AST
     foreach ($node as $child) {
         if ($child instanceof \Twig_Node) {
             self::process($child, $translations, $file);
         }
     }
 }
开发者ID:mablae,项目名称:gettext-bundle,代码行数:29,代码来源:SymfonyTwig.php


示例3: testAllKnownTranslationFunctionsAreCovered

 /**
  * All known translation functions are covered.
  */
 public function testAllKnownTranslationFunctionsAreCovered()
 {
     $extractor = new WordPressExtractor();
     $translations = new Translations();
     $translations->setDomain('test');
     $translations = $extractor->fromDirectory($this->getResourcesPath() . 'commonSources', $translations);
     // file_put_contents($this->getResourcesPath() . 'commonSources.php', var_export($arrayCopy, true));
     $poContent = $translations->toPoString();
     // strip base path for better comparison
     $poContent = str_replace($this->getResourcesPath(), '', $poContent);
     $this->assertContains('"translate"', $poContent);
     $this->assertContains('"translate_with_gettext_context"', $poContent);
     $this->assertContains('"__"', $poContent);
     $this->assertContains('"_x"', $poContent);
     $this->assertContains('"_e"', $poContent);
     $this->assertContains('"_ex"', $poContent);
     $this->assertContains('"esc_attr__"', $poContent);
     $this->assertContains('"esc_attr_e"', $poContent);
     $this->assertContains('"esc_attr_x"', $poContent);
     $this->assertContains('"esc_html__"', $poContent);
     $this->assertContains('"esc_html_e"', $poContent);
     $this->assertContains('"esc_html_x"', $poContent);
     $this->assertContains('"_n-single"', $poContent);
     $this->assertContains('"_n-plural"', $poContent);
     $this->assertContains('"_nx-context"', $poContent);
     $this->assertContains('"_nx-single"', $poContent);
     $this->assertContains('"_nx-plural"', $poContent);
     $this->assertContains('"_n_noop-singular"', $poContent);
     $this->assertContains('"_n_noop-plural"', $poContent);
     $this->assertContains('"_nx_noop-context"', $poContent);
     $this->assertContains('"_nx_noop-singular"', $poContent);
     $this->assertContains('"_nx_noop-plural"', $poContent);
 }
开发者ID:sourcerer-mike,项目名称:wp-easy-translate,代码行数:36,代码来源:WpFunctionsScanner.php


示例4: main

 /**
  * main
  *
  */
 public function main()
 {
     $schemaPo = APP . 'Locale' . DS . 'schema.pot';
     $conn = ConnectionManager::get('default');
     $collection = $conn->schemaCollection();
     $translations = new Translations();
     $tables = $collection->listTables();
     foreach ($tables as $table) {
         $translations->insert($table, Inflector::humanize(Inflector::underscore($table)));
         $translations->insert($table, Inflector::humanize(Inflector::underscore(Inflector::singularize($table))));
         $columns = $collection->describe($table)->columns();
         foreach ($columns as $column) {
             $c = $collection->describe($table)->column($column);
             $comment = $c['comment'];
             $t = new Translation($table . '.' . $column, Inflector::humanize(Inflector::underscore($column)));
             $translations[] = $t;
             $t->setTranslation($comment);
             $t = new Translation($table . '.' . $column, Inflector::humanize(Inflector::underscore(Inflector::singularize($table))) . ' ' . Inflector::humanize(Inflector::underscore($column)));
             $translations[] = $t;
             $t->setTranslation($comment);
         }
     }
     $poString = $translations->toPoString();
     $caked = preg_replace('/msgctxt "([^"]+)"/i', '#: \\1', $poString);
     $this->createFile($schemaPo, $caked);
 }
开发者ID:k1low,项目名称:po,代码行数:30,代码来源:SchemaTask.php


示例5: exportTranslations

 /**
  * @deprecated
  */
 public function exportTranslations()
 {
     $translations = new Translations();
     foreach ($this->getList() as $type) {
         $translations->insert('AttributeTypeName', $type->getAttributeTypeName());
     }
     return $translations;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:11,代码来源:TypeFactory.php


示例6: mergeTranslationsWithSectionFile

 public function mergeTranslationsWithSectionFile(Section $section, Translations $translations)
 {
     $file = DIR_LANGUAGES_SITE_INTERFACE . '/' . $section->getLocale() . '.po';
     if (is_file($file)) {
         $sectionTranslations = PoExtractor::fromFile($file);
         $translations->mergeWith($sectionTranslations);
     }
 }
开发者ID:kreativmind,项目名称:concrete5-5.7.0,代码行数:8,代码来源:Extractor.php


示例7: generateHeaders

 /**
  * Returns the headers as a string.
  * 
  * @param Translations $translations
  *
  * @return string
  */
 private static function generateHeaders(Translations $translations)
 {
     $headers = '';
     foreach ($translations->getHeaders() as $name => $value) {
         $headers .= sprintf("%s: %s\n", $name, $value);
     }
     return $headers;
 }
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:15,代码来源:HeadersGeneratorTrait.php


示例8: exportTranslations

 /**
  * @deprecated
  */
 public function exportTranslations()
 {
     $translations = new Translations();
     $sets = $this->entityManager->getRepository('\\Concrete\\Core\\Entity\\Attribute\\Set')->findAll();
     foreach ($sets as $set) {
         $translations->insert('AttributeSet', $set->getAttributeSetName());
     }
     return $translations;
 }
开发者ID:seebaermichi,项目名称:concrete5,代码行数:12,代码来源:SetFactory.php


示例9: exportTranslations

 /**
  * @deprecated
  */
 public function exportTranslations()
 {
     $translations = new Translations();
     $keys = $this->entityManager->getRepository('\\Concrete\\Core\\Entity\\Attribute\\Key\\Key')->findAll();
     foreach ($keys as $key) {
         $translations->insert('AttributeKeyName', $key->getAttributeKeyName());
     }
     return $translations;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:12,代码来源:Factory.php


示例10: exportTranslations

 /**
  * @deprecated
  */
 public function exportTranslations()
 {
     $translations = new Translations();
     $list = $this->getList();
     $akcNameMap = array('collection' => 'Page attributes', 'user' => 'User attributes', 'file' => 'File attributes');
     foreach ($list as $category) {
         $akcHandle = $category->getAttributeKeyCategoryHandle();
         $translations->insert('AttributeKeyCategory', isset($akcNameMap[$akcHandle]) ? $akcNameMap[$akcHandle] : ucwords(str_replace(array('_', '-', '/'), ' ', $akcHandle)));
     }
     return $translations;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:14,代码来源:CategoryService.php


示例11: parseDirectoryDo

 /**
  * {@inheritdoc}
  *
  * @see \C5TL\Parser::parseDirectoryDo()
  */
 protected function parseDirectoryDo(\Gettext\Translations $translations, $rootDirectory, $relativePath, $subParsersFilter, $exclude3rdParty)
 {
     $themesPresets = array();
     $prefix = $relativePath === '' ? '' : "{$relativePath}/";
     $matches = null;
     foreach (array_merge(array(''), $this->getDirectoryStructure($rootDirectory, $exclude3rdParty)) as $child) {
         $presetsAbsDirectory = $child === '' ? $rootDirectory : "{$rootDirectory}/{$child}";
         if (preg_match('%(?:^|/)themes/\\w+/css/presets$%', $presetsAbsDirectory, $matches)) {
             $dirList = @scandir($presetsAbsDirectory);
             if ($dirList === false) {
                 throw new \Exception("Unable to parse directory {$presetsAbsDirectory}");
             }
             $shownChild = $child === '' ? rtrim($prefix, '/') : $prefix . $child;
             foreach ($dirList as $file) {
                 if ($file[0] !== '.' && preg_match('/[^.].*\\.less$/i', $file)) {
                     $fileAbs = "{$presetsAbsDirectory}/{$file}";
                     if (is_file($fileAbs)) {
                         $content = @file_get_contents($fileAbs);
                         if ($content === false) {
                             throw new \Exception("Error reading file '{$fileAbs}'");
                         }
                         $content = str_replace("\r", "\n", str_replace("\r\n", "\n", $content));
                         // Strip multiline comments
                         $content = preg_replace_callback('|/\\*.*?\\*/|s', function ($matches) {
                             return str_repeat("\n", substr_count($matches[0], "\n"));
                         }, $content);
                         foreach (array("'", '"') as $quote) {
                             if (preg_match('%(?:^|\\n|;)[ \\t]*@preset-name:\\s*' . $quote . '([^' . $quote . ']*)' . $quote . '\\s*(?:;|$)%s', $content, $matches)) {
                                 $presetName = $matches[1];
                                 $presetLine = null;
                                 $p = strpos($content, $matches[0]);
                                 if ($p !== false) {
                                     $presetLine = substr_count(substr($content, 0, $p), "\n") + 1;
                                 }
                                 if (!isset($themesPresets[$presetName])) {
                                     $themesPresets[$presetName] = array();
                                 }
                                 $themesPresets[$presetName][] = array($shownChild . "/{$file}", $presetLine);
                                 break;
                             }
                         }
                     }
                 }
             }
         }
     }
     foreach ($themesPresets as $themesPreset => $references) {
         $translation = $translations->insert('PresetName', ucwords(str_replace(array('_', '-', '/'), ' ', $themesPreset)));
         foreach ($references as $reference) {
             $translation->addReference($reference[0], $reference[1]);
         }
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:58,代码来源:ThemePresets.php


示例12: insertTranslation

 /**
  * Extract and insert a new translation.
  * 
  * @param Translations $translations
  * @param string       $key
  * @param string       $message
  */
 protected static function insertTranslation(Translations $translations, $key, $message)
 {
     $context_glue = '\\u0004';
     $key = explode($context_glue, $key);
     $context = isset($key[1]) ? array_shift($key) : '';
     $original = array_shift($key);
     $translation = array_shift($message);
     $plural_translation = array_shift($message);
     $entry = $translations->insert($context, $original);
     $entry->setTranslation($translation);
     $entry->setPluralTranslation($plural_translation);
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:19,代码来源:Jed.php


示例13: fromString

 /**
  * {@inheritDoc}
  */
 public static function fromString($string, Translations $translations = null, $file = '')
 {
     if ($translations === null) {
         $translations = new Translations();
     }
     if ($entries = json_decode($string, true)) {
         foreach ($entries as $original => $translation) {
             $translations->insert(null, $original)->setTranslation($translation);
         }
     }
     return $translations;
 }
开发者ID:jankal,项目名称:mvc,代码行数:15,代码来源:JsonDictionary.php


示例14: exportTranslations

 public static function exportTranslations()
 {
     $translations = new Translations();
     $em = \Database::connection()->getEntityManager();
     $options = $em->getRepository(SelectValueOption::class)->findAll();
     /**
      * @var $option SelectValueOption
      */
     foreach ($options as $option) {
         $translations->insert('SelectAttributeValue', $option->getSelectAttributeOptionValue());
     }
     return $translations;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:13,代码来源:option.php


示例15: saveGettextFunctions

 /**
  * Search for specific functions and create translations.
  *
  * @param array        $functions    The gettext functions to search
  * @param Translations $translations The translations instance where save the values
  * @param string       $file         The filename used to the reference
  */
 public function saveGettextFunctions(array $functions, Translations $translations, $file = '')
 {
     foreach ($this->getFunctions() as $function) {
         list($name, $line, $args) = $function;
         if (!isset($functions[$name])) {
             continue;
         }
         $translation = null;
         switch ($functions[$name]) {
             case '__':
                 if (!isset($args[0])) {
                     continue 2;
                 }
                 $original = $args[0];
                 if ($original !== '') {
                     $translation = $translations->insert('', $original);
                 }
                 break;
             case 'n__':
                 if (!isset($args[1])) {
                     continue 2;
                 }
                 $original = $args[0];
                 $plural = $args[1];
                 if ($original !== '') {
                     $translation = $translations->insert('', $original, $plural);
                 }
                 break;
             case 'p__':
                 if (!isset($args[1])) {
                     continue 2;
                 }
                 $context = $args[0];
                 $original = $args[1];
                 if ($original !== '') {
                     $translation = $translations->insert($context, $original);
                 }
                 break;
             default:
                 throw new Exception('Not valid functions');
         }
         if (isset($translation)) {
             $translation->addReference($file, $line);
             if (isset($function[3])) {
                 foreach ($function[3] as $extractedComment) {
                     $translation->addExtractedComment($extractedComment);
                 }
             }
         }
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:58,代码来源:FunctionsScanner.php


示例16: main

 /**
  * main
  *
  */
 public function main()
 {
     $default = APP . 'Locale' . DS . 'default.pot';
     $response = $this->in("What is the full path you would like to merge file (created pot file)?\nExample:" . $default . "\n[Q]uit", null, $default);
     if (strtoupper($response) === 'Q') {
         $this->out('Merge Aborted');
         $this->_stop();
     }
     $created = new File($response, false, 0755);
     if (!$created->exists()) {
         $this->err('The file path you supplied was not found. Please try again.');
         $this->_stop();
     }
     $default = APP . 'Locale' . DS . 'ja' . DS . 'default.po';
     $response = $this->in("What is the full path you would like to merge file (current po file)?\nExample: " . $default . "\n[Q]uit", null, $default);
     if (strtoupper($response) === 'Q') {
         $this->out('Merge Aborted');
         $this->_stop();
     }
     $current = new File($response, false, 0755);
     if (!$current->exists()) {
         $this->err('The file path you supplied was not found. Please try again.');
         $this->_stop();
     }
     $createdTranslations = Translations::fromPoFile($created->path);
     $createdTranslations->addFromPoFile($current->path);
     $merged = $createdTranslations->toPoString();
     $this->createFile($current->path, $merged);
 }
开发者ID:k1low,项目名称:exec,代码行数:33,代码来源:MergeTask.php


示例17: register

 public function register(Fol $app)
 {
     $app['middleware'] = function ($app) {
         $middleware = [];
         if ($app->has('users')) {
             $middleware[] = new Middlewares\DigestAuthentication($app['users']);
         }
         $middleware[] = new Middlewares\Expires();
         $middleware[] = (new Middlewares\ErrorHandler())->catchExceptions()->statusCode(function ($code) {
             return $code > 400 && $code < 600;
         })->arguments($app);
         $middleware[] = new Middlewares\BasePath($app->getUrlPath());
         $middleware[] = new Middlewares\TrailingSlash();
         $middleware[] = new Middlewares\ContentType();
         $middleware[] = new Middlewares\ContentLanguage(['en', 'gl', 'es']);
         $middleware[] = function ($request, $next) use($app) {
             $language = $request->getHeaderLine('Accept-Language');
             $translator = new Translator();
             $translator->loadTranslations(Translations::fromPoFile(dirname(dirname(__DIR__)) . '/locales/' . $language . '.po'));
             $prev = $translator->register();
             $app['templates']->addData(['language' => $language]);
             $response = $next($request);
             if ($prev) {
                 $prev->register();
             }
             return $response;
         };
         $middleware[] = (new Middlewares\MethodOverride())->parsedBodyParameter('method-override');
         $middleware[] = (new Middlewares\Reader(dirname(dirname(__DIR__)) . '/assets'))->continueOnError();
         $middleware[] = (new Middlewares\AuraRouter($app['router']))->arguments($app);
         return new Dispatcher($middleware);
     };
 }
开发者ID:oscarotero,项目名称:folk,代码行数:33,代码来源:Middleware.php


示例18: toString

 /**
  * {@parentDoc}.
  */
 public static function toString(Translations $translations)
 {
     $lines = array('msgid ""', 'msgstr ""');
     $headers = $translations->getHeaders();
     $headers['PO-Revision-Date'] = date('c');
     foreach ($headers as $name => $value) {
         $lines[] = '"' . $name . ': ' . $value . '\\n"';
     }
     $lines[] = '';
     //Translations
     foreach ($translations as $translation) {
         if ($translation->hasComments()) {
             foreach ($translation->getComments() as $comment) {
                 $lines[] = '# ' . $comment;
             }
         }
         if ($translation->hasExtractedComments()) {
             foreach ($translation->getExtractedComments() as $comment) {
                 $lines[] = '#. ' . $comment;
             }
         }
         if ($translation->hasReferences()) {
             foreach ($translation->getReferences() as $reference) {
                 $lines[] = '#: ' . $reference[0] . (!is_null($reference[1]) ? ':' . $reference[1] : null);
             }
         }
         if ($translation->hasFlags()) {
             $lines[] = '#, ' . implode(',', $translation->getFlags());
         }
         if ($translation->hasContext()) {
             $lines[] = 'msgctxt ' . self::convertString($translation->getContext());
         }
         self::addLines($lines, 'msgid', $translation->getOriginal());
         if ($translation->hasPlural()) {
             self::addLines($lines, 'msgid_plural', $translation->getPlural());
             self::addLines($lines, 'msgstr[0]', $translation->getTranslation());
             foreach ($translation->getPluralTranslation() as $k => $v) {
                 self::addLines($lines, 'msgstr[' . ($k + 1) . ']', $v);
             }
         } else {
             self::addLines($lines, 'msgstr', $translation->getTranslation());
         }
         $lines[] = '';
     }
     return implode("\n", $lines);
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:49,代码来源:Po.php


示例19: toString

 /**
  * {@parentDoc}.
  */
 public static function toString(Translations $translations, array $options = [])
 {
     $pluralForm = $translations->getPluralForms();
     $pluralSize = is_array($pluralForm) ? $pluralForm[0] - 1 : null;
     $lines = ['msgid ""', 'msgstr ""'];
     foreach ($translations->getHeaders() as $name => $value) {
         $lines[] = sprintf('"%s: %s\\n"', $name, $value);
     }
     $lines[] = '';
     //Translations
     foreach ($translations as $translation) {
         if ($translation->hasComments()) {
             foreach ($translation->getComments() as $comment) {
                 $lines[] = '# ' . $comment;
             }
         }
         if ($translation->hasExtractedComments()) {
             foreach ($translation->getExtractedComments() as $comment) {
                 $lines[] = '#. ' . $comment;
             }
         }
         if ($translation->hasReferences()) {
             foreach ($translation->getReferences() as $reference) {
                 $lines[] = '#: ' . $reference[0] . (!is_null($reference[1]) ? ':' . $reference[1] : null);
             }
         }
         if ($translation->hasFlags()) {
             $lines[] = '#, ' . implode(',', $translation->getFlags());
         }
         if ($translation->hasContext()) {
             $lines[] = 'msgctxt ' . self::convertString($translation->getContext());
         }
         self::addLines($lines, 'msgid', $translation->getOriginal());
         if ($translation->hasPlural()) {
             self::addLines($lines, 'msgid_plural', $translation->getPlural());
             self::addLines($lines, 'msgstr[0]', $translation->getTranslation());
             foreach ($translation->getPluralTranslations($pluralSize) as $k => $v) {
                 self::addLines($lines, 'msgstr[' . ($k + 1) . ']', $v);
             }
         } else {
             self::addLines($lines, 'msgstr', $translation->getTranslation());
         }
         $lines[] = '';
     }
     return implode("\n", $lines);
 }
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:49,代码来源:Po.php


示例20: fromString

 /**
  * {@inheritdoc}
  */
 public static function fromString($string, Translations $translations, array $options = [])
 {
     $xml = new SimpleXMLElement($string, null, false);
     foreach ($xml->file as $file) {
         if (isset($file->notes)) {
             foreach ($file->notes->note as $note) {
                 $translations->setHeader($note['id'], (string) $note);
             }
         }
         foreach ($file->unit as $unit) {
             foreach ($unit->segment as $segment) {
                 $targets = [];
                 foreach ($segment->target as $target) {
                     $targets[] = (string) $target;
                 }
                 $translation = new Translation(null, (string) $segment->source);
                 $translation->setTranslation(array_shift($targets));
                 $translation->setPluralTranslations($targets);
                 if (isset($unit->notes)) {
                     foreach ($unit->notes->note as $note) {
                         switch ($note['category']) {
                             case 'context':
                                 $translation = $translation->getClone((string) $note);
                                 break;
                             case 'extracted-comment':
                                 $translation->addExtractedComment((string) $note);
                                 break;
                             case 'flag':
                                 $translation->addFlag((string) $note);
                                 break;
                             case 'reference':
                                 $ref = explode(':', (string) $note, 2);
                                 $translation->addReference($ref[0], isset($ref[1]) ? $ref[1] : null);
                                 break;
                             default:
                                 $translation->addComment((string) $note);
                                 break;
                         }
                     }
                 }
                 $translations[] = $translation;
             }
         }
     }
 }
开发者ID:parkerj,项目名称:eduTrac-SIS,代码行数:48,代码来源:Xliff.php



注:本文中的Gettext\Translations类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Github\Client类代码示例发布时间:2022-05-23
下一篇:
PHP Gekosale\App类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap