Download the PHP package preflow/i18n without Composer
On this page you can find all versions of the php package preflow/i18n. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Vendor preflow
Package i18n
Short Description Preflow i18n — translations, locale detection, pluralization
License MIT
Package i18n
Short Description Preflow i18n — translations, locale detection, pluralization
License MIT
Please rate this library. Is it a good library?
Informations about the package i18n
Preflow I18n
Translations, locale detection, and pluralization for Preflow applications.
Installation
What it does
- Loads PHP translation files from
lang/{locale}/{group}.php - Resolves dot-notation keys with
:paramreplacement and locale fallback - ICU-style pluralization with exact, range, and simple two-form rules
- PSR-15 middleware for locale detection (URL prefix → cookie → Accept-Language)
- Twig functions for global and component-scoped translations
Configuration
config/i18n.php:
Translation files
lang/en/blog.php:
API
Translator
PluralResolver
Supports three formats:
LocaleMiddleware
PSR-15 middleware. Detects locale in priority order: URL prefix → cookie → Accept-Language header → configured default. Strips the locale prefix from the request path and sets a locale cookie on the response.
TranslationExtension (Twig)
Register with your Twig environment:
tc() converts the component name from PascalCase to kebab-case and uses it as the translation group.
All versions of i18n with dependencies
PHP Build Version
Package Version
The package preflow/i18n contains the following files
Loading the files please wait ...