[Routing] use American English

This commit is contained in:
Christian Flothmann 2018-03-21 10:10:50 +01:00
parent d4bfbb8152
commit 2004092dae
3 changed files with 10 additions and 10 deletions

View File

@ -24,7 +24,7 @@
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="localised-path">
<xsd:complexType name="localized-path">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="locale" type="xsd:string" use="required" />
@ -44,7 +44,7 @@
<xsd:complexType name="route">
<xsd:sequence>
<xsd:group ref="configs" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="path" type="localised-path" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="path" type="localized-path" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="path" type="xsd:string" />
@ -57,7 +57,7 @@
<xsd:complexType name="import">
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
<xsd:group ref="configs" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="prefix" type="localised-path" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="prefix" type="localized-path" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
<xsd:attribute name="resource" type="xsd:string" use="required" />
<xsd:attribute name="type" type="xsd:string" />

View File

@ -4,10 +4,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="localised">
<route id="localized">
<default key="_controller">MyBundle:Blog:show</default>
<path locale="en">/path</path>
<path locale="fr">/route</path>
</route>
</routes>
</routes>

View File

@ -86,17 +86,17 @@ class XmlFileLoaderTest extends TestCase
public function testLoadLocalized()
{
$loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures')));
$routeCollection = $loader->load('localised.xml');
$routeCollection = $loader->load('localized.xml');
$routes = $routeCollection->all();
$this->assertCount(2, $routes, 'Two routes are loaded');
$this->assertContainsOnly('Symfony\Component\Routing\Route', $routes);
$this->assertEquals('/route', $routeCollection->get('localised.fr')->getPath());
$this->assertEquals('/path', $routeCollection->get('localised.en')->getPath());
$this->assertEquals('/route', $routeCollection->get('localized.fr')->getPath());
$this->assertEquals('/path', $routeCollection->get('localized.en')->getPath());
}
public function testLocalisedImports()
public function testLocalizedImports()
{
$loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/localized')));
$routeCollection = $loader->load('importer-with-locale.xml');
@ -109,7 +109,7 @@ class XmlFileLoaderTest extends TestCase
$this->assertEquals('/the-prefix/suffix', $routeCollection->get('imported.en')->getPath());
}
public function testLocalisedImportsOfNotLocalizedRoutes()
public function testLocalizedImportsOfNotLocalizedRoutes()
{
$loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/localized')));
$routeCollection = $loader->load('importer-with-locale-imports-non-localized-route.xml');