2017 © Pedro PelĆ”ez
 

symfony-bundle i18n-routing-bundle

Internationalized routing with minimal performance cost.

image

umpirsky/i18n-routing-bundle

Internationalized routing with minimal performance cost.

  • Wednesday, December 13, 2017
  • by umpirsky
  • Repository
  • 2 Watchers
  • 4 Stars
  • 66 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

i18n routing bundle ā€¢ symfony upgrade fixer ā€¢ twig gettext extractor ā€¢ wisdom ā€¢ centipede ā€¢ permissions handler , (*1)

UmpirskyI18nRoutingBundle

Internationalized routing with minimal performance cost., (*2)

CI, (*3)

Idea

The idea is to create i18n route for each regular route in the project instead of creating separate route for each locale. On large projects with high number of routes and many locales supported this can lead to explosion of routes and performance issues. With more then 1000 routes and 30+ languages it can be a real problem. With this bundle and prefix strategy there is no performance cost. For prefix_except_default number of routes is doubled, but again, does not depend on number of languages., (*4)

Installation

composer require umpirsky/i18n-routing-bundle
<?php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        return [
            // ...
            new Umpirsky\I18nRoutingBundle\UmpirskyI18nRoutingBundle(),
        ];
    }
}

Configuration

umpirsky_i18n_routing:
    default_locale: en
    locales: [en, sr, ru]

Usage

Disabling i18n routing on route level

If you want route not to be localized, you can disable it using i18n option:, (*5)

foo:
    path: /foo
    options:
        i18n: false

Strategies

There are multiple routing strategies supported., (*6)

prefix

This will prefix all urls with given locales:, (*7)

/en/foo
/sr/foo
/ru/foo

Configuration:, (*8)

umpirsky_i18n_routing:
    default_locale: en
    locales: [en, sr, ru]
    strategy: prefix

prefix_except_default

This will prefix all urls with given locales except default:, (*9)

/foo
/sr/foo
/ru/foo

Configuration:, (*10)

umpirsky_i18n_routing:
    default_locale: en
    locales: [en, sr, ru]
    strategy: prefix_except_default

Example

There is example integration with Symfony Standard Edition., (*11)

Inspiration

This bundle is inspired by JMSI18nRoutingBundle and BeSimpleI18nRoutingBundle, but sacrifices the url translation feature for the sake of performance., (*12)

The Versions

13/12 2017

dev-master

9999999-dev

Internationalized routing with minimal performance cost.

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony translation routing i18n internationalisation

13/12 2017

0.0.3

0.0.3.0

Internationalized routing with minimal performance cost.

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony translation routing i18n internationalisation

13/11 2017

0.0.2

0.0.2.0

Internationalized routing with minimal performance cost.

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony translation routing i18n internationalisation

10/06 2017

0.0.1

0.0.1.0

Internationalized routing with minimal performance cost.

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony translation routing i18n internationalisation

14/05 2017

dev-issue-1

dev-issue-1

Internationalized routing with minimal performance cost.

  Sources   Download

MIT

The Requires

 

The Development Requires

symfony translation routing i18n internationalisation