osw3/symfony-locale-tools

There is no license information available for the latest version (0.0.8) of this package.

Installs: 56

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/osw3/symfony-locale-tools

0.0.8 2026-02-02 00:29 UTC

This package is auto-updated.

Last update: 2026-02-02 00:29:13 UTC


README

Install

composer require OSW3/symfony-locale-tool

Config

config/packages/translations.yaml

framework:
    enabled_locales: ['en', 'nl', 'fr', 'it', 'no']
    default_locale: en
    translator:
        default_path: '%kernel.project_dir%/translations'
        fallbacks:
            - en
            - fr
        providers:

config/routes.yaml

controllers:
    resource: routing.controllers
    prefix: '/{_locale}'
    requirements:
        _locale: 'en|nl|fr|it|no' 

config/services.yaml

services:
    OSW3\LocaleTools\EventSubscriber\LocaleNegotiationSubscriber:
        tags:
            - { name: 'kernel.event_subscriber' }

Services

$localeToolsService->getCurrent() // string
$localeToolsService->getDefault() // string
$localeToolsService->getAvailable() // array[code, name]

Twig

{{ locale_current() }}
{{ locale_default() }}
{{ locale_available() }}