Exception_Warning: Declaration of RedSparkFramework_RsModule_Cms_Controller_Asset_IncParsedHtmlFile::getFormArray() should be compatible with that of RedSparkCore_RsModule_Cms_Controller_Asset_ListExtended::getFormArray()

Translate

Text snippet translations in multilingual applications

The text that you see in RedSpark's user interface is in English by default, such as the "Log in" button and the "Add new comment" text. These texts however can be translated. A translation of RedSpark is the set of texts that are visible in the RedSpark screens in any other language, such as texts on buttons, menus, field captions and messages.

Translate

The Translate functionality in Redspark extends mainly the one from Zend. There are a few features added as described above.

Location Storage

The main extension is the storage of the locale data. In Redspark there is an extension, that untranslated entries are loged. In RedSparkCore untranslated entries are written into the database and can be translated inside the backend. The result of this translation will be stored in a temporary tmx file per module. An initial set of translations will be loaded automaticaly via a module-specific tmx file, too.

Locale specialty

In Redspark there is a strict distinguish between the Interface-Language and the Account-Language. If you want a text to have a text translated, you should therefore always be aware, where it should be displayed. A good starting point is to assume frontend content is in the Account-Language, while backend content is in the Interface-Language.
In short: If you want to translate frontend content, be sure to use second parameter to set to Redspark_Locale::ACCOUNT_LOCALE.

Interface Language

The first one is used mainly in the backend, comes from the browser locale and can be switched in the backend. This should be the language the user understands best.

Account Language

The Account-Language is the language, in which the content is delivered, for this account. Internaly it is saved with a fake-locale "Account_<aid>". The abstract account text (see "system" in interface language) is saved under the locale "Account"

Auto-detection

The auto-detection if the fronend/backend translate should be used, is based on ACL. It follows the rules

  1. IF role=World THEN use frontend translate
  2. IF role=Base/Guest and role Base/Admin THEN use backend translate
  3. IF role=Base/Admin and role not Base/Member THEN use backend translate
  4. ELSE use frontend translate
For more information see ACL documentation of RedSparkCore

Usage in PHP

<?php

    Broker
::getTranslate()->get("Modulname""Text");
    
Broker::getTranslate()->get("Modulname""Text"Redspark_Locale::ACCOUNT_LOCALE);
    
$this->_("This is my text");
    
$this->_("This is my text",Redspark_Locale::ACCOUNT_LOCALE);

?>

Usage in Smarty


    {"This is my text"❙translate:'MyModule'}

    {"This is my text"❙translate:'MyModule':'account'}

Tutorials

Die eigene App

Kuborgh GmbH

Hamburg 040 819 773 770 Köln 0221 276 66 96 info@kuborgh.de www.kuborgh.de

RedSpark Community

RedSpark Community

Community Website
RedSpark Apps

RedSpark Apps

Zur Übersicht
RedSpark Download

RedSpark Basispaket

Zum Download
Key facts