lekoala/silverstripe-multilingual

i18n tools for SilverStripe

Fund package maintenance!
lekoala

Installs: 70

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

2.0.0 2024-01-29 12:37 UTC

This package is auto-updated.

Last update: 2024-12-10 10:04:05 UTC


README

Build Status scrutinizer Code coverage

Intro

Provide some helper tools when working with Fluent and multilingual websites

LangHelper

The LangHelper class provide a consistent i18n function regardless of Fluent being installed or not.

You can call global translation under the "Global" entity. These are accessible with LangHelper::globalTranslation or g() shortcut.

FluentLocale only if cookies are enabled

This module disable by default persist_cookie for Fluent.

You need to make sure to call LangHelper::persistLocaleIfCookiesAreAllowed (works with two types of cookie consent modules) or call with your own logic LangHelper::persistLocale.

Improved text collector task

ConfigurableI18nTextCollectorTask

This improved text collector helps you to collect translation from specific modules.

It supports merge (even of older version of SilverStripe, that now does that as well), auto translating new string from google api, clear unused strings...

This is available from a convenient interface.

Translations import/export task

TranslationsImportExportTask

Collecting translations for customers is not always easy. In order to provide a simple mean to collect label, everything can be exported to a csv file. This will create as many columns as the number of .yml files in your lang folder.

It can then be imported back from the file to your yml files.

If you use lekoala/silverstripe-excel-import-export, this file can be exported in xlsx.

This is available from a convenient interface.

Todo

  • Make BuildTaskTools into a specific module

Compatibility

Tested with ^5

Maintainer

LeKoala - thomas@lekoala.be