8000 [Routing] use American English by xabbuh · Pull Request #26614 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] use American English #26614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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= 8000 "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 8000 ">/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