Skip to content
Open
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
45 changes: 45 additions & 0 deletions 8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Multi-regional and multilingual sites

#### Website

Create a new Symfony bundle for multi-regional and multilingual sites support.

**Requirements**

When a user visits an [international landing page, e.g. example.com](http://example.com/), the English version of the site is displayed without redirects to the localized domain. Links on the page that lead to the same domain shall stay intact and no locale slug shall be added (e.g. expected http://example.com/samples/demo.html, not the http://example.com/en/samples/demo.html, not the http://example.en/samples/demo.html).

However, when a user visits a [localized /fr/ landing page, e.g. example.com/fr](http://example.com/fr), the French version of the site (e.g. [website with localized domain, example.fr](http://example.fr/)) should display, and internal links (that lead to the same website) should modify to use the localized domain (e.g. expected http://example.fr/samples/demo.html).

Implement a CLI that conforms to the same rules.

#### Tools and techniques

Customize the Router and Translator components to develop a solution that satisfies the above requirements.

##### Router

Add an ability to use the implemented website URL tweaking rules through the CLI. For both WEB and CLI, all the links should be absolute and should contain a respective domain (matching the locale specified in the browser or command line input).

#### Translator

Store translations in the yml files named after the website name and locale:

* `Resources/translations/example.en.yml` for `http://example.com`;
* `Resources/translations/example.fr.yml` for `http://example.fr` and `http://example.com/fr`;

Domain and locale should be applied automatically for templates, translator usages and others.

#### Other Requirements

- SOLID
- PSR-2
- [Symfony Code Standards](http://symfony.com/doc/current/contributing/code/standards.html)
- All classes and methods should be documented with PHPdoc, containing not only the list of parameters and their types but also a short description of what the intended purpose of this method or class is.

#### Unit test

All classes and methods should be covered by unit tests.

#### Functional test

General flow should be covered with a functional test. **Please do not add controllers, use Router and Translator functionality.**