Skip to content

Commit

Permalink
[Routing] use American English
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Mar 21, 2018
1 parent d4bfbb8 commit 2004092
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand All @@ -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" />
Expand All @@ -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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
10 changes: 5 additions & 5 deletions src/Symfony/Component/Routing/Tests/Loader/XmlFileLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ public function testLoadWithImport()
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');
Expand All @@ -109,7 +109,7 @@ public function testLocalisedImports()
$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');
Expand Down

0 comments on commit 2004092

Please sign in to comment.