2017 © Pedro PelĂĄez
 

library locale-extension

Locale Extensions for Twig

image

anezi/locale-extension

Locale Extensions for Twig

  • Sunday, June 3, 2018
  • by amouhzi
  • Repository
  • 1 Watchers
  • 2 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Locale Extensions for Twig

Installation

The extension is installable via composer:, (*1)

composer require anezi/locale-extension, (*2)

Symfony service

services:
    anezi_twig.locale_extension:
        class: Anezi\Locale\Twig\Extension\LocaleExtension
        public:    false
        arguments: ["%managed_locales%"]
        tags:
            - { name: twig.extension }

Functions

Get locales

{% for locale in locales() %}{{ locale }} - {% endfor %}, (*3)

shows:, (*4)

ar - en - fr -, (*5)

Filters

Get country name

{{ "be"|country_name }}, (*6)

shows:, (*7)

Belgium, (*8)

Get locale name

{{ "fr_BE"|locale_name }}, (*9)

shows:, (*10)

French (Belgium), (*11)

Get locale name in that locale

{{ "fr_BE"|origin_locale_name }}, (*12)

shows:, (*13)

français (Belgique), (*14)

Get locale short name

{{ "fr_BE"|locale_short_name }}, (*15)

shows:, (*16)

fr, (*17)

Get html direction

{{ "ar"|html_dir }}, (*18)

shows:, (*19)

rtl, (*20)

The Versions

03/06 2018

dev-master

9999999-dev

Locale Extensions for Twig

  Sources   Download

MIT

The Requires

 

twig extension locale twig-extension

03/06 2018

1.0.1

1.0.1.0

Locale Extensions for Twig

  Sources   Download

MIT

The Requires

 

twig extension locale twig-extension

29/03 2018

v1.0.0

1.0.0.0

Locale Extensions for Twig

  Sources   Download

MIT

The Requires