magento / magento/community-features

Internationalized routing for Base Router

Open
#46 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Priority: P3
Dominant language
No language data
Stars
46
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Last week, Symfony published a new component for realizing international routes.
http://symfony.com/blog/new-in-symfony-4-1-internationalized-routing

I would like to see this feature in the Magento Base Router.
This will offer us locale specific routes.

e.g.

  • default en_US: /contact
  • de_DE / de_AT / de_CH: /kontakt
  • it_IT: /contacto

This could be solved by adding new config elements to routes.xml.

My idea is to provide a general replacement for a frontName and explicit mapped rewrites for single actions.

Draft Example:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="catalog" frontName="catalog">
            <module name="Magento_Catalog" />

            <localizedFrontName>
                <prefix frontName="katalog" locale="de_DE" />
            </localizedPrefixes>
        </route>

        <localizedActionPreferences>
            <preference for="catalog/product/view" rewrite="katalog/produkt/anzeigen" locale="de_DE" />
            <preference for="catalog/category/view" rewrite="katalog/produkt/anzeigen" locale="de_DE" />
        </localizedActionPreferences>
    </router>
</config>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Magento Base Router and the routes.xml configuration schema, then compare the proposed locale-specific front names and action rewrites with the Symfony internationalized routing component referenced in the issue. Done should be defined as locale-specific routes for the shown examples, with configuration validation and coverage for the routing behavior.

Written by the indexing model from the issue text.

Assessment

Domain
backend, internationalization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.