Edit this page

Localization

Localization in PyroCMS works exactly the same as localization in Laravel.

Localizing Time

Unfortunately the base class DateTime does not have any localization support. In order to display localized time please use Cabon::formatLocalized($format).

Matching Locales to Your Machine

By default the en code is transformed into en_EN for internal operations like setlocale(LC_TIME, $locale). However you may need to change this to something like en_US.UTF-8. There are a couple ways to change this default behavior:

  • Publish streams configuration and add 'locale' => 'en_US.UTF-8' to your locale code definition.
  • Add LOCALE_EN="en_US.UTF-8" to your .env file.

Overriding Language Files

You must publish the Streams Platform or the addon in order to override it's language files. After publishing them you can then simply modify the files as needed in `resources/{application}/*

Publishing streams language files

In order to configure the Streams Platform without modifying core files you will need to publish the Streams Platform with the following command:

php artisan streams:publish

You can then find the Streams Platform configuration files in resources/{application}/streams/lang.

Publishing addon language files

In order to configure addons without modifying core files you will need to publish the addon with the following command:

php artisan addon:publish vendor.type.slug

You can then find the addon configuration files in resources/{application}/{vendor}/{slug}-{type}/config.