Download the PHP package bedita/i18n without Composer
On this page you can find all versions of the php package bedita/i18n. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package i18n
Short Description Internationalization plugin for BEdita & CakePHP
License LGPL-3.0-or-later
Informations about the package i18n
I18n plugin for BEdita & CakePHP
Installation
You can install this BEdita/CakePHP plugin using composer like this:
Setup
In order to use the plugin you have to load it in your Application::bootstrap() using
Middleware and Helper
First of all you need to setup an I18n configuration in your application config/bootstrap.php (or if you prefer in config/app_local.php)
I18nMiddleware
Adding BEdita/I18n plugin in app Application::bootstrap() method, the I18nMiddleware
will be added in middleware queue just before RoutingMiddleware.
I18n configuration will be used to setup middleware configuration.
You can also decide to not add I18nMiddleware since your app doesn't need it or to
programmatically add it in your application:
In this way the middleware just takes care of setup the right locale using the URI path and a configuration.
For example navigating to http://example.com/it/page/one the middleware setup locale to it_IT
using the above configuration example.
You can configure the middleware to redirect some urls to their i18n versions
All URI paths matching exactly something in 'match' key or starting with one entry in 'startWith'
will be redirect to the same URL but with the detected language as prefix, for example /it/help.
You can also configure the middleware to use a cookie to store the locale
I18nRoute
I18nRoute class can be used to simplify the way you write and match routing rules.
For example
maps to /:lang/pages and the language code defined in I18n.languages configuration will be used as route patterns on :lang param.
So the above rule is the same of
If the current language is it you can obtain the localized url as
I18nHelper
In order to use the helper you need to initialize it in your AppView::initialize() method
Gettext command
gettext command provides a method to update I18N locale files in BEdita apps and plugins.
A working msgmerge binary on your system is necessary. In most Linux systems this is provided via gettext package.
By simply typing
your code inside /src and /config is parsed and gettext strings are extracted looking for __('Some string') expressions.
Then:
resources/locales/default.potgettext master file is created or updated, same for optional domain files likemydomain.pot- all locale files like
resources/locales/{locale}/default.poand other optional domain files likemydomain.poare also created or updated - where{locale}is the usual locale expression likeen-US,de-DEorfr-FR.
Command options:
You may invoke this command on a different application or plugin path via --app or --plugin options.
All versions of i18n with dependencies
ext-intl Version *
cakephp/cakephp Version ^5.0
laminas/laminas-diactoros Version ^3.3
psr/http-message Version ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
