Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
@ -11,16 +11,14 @@
|
|||
|
||||
namespace Symfony\Component\Translation\Loader;
|
||||
|
||||
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
||||
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
|
||||
/**
|
||||
* CsvFileLoader loads translations from CSV files.
|
||||
*
|
||||
* @author Saša Stamenković <umpirsky@gmail.com>
|
||||
*/
|
||||
class CsvFileLoader extends ArrayLoader
|
||||
class CsvFileLoader extends FileLoader
|
||||
{
|
||||
private $delimiter = ';';
|
||||
private $enclosure = '"';
|
||||
|
@ -29,16 +27,8 @@ class CsvFileLoader extends ArrayLoader
|
|||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load($resource, $locale, $domain = 'messages')
|
||||
protected function loadResource($resource)
|
||||
{
|
||||
if (!stream_is_local($resource)) {
|
||||
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
||||
}
|
||||
|
||||
if (!file_exists($resource)) {
|
||||
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
||||
}
|
||||
|
||||
$messages = array();
|
||||
|
||||
try {
|
||||
|
@ -56,13 +46,7 @@ class CsvFileLoader extends ArrayLoader
|
|||
}
|
||||
}
|
||||
|
||||
$catalogue = parent::load($messages, $locale, $domain);
|
||||
|
||||
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
||||
$catalogue->addResource(new FileResource($resource));
|
||||
}
|
||||
|
||||
return $catalogue;
|
||||
return $messages;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
65
vendor/symfony/translation/Loader/FileLoader.php
vendored
Normal file
65
vendor/symfony/translation/Loader/FileLoader.php
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Translation\Loader;
|
||||
|
||||
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
||||
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
|
||||
/**
|
||||
* @author Abdellatif Ait boudad <a.aitboudad@gmail.com>
|
||||
*/
|
||||
abstract class FileLoader extends ArrayLoader
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load($resource, $locale, $domain = 'messages')
|
||||
{
|
||||
if (!stream_is_local($resource)) {
|
||||
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
||||
}
|
||||
|
||||
if (!file_exists($resource)) {
|
||||
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
||||
}
|
||||
|
||||
$messages = $this->loadResource($resource);
|
||||
|
||||
// empty resource
|
||||
if (null === $messages) {
|
||||
$messages = array();
|
||||
}
|
||||
|
||||
// not an array
|
||||
if (!is_array($messages)) {
|
||||
throw new InvalidResourceException(sprintf('Unable to load file "%s".', $resource));
|
||||
}
|
||||
|
||||
$catalogue = parent::load($messages, $locale, $domain);
|
||||
|
||||
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
||||
$catalogue->addResource(new FileResource($resource));
|
||||
}
|
||||
|
||||
return $catalogue;
|
||||
}
|
||||
|
||||
/*
|
||||
* @param string $resource
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws InvalidResourceException If stream content has an invalid format.
|
||||
*/
|
||||
abstract protected function loadResource($resource);
|
||||
}
|
|
@ -11,38 +11,18 @@
|
|||
|
||||
namespace Symfony\Component\Translation\Loader;
|
||||
|
||||
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
||||
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
|
||||
/**
|
||||
* IniFileLoader loads translations from an ini file.
|
||||
*
|
||||
* @author stealth35
|
||||
*/
|
||||
class IniFileLoader extends ArrayLoader
|
||||
class IniFileLoader extends FileLoader
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load($resource, $locale, $domain = 'messages')
|
||||
protected function loadResource($resource)
|
||||
{
|
||||
if (!stream_is_local($resource)) {
|
||||
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
||||
}
|
||||
|
||||
if (!file_exists($resource)) {
|
||||
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
||||
}
|
||||
|
||||
$messages = parse_ini_file($resource, true);
|
||||
|
||||
$catalogue = parent::load($messages, $locale, $domain);
|
||||
|
||||
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
||||
$catalogue->addResource(new FileResource($resource));
|
||||
}
|
||||
|
||||
return $catalogue;
|
||||
return parse_ini_file($resource, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,29 +12,19 @@
|
|||
namespace Symfony\Component\Translation\Loader;
|
||||
|
||||
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
||||
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
|
||||
/**
|
||||
* JsonFileLoader loads translations from an json file.
|
||||
*
|
||||
* @author singles
|
||||
*/
|
||||
class JsonFileLoader extends ArrayLoader
|
||||
class JsonFileLoader extends FileLoader
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load($resource, $locale, $domain = 'messages')
|
||||
protected function loadResource($resource)
|
||||
{
|
||||
if (!stream_is_local($resource)) {
|
||||
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
||||
}
|
||||
|
||||
if (!file_exists($resource)) {
|
||||
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
||||
}
|
||||
|
||||
$messages = array();
|
||||
if ($data = file_get_contents($resource)) {
|
||||
$messages = json_decode($data, true);
|
||||
|
@ -44,14 +34,7 @@ class JsonFileLoader extends ArrayLoader
|
|||
}
|
||||
}
|
||||
|
||||
if (null === $messages) {
|
||||
$messages = array();
|
||||
}
|
||||
|
||||
$catalogue = parent::load($messages, $locale, $domain);
|
||||
$catalogue->addResource(new FileResource($resource));
|
||||
|
||||
return $catalogue;
|
||||
return $messages;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -12,13 +12,11 @@
|
|||
namespace Symfony\Component\Translation\Loader;
|
||||
|
||||
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
||||
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/)
|
||||
*/
|
||||
class MoFileLoader extends ArrayLoader
|
||||
class MoFileLoader extends FileLoader
|
||||
{
|
||||
/**
|
||||
* Magic used for validating the format of a MO file as well as
|
||||
|
@ -43,48 +41,13 @@ class MoFileLoader extends ArrayLoader
|
|||
*/
|
||||
const MO_HEADER_SIZE = 28;
|
||||
|
||||
public function load($resource, $locale, $domain = 'messages')
|
||||
{
|
||||
if (!stream_is_local($resource)) {
|
||||
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
||||
}
|
||||
|
||||
if (!file_exists($resource)) {
|
||||
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
||||
}
|
||||
|
||||
$messages = $this->parse($resource);
|
||||
|
||||
// empty file
|
||||
if (null === $messages) {
|
||||
$messages = array();
|
||||
}
|
||||
|
||||
// not an array
|
||||
if (!is_array($messages)) {
|
||||
throw new InvalidResourceException(sprintf('The file "%s" must contain a valid mo file.', $resource));
|
||||
}
|
||||
|
||||
$catalogue = parent::load($messages, $locale, $domain);
|
||||
|
||||
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
||||
$catalogue->addResource(new FileResource($resource));
|
||||
}
|
||||
|
||||
return $catalogue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses machine object (MO) format, independent of the machine's endian it
|
||||
* was created on. Both 32bit and 64bit systems are supported.
|
||||
*
|
||||
* @param resource $resource
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws InvalidResourceException If stream content has an invalid format.
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
private function parse($resource)
|
||||
protected function loadResource($resource)
|
||||
{
|
||||
$stream = fopen($resource, 'r');
|
||||
|
||||
|
|
|
@ -11,38 +11,18 @@
|
|||
|
||||
namespace Symfony\Component\Translation\Loader;
|
||||
|
||||
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
||||
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
|
||||
/**
|
||||
* PhpFileLoader loads translations from PHP files returning an array of translations.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class PhpFileLoader extends ArrayLoader
|
||||
class PhpFileLoader extends FileLoader
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load($resource, $locale, $domain = 'messages')
|
||||
protected function loadResource($resource)
|
||||
{
|
||||
if (!stream_is_local($resource)) {
|
||||
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
||||
}
|
||||
|
||||
if (!file_exists($resource)) {
|
||||
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
||||
}
|
||||
|
||||
$messages = require $resource;
|
||||
|
||||
$catalogue = parent::load($messages, $locale, $domain);
|
||||
|
||||
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
||||
$catalogue->addResource(new FileResource($resource));
|
||||
}
|
||||
|
||||
return $catalogue;
|
||||
return require $resource;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,47 +11,12 @@
|
|||
|
||||
namespace Symfony\Component\Translation\Loader;
|
||||
|
||||
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
||||
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/)
|
||||
* @copyright Copyright (c) 2012, Clemens Tolboom
|
||||
*/
|
||||
class PoFileLoader extends ArrayLoader
|
||||
class PoFileLoader extends FileLoader
|
||||
{
|
||||
public function load($resource, $locale, $domain = 'messages')
|
||||
{
|
||||
if (!stream_is_local($resource)) {
|
||||
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
||||
}
|
||||
|
||||
if (!file_exists($resource)) {
|
||||
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
||||
}
|
||||
|
||||
$messages = $this->parse($resource);
|
||||
|
||||
// empty file
|
||||
if (null === $messages) {
|
||||
$messages = array();
|
||||
}
|
||||
|
||||
// not an array
|
||||
if (!is_array($messages)) {
|
||||
throw new InvalidResourceException(sprintf('The file "%s" must contain a valid po file.', $resource));
|
||||
}
|
||||
|
||||
$catalogue = parent::load($messages, $locale, $domain);
|
||||
|
||||
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
||||
$catalogue->addResource(new FileResource($resource));
|
||||
}
|
||||
|
||||
return $catalogue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses portable object (PO) format.
|
||||
*
|
||||
|
@ -93,11 +58,9 @@ class PoFileLoader extends ArrayLoader
|
|||
*
|
||||
* Items with an empty id are ignored.
|
||||
*
|
||||
* @param resource $resource
|
||||
*
|
||||
* @return array
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
private function parse($resource)
|
||||
protected function loadResource($resource)
|
||||
{
|
||||
$stream = fopen($resource, 'r');
|
||||
|
||||
|
@ -108,14 +71,20 @@ class PoFileLoader extends ArrayLoader
|
|||
|
||||
$messages = array();
|
||||
$item = $defaults;
|
||||
$flags = array();
|
||||
|
||||
while ($line = fgets($stream)) {
|
||||
$line = trim($line);
|
||||
|
||||
if ($line === '') {
|
||||
// Whitespace indicated current item is done
|
||||
$this->addMessage($messages, $item);
|
||||
if (!in_array('fuzzy', $flags)) {
|
||||
$this->addMessage($messages, $item);
|
||||
}
|
||||
$item = $defaults;
|
||||
$flags = array();
|
||||
} elseif (substr($line, 0, 2) === '#,') {
|
||||
$flags = array_map('trim', explode(',', substr($line, 2)));
|
||||
} elseif (substr($line, 0, 7) === 'msgid "') {
|
||||
// We start a new msg so save previous
|
||||
// TODO: this fails when comments or contexts are added
|
||||
|
@ -141,7 +110,9 @@ class PoFileLoader extends ArrayLoader
|
|||
}
|
||||
}
|
||||
// save last item
|
||||
$this->addMessage($messages, $item);
|
||||
if (!in_array('fuzzy', $flags)) {
|
||||
$this->addMessage($messages, $item);
|
||||
}
|
||||
fclose($stream);
|
||||
|
||||
return $messages;
|
||||
|
|
|
@ -37,10 +37,49 @@ class XliffFileLoader implements LoaderInterface
|
|||
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
||||
}
|
||||
|
||||
list($xml, $encoding) = $this->parseFile($resource);
|
||||
$xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:1.2');
|
||||
|
||||
$catalogue = new MessageCatalogue($locale);
|
||||
$this->extract($resource, $catalogue, $domain);
|
||||
|
||||
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
||||
$catalogue->addResource(new FileResource($resource));
|
||||
}
|
||||
|
||||
return $catalogue;
|
||||
}
|
||||
|
||||
private function extract($resource, MessageCatalogue $catalogue, $domain)
|
||||
{
|
||||
try {
|
||||
$dom = XmlUtils::loadFile($resource);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
throw new InvalidResourceException(sprintf('Unable to load "%s": %s', $resource, $e->getMessage()), $e->getCode(), $e);
|
||||
}
|
||||
|
||||
$xliffVersion = $this->getVersionNumber($dom);
|
||||
$this->validateSchema($xliffVersion, $dom, $this->getSchema($xliffVersion));
|
||||
|
||||
if ('1.2' === $xliffVersion) {
|
||||
$this->extractXliff1($dom, $catalogue, $domain);
|
||||
}
|
||||
|
||||
if ('2.0' === $xliffVersion) {
|
||||
$this->extractXliff2($dom, $catalogue, $domain);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract messages and metadata from DOMDocument into a MessageCatalogue.
|
||||
*
|
||||
* @param \DOMDocument $dom Source to extract messages and metadata
|
||||
* @param MessageCatalogue $catalogue Catalogue where we'll collect messages and metadata
|
||||
* @param string $domain The domain
|
||||
*/
|
||||
private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, $domain)
|
||||
{
|
||||
$xml = simplexml_import_dom($dom);
|
||||
$encoding = strtoupper($dom->encoding);
|
||||
|
||||
$xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:1.2');
|
||||
foreach ($xml->xpath('//xliff:trans-unit') as $translation) {
|
||||
$attributes = $translation->attributes();
|
||||
|
||||
|
@ -55,31 +94,52 @@ class XliffFileLoader implements LoaderInterface
|
|||
|
||||
$catalogue->set((string) $source, $target, $domain);
|
||||
|
||||
if (isset($translation->note)) {
|
||||
$notes = array();
|
||||
foreach ($translation->note as $xmlNote) {
|
||||
$noteAttributes = $xmlNote->attributes();
|
||||
$note = array('content' => $this->utf8ToCharset((string) $xmlNote, $encoding));
|
||||
if (isset($noteAttributes['priority'])) {
|
||||
$note['priority'] = (int) $noteAttributes['priority'];
|
||||
}
|
||||
|
||||
if (isset($noteAttributes['from'])) {
|
||||
$note['from'] = (string) $noteAttributes['from'];
|
||||
}
|
||||
|
||||
$notes[] = $note;
|
||||
}
|
||||
|
||||
$catalogue->setMetadata((string) $source, array('notes' => $notes), $domain);
|
||||
$metadata = array();
|
||||
if ($notes = $this->parseNotesMetadata($translation->note, $encoding)) {
|
||||
$metadata['notes'] = $notes;
|
||||
}
|
||||
if (isset($translation->target) && $translation->target->attributes()) {
|
||||
$metadata['target-attributes'] = array();
|
||||
foreach ($translation->target->attributes() as $key => $value) {
|
||||
$metadata['target-attributes'][$key] = (string) $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
||||
$catalogue->addResource(new FileResource($resource));
|
||||
$catalogue->setMetadata((string) $source, $metadata, $domain);
|
||||
}
|
||||
}
|
||||
|
||||
return $catalogue;
|
||||
/**
|
||||
* @param \DOMDocument $dom
|
||||
* @param MessageCatalogue $catalogue
|
||||
* @param string $domain
|
||||
*/
|
||||
private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, $domain)
|
||||
{
|
||||
$xml = simplexml_import_dom($dom);
|
||||
$encoding = strtoupper($dom->encoding);
|
||||
|
||||
$xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:2.0');
|
||||
|
||||
foreach ($xml->xpath('//xliff:unit/xliff:segment') as $segment) {
|
||||
$source = $segment->source;
|
||||
|
||||
// If the xlf file has another encoding specified, try to convert it because
|
||||
// simple_xml will always return utf-8 encoded values
|
||||
$target = $this->utf8ToCharset((string) (isset($segment->target) ? $segment->target : $source), $encoding);
|
||||
|
||||
$catalogue->set((string) $source, $target, $domain);
|
||||
|
||||
$metadata = array();
|
||||
if (isset($segment->target) && $segment->target->attributes()) {
|
||||
$metadata['target-attributes'] = array();
|
||||
foreach ($segment->target->attributes() as $key => $value) {
|
||||
$metadata['target-attributes'][$key] = (string) $value;
|
||||
}
|
||||
}
|
||||
|
||||
$catalogue->setMetadata((string) $source, $metadata, $domain);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -93,57 +153,24 @@ class XliffFileLoader implements LoaderInterface
|
|||
private function utf8ToCharset($content, $encoding = null)
|
||||
{
|
||||
if ('UTF-8' !== $encoding && !empty($encoding)) {
|
||||
if (function_exists('mb_convert_encoding')) {
|
||||
return mb_convert_encoding($content, $encoding, 'UTF-8');
|
||||
}
|
||||
|
||||
if (function_exists('iconv')) {
|
||||
return iconv('UTF-8', $encoding, $content);
|
||||
}
|
||||
|
||||
throw new \RuntimeException('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).');
|
||||
return mb_convert_encoding($content, $encoding, 'UTF-8');
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates and parses the given file into a SimpleXMLElement.
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*
|
||||
* @return \SimpleXMLElement
|
||||
* @param string $file
|
||||
* @param \DOMDocument $dom
|
||||
* @param string $schema source of the schema
|
||||
*
|
||||
* @throws InvalidResourceException
|
||||
*/
|
||||
private function parseFile($file)
|
||||
private function validateSchema($file, \DOMDocument $dom, $schema)
|
||||
{
|
||||
try {
|
||||
$dom = XmlUtils::loadFile($file);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
throw new InvalidResourceException(sprintf('Unable to load "%s": %s', $file, $e->getMessage()), $e->getCode(), $e);
|
||||
}
|
||||
|
||||
$internalErrors = libxml_use_internal_errors(true);
|
||||
|
||||
$location = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd';
|
||||
$parts = explode('/', $location);
|
||||
if (0 === stripos($location, 'phar://')) {
|
||||
$tmpfile = tempnam(sys_get_temp_dir(), 'sf2');
|
||||
if ($tmpfile) {
|
||||
copy($location, $tmpfile);
|
||||
$parts = explode('/', str_replace('\\', '/', $tmpfile));
|
||||
}
|
||||
}
|
||||
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
|
||||
$location = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts));
|
||||
|
||||
$source = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-1.2-strict.xsd');
|
||||
$source = str_replace('http://www.w3.org/2001/xml.xsd', $location, $source);
|
||||
|
||||
if (!@$dom->schemaValidateSource($source)) {
|
||||
if (!@$dom->schemaValidateSource($schema)) {
|
||||
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $file, implode("\n", $this->getXmlErrors($internalErrors))));
|
||||
}
|
||||
|
||||
|
@ -151,8 +178,46 @@ class XliffFileLoader implements LoaderInterface
|
|||
|
||||
libxml_clear_errors();
|
||||
libxml_use_internal_errors($internalErrors);
|
||||
}
|
||||
|
||||
return array(simplexml_import_dom($dom), strtoupper($dom->encoding));
|
||||
private function getSchema($xliffVersion)
|
||||
{
|
||||
if ('1.2' === $xliffVersion) {
|
||||
$schemaSource = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-1.2-strict.xsd');
|
||||
$xmlUri = 'http://www.w3.org/2001/xml.xsd';
|
||||
} elseif ('2.0' === $xliffVersion) {
|
||||
$schemaSource = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-2.0.xsd');
|
||||
$xmlUri = 'informativeCopiesOf3rdPartySchemas/w3c/xml.xsd';
|
||||
} else {
|
||||
throw new \InvalidArgumentException(sprintf('No support implemented for loading XLIFF version "%s".', $xliffVersion));
|
||||
}
|
||||
|
||||
return $this->fixXmlLocation($schemaSource, $xmlUri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Internally changes the URI of a dependent xsd to be loaded locally.
|
||||
*
|
||||
* @param string $schemaSource Current content of schema file
|
||||
* @param string $xmlUri External URI of XML to convert to local
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function fixXmlLocation($schemaSource, $xmlUri)
|
||||
{
|
||||
$newPath = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd';
|
||||
$parts = explode('/', $newPath);
|
||||
if (0 === stripos($newPath, 'phar://')) {
|
||||
$tmpfile = tempnam(sys_get_temp_dir(), 'sf2');
|
||||
if ($tmpfile) {
|
||||
copy($newPath, $tmpfile);
|
||||
$parts = explode('/', str_replace('\\', '/', $tmpfile));
|
||||
}
|
||||
}
|
||||
$drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
|
||||
$newPath = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts));
|
||||
|
||||
return str_replace($xmlUri, $newPath, $schemaSource);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -181,4 +246,68 @@ class XliffFileLoader implements LoaderInterface
|
|||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets xliff file version based on the root "version" attribute.
|
||||
* Defaults to 1.2 for backwards compatibility.
|
||||
*
|
||||
* @param \DOMDocument $dom
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getVersionNumber(\DOMDocument $dom)
|
||||
{
|
||||
/** @var \DOMNode $xliff */
|
||||
foreach ($dom->getElementsByTagName('xliff') as $xliff) {
|
||||
$version = $xliff->attributes->getNamedItem('version');
|
||||
if ($version) {
|
||||
return $version->nodeValue;
|
||||
}
|
||||
|
||||
$namespace = $xliff->attributes->getNamedItem('xmlns');
|
||||
if ($namespace) {
|
||||
if (substr_compare('urn:oasis:names:tc:xliff:document:', $namespace->nodeValue, 0, 34) !== 0) {
|
||||
throw new \InvalidArgumentException(sprintf('Not a valid XLIFF namespace "%s"', $namespace));
|
||||
}
|
||||
|
||||
return substr($namespace, 34);
|
||||
}
|
||||
}
|
||||
|
||||
// Falls back to v1.2
|
||||
return '1.2';
|
||||
}
|
||||
|
||||
/*
|
||||
* @param \SimpleXMLElement|null $noteElement
|
||||
* @param string|null $encoding
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function parseNotesMetadata(\SimpleXMLElement $noteElement = null, $encoding = null)
|
||||
{
|
||||
$notes = array();
|
||||
|
||||
if (null === $noteElement) {
|
||||
return $notes;
|
||||
}
|
||||
|
||||
foreach ($noteElement as $xmlNote) {
|
||||
$noteAttributes = $xmlNote->attributes();
|
||||
$note = array('content' => $this->utf8ToCharset((string) $xmlNote, $encoding));
|
||||
if (isset($noteAttributes['priority'])) {
|
||||
$note['priority'] = (int) $noteAttributes['priority'];
|
||||
}
|
||||
|
||||
if (isset($noteAttributes['from'])) {
|
||||
$note['from'] = (string) $noteAttributes['from'];
|
||||
}
|
||||
|
||||
$notes[] = $note;
|
||||
}
|
||||
|
||||
return $notes;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
namespace Symfony\Component\Translation\Loader;
|
||||
|
||||
use Symfony\Component\Translation\Exception\InvalidResourceException;
|
||||
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
use Symfony\Component\Yaml\Parser as YamlParser;
|
||||
use Symfony\Component\Yaml\Exception\ParseException;
|
||||
|
||||
|
@ -22,28 +20,20 @@ use Symfony\Component\Yaml\Exception\ParseException;
|
|||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class YamlFileLoader extends ArrayLoader
|
||||
class YamlFileLoader extends FileLoader
|
||||
{
|
||||
private $yamlParser;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load($resource, $locale, $domain = 'messages')
|
||||
protected function loadResource($resource)
|
||||
{
|
||||
if (!stream_is_local($resource)) {
|
||||
throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource));
|
||||
}
|
||||
|
||||
if (!file_exists($resource)) {
|
||||
throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource));
|
||||
}
|
||||
|
||||
if (!class_exists('Symfony\Component\Yaml\Parser')) {
|
||||
throw new \LogicException('Loading translations from the YAML format requires the Symfony Yaml component.');
|
||||
}
|
||||
|
||||
if (null === $this->yamlParser) {
|
||||
if (!class_exists('Symfony\Component\Yaml\Parser')) {
|
||||
throw new \LogicException('Loading translations from the YAML format requires the Symfony Yaml component.');
|
||||
}
|
||||
|
||||
$this->yamlParser = new YamlParser();
|
||||
}
|
||||
|
||||
|
@ -53,22 +43,6 @@ class YamlFileLoader extends ArrayLoader
|
|||
throw new InvalidResourceException(sprintf('Error parsing YAML, invalid file "%s"', $resource), 0, $e);
|
||||
}
|
||||
|
||||
// empty file
|
||||
if (null === $messages) {
|
||||
$messages = array();
|
||||
}
|
||||
|
||||
// not an array
|
||||
if (!is_array($messages)) {
|
||||
throw new InvalidResourceException(sprintf('The file "%s" must contain a YAML array.', $resource));
|
||||
}
|
||||
|
||||
$catalogue = parent::load($messages, $locale, $domain);
|
||||
|
||||
if (class_exists('Symfony\Component\Config\Resource\FileResource')) {
|
||||
$catalogue->addResource(new FileResource($resource));
|
||||
}
|
||||
|
||||
return $catalogue;
|
||||
return $messages;
|
||||
}
|
||||
}
|
||||
|
|
411
vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-2.0.xsd
vendored
Normal file
411
vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-2.0.xsd
vendored
Normal file
|
@ -0,0 +1,411 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
XLIFF Version 2.0
|
||||
OASIS Standard
|
||||
05 August 2014
|
||||
Copyright (c) OASIS Open 2014. All rights reserved.
|
||||
Source: http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/schemas/
|
||||
-->
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
elementFormDefault="qualified"
|
||||
xmlns:xlf="urn:oasis:names:tc:xliff:document:2.0"
|
||||
targetNamespace="urn:oasis:names:tc:xliff:document:2.0">
|
||||
|
||||
<!-- Import -->
|
||||
|
||||
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
|
||||
schemaLocation="informativeCopiesOf3rdPartySchemas/w3c/xml.xsd"/>
|
||||
|
||||
<!-- Element Group -->
|
||||
|
||||
<xs:group name="inline">
|
||||
<xs:choice>
|
||||
<xs:element ref="xlf:cp"/>
|
||||
<xs:element ref="xlf:ph"/>
|
||||
<xs:element ref="xlf:pc"/>
|
||||
<xs:element ref="xlf:sc"/>
|
||||
<xs:element ref="xlf:ec"/>
|
||||
<xs:element ref="xlf:mrk"/>
|
||||
<xs:element ref="xlf:sm"/>
|
||||
<xs:element ref="xlf:em"/>
|
||||
</xs:choice>
|
||||
</xs:group>
|
||||
|
||||
<!-- Attribute Types -->
|
||||
|
||||
<xs:simpleType name="yesNo">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="yes"/>
|
||||
<xs:enumeration value="no"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="yesNoFirstNo">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="yes"/>
|
||||
<xs:enumeration value="firstNo"/>
|
||||
<xs:enumeration value="no"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="dirValue">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="ltr"/>
|
||||
<xs:enumeration value="rtl"/>
|
||||
<xs:enumeration value="auto"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="appliesTo">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="source"/>
|
||||
<xs:enumeration value="target"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="userDefinedValue">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="[^\s:]+:[^\s:]+"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="attrType_type">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="fmt"/>
|
||||
<xs:enumeration value="ui"/>
|
||||
<xs:enumeration value="quote"/>
|
||||
<xs:enumeration value="link"/>
|
||||
<xs:enumeration value="image"/>
|
||||
<xs:enumeration value="other"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="typeForMrkValues">
|
||||
<xs:restriction base="xs:NMTOKEN">
|
||||
<xs:enumeration value="generic"/>
|
||||
<xs:enumeration value="comment"/>
|
||||
<xs:enumeration value="term"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="attrType_typeForMrk">
|
||||
<xs:union memberTypes="xlf:typeForMrkValues xlf:userDefinedValue"/>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="priorityValue">
|
||||
<xs:restriction base="xs:positiveInteger">
|
||||
<xs:minInclusive value="1"/>
|
||||
<xs:maxInclusive value="10"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="stateType">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="initial"/>
|
||||
<xs:enumeration value="translated"/>
|
||||
<xs:enumeration value="reviewed"/>
|
||||
<xs:enumeration value="final"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<!-- Structural Elements -->
|
||||
|
||||
<xs:element name="xliff">
|
||||
<xs:complexType mixed="false">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="1" maxOccurs="unbounded" ref="xlf:file"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="version" use="required"/>
|
||||
<xs:attribute name="srcLang" use="required"/>
|
||||
<xs:attribute name="trgLang" use="optional"/>
|
||||
<xs:attribute ref="xml:space" use="optional" default="default"/>
|
||||
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="file">
|
||||
<xs:complexType mixed="false">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:skeleton"/>
|
||||
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"
|
||||
processContents="lax"/>
|
||||
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:notes"/>
|
||||
<xs:choice minOccurs="1" maxOccurs="unbounded">
|
||||
<xs:element ref="xlf:unit"/>
|
||||
<xs:element ref="xlf:group"/>
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="canResegment" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="original" use="optional"/>
|
||||
<xs:attribute name="translate" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="srcDir" use="optional" type="xlf:dirValue" default="auto"/>
|
||||
<xs:attribute name="trgDir" use="optional" type="xlf:dirValue" default="auto"/>
|
||||
<xs:attribute ref="xml:space" use="optional"/>
|
||||
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="skeleton">
|
||||
<xs:complexType mixed="true">
|
||||
<xs:sequence>
|
||||
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"
|
||||
processContents="lax"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="href" use="optional"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="group">
|
||||
<xs:complexType mixed="false">
|
||||
<xs:sequence>
|
||||
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"
|
||||
processContents="lax"/>
|
||||
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:notes"/>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element ref="xlf:unit"/>
|
||||
<xs:element ref="xlf:group"/>
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="name" use="optional"/>
|
||||
<xs:attribute name="canResegment" use="optional" type="xlf:yesNo"/>
|
||||
<xs:attribute name="translate" use="optional" type="xlf:yesNo"/>
|
||||
<xs:attribute name="srcDir" use="optional" type="xlf:dirValue"/>
|
||||
<xs:attribute name="trgDir" use="optional" type="xlf:dirValue"/>
|
||||
<xs:attribute name="type" use="optional" type="xlf:userDefinedValue"/>
|
||||
<xs:attribute ref="xml:space" use="optional"/>
|
||||
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="unit">
|
||||
<xs:complexType mixed="false">
|
||||
<xs:sequence>
|
||||
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"
|
||||
processContents="lax"/>
|
||||
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:notes"/>
|
||||
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:originalData"/>
|
||||
<xs:choice minOccurs="1" maxOccurs="unbounded">
|
||||
<xs:element ref="xlf:segment"/>
|
||||
<xs:element ref="xlf:ignorable"/>
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="name" use="optional"/>
|
||||
<xs:attribute name="canResegment" use="optional" type="xlf:yesNo"/>
|
||||
<xs:attribute name="translate" use="optional" type="xlf:yesNo"/>
|
||||
<xs:attribute name="srcDir" use="optional" type="xlf:dirValue"/>
|
||||
<xs:attribute name="trgDir" use="optional" type="xlf:dirValue"/>
|
||||
<xs:attribute ref="xml:space" use="optional"/>
|
||||
<xs:attribute name="type" use="optional" type="xlf:userDefinedValue"/>
|
||||
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="segment">
|
||||
<xs:complexType mixed="false">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="1" maxOccurs="1" ref="xlf:source"/>
|
||||
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:target"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="canResegment" use="optional" type="xlf:yesNo"/>
|
||||
<xs:attribute name="state" use="optional" type="xlf:stateType" default="initial"/>
|
||||
<xs:attribute name="subState" use="optional"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="ignorable">
|
||||
<xs:complexType mixed="false">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="1" maxOccurs="1" ref="xlf:source"/>
|
||||
<xs:element minOccurs="0" maxOccurs="1" ref="xlf:target"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="notes">
|
||||
<xs:complexType mixed="false">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="1" maxOccurs="unbounded" ref="xlf:note"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="note">
|
||||
<xs:complexType mixed="true">
|
||||
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="appliesTo" use="optional" type="xlf:appliesTo"/>
|
||||
<xs:attribute name="category" use="optional"/>
|
||||
<xs:attribute name="priority" use="optional" type="xlf:priorityValue" default="1"/>
|
||||
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="originalData">
|
||||
<xs:complexType mixed="false">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="1" maxOccurs="unbounded" ref="xlf:data"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="data">
|
||||
<xs:complexType mixed="true">
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" ref="xlf:cp"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="dir" use="optional" type="xlf:dirValue" default="auto"/>
|
||||
<xs:attribute ref="xml:space" use="optional" fixed="preserve"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="source">
|
||||
<xs:complexType mixed="true">
|
||||
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:attribute ref="xml:lang" use="optional"/>
|
||||
<xs:attribute ref="xml:space" use="optional"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="target">
|
||||
<xs:complexType mixed="true">
|
||||
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:attribute ref="xml:lang" use="optional"/>
|
||||
<xs:attribute ref="xml:space" use="optional"/>
|
||||
<xs:attribute name="order" use="optional" type="xs:positiveInteger"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<!-- Inline Elements -->
|
||||
|
||||
<xs:element name="cp">
|
||||
<!-- Code Point -->
|
||||
<xs:complexType mixed="false">
|
||||
<xs:attribute name="hex" use="required" type="xs:hexBinary"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="ph">
|
||||
<!-- Placeholder -->
|
||||
<xs:complexType mixed="false">
|
||||
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="canReorder" use="optional" type="xlf:yesNoFirstNo" default="yes"/>
|
||||
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="disp" use="optional"/>
|
||||
<xs:attribute name="equiv" use="optional"/>
|
||||
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="dataRef" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="subFlows" use="optional" type="xs:NMTOKENS"/>
|
||||
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
|
||||
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
|
||||
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="pc">
|
||||
<!-- Paired Code -->
|
||||
<xs:complexType mixed="true">
|
||||
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="canOverlap" use="optional" type="xlf:yesNo"/>
|
||||
<xs:attribute name="canReorder" use="optional" type="xlf:yesNoFirstNo" default="yes"/>
|
||||
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="dispEnd" use="optional"/>
|
||||
<xs:attribute name="dispStart" use="optional"/>
|
||||
<xs:attribute name="equivEnd" use="optional"/>
|
||||
<xs:attribute name="equivStart" use="optional"/>
|
||||
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="dataRefEnd" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="dataRefStart" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="subFlowsEnd" use="optional" type="xs:NMTOKENS"/>
|
||||
<xs:attribute name="subFlowsStart" use="optional" type="xs:NMTOKENS"/>
|
||||
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
|
||||
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
|
||||
<xs:attribute name="dir" use="optional" type="xlf:dirValue"/>
|
||||
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="sc">
|
||||
<!-- Start Code -->
|
||||
<xs:complexType mixed="false">
|
||||
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="canOverlap" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="canReorder" use="optional" type="xlf:yesNoFirstNo" default="yes"/>
|
||||
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="dataRef" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="dir" use="optional" type="xlf:dirValue"/>
|
||||
<xs:attribute name="disp" use="optional"/>
|
||||
<xs:attribute name="equiv" use="optional"/>
|
||||
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="isolated" use="optional" type="xlf:yesNo" default="no"/>
|
||||
<xs:attribute name="subFlows" use="optional" type="xs:NMTOKENS"/>
|
||||
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
|
||||
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
|
||||
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="ec">
|
||||
<!-- End Code -->
|
||||
<xs:complexType mixed="false">
|
||||
<xs:attribute name="canCopy" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="canDelete" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="canOverlap" use="optional" type="xlf:yesNo" default="yes"/>
|
||||
<xs:attribute name="canReorder" use="optional" type="xlf:yesNoFirstNo" default="yes"/>
|
||||
<xs:attribute name="copyOf" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="dataRef" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="dir" use="optional" type="xlf:dirValue"/>
|
||||
<xs:attribute name="disp" use="optional"/>
|
||||
<xs:attribute name="equiv" use="optional"/>
|
||||
<xs:attribute name="id" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="isolated" use="optional" type="xlf:yesNo" default="no"/>
|
||||
<xs:attribute name="startRef" use="optional" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="subFlows" use="optional" type="xs:NMTOKENS"/>
|
||||
<xs:attribute name="subType" use="optional" type="xlf:userDefinedValue"/>
|
||||
<xs:attribute name="type" use="optional" type="xlf:attrType_type"/>
|
||||
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="mrk">
|
||||
<!-- Annotation Marker -->
|
||||
<xs:complexType mixed="true">
|
||||
<xs:group ref="xlf:inline" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="translate" use="optional" type="xlf:yesNo"/>
|
||||
<xs:attribute name="type" use="optional" type="xlf:attrType_typeForMrk"/>
|
||||
<xs:attribute name="ref" use="optional" type="xs:anyURI"/>
|
||||
<xs:attribute name="value" use="optional"/>
|
||||
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="sm">
|
||||
<!-- Start Annotation Marker -->
|
||||
<xs:complexType mixed="false">
|
||||
<xs:attribute name="id" use="required" type="xs:NMTOKEN"/>
|
||||
<xs:attribute name="translate" use="optional" type="xlf:yesNo"/>
|
||||
<xs:attribute name="type" use="optional" type="xlf:attrType_typeForMrk"/>
|
||||
<xs:attribute name="ref" use="optional" type="xs:anyURI"/>
|
||||
<xs:attribute name="value" use="optional"/>
|
||||
<xs:anyAttribute namespace="##other" processContents="lax"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name="em">
|
||||
<!-- End Annotation Marker -->
|
||||
<xs:complexType mixed="false">
|
||||
<xs:attribute name="startRef" use="required" type="xs:NMTOKEN"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
</xs:schema>
|
Reference in a new issue