Project

General

Profile

Actions

Feature proposal #4528

closed

New Language / Localization architecture

Added by nant over 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
26 June 2014
Due date:
% Done:

100%

Estimated time:

Description

Introduction

With Community Builder 2.0 the language support mechanism is being redesigned to move away from the legacy DEFINE statements that existed in the language.php files of CB Language plugins.

New Default Language File Structure

The default language files in CB 2.0 are located in: {Joomla_root}/components/com_comprofiler/plugin/language/default_language

This folder contains the following:

  1. language.php (frontend default language definitions in PHP array format)
  2. admin_language.php (administrator area language definitions in PHP array format)
  3. default_language.xml (?)
  4. index.html (?)
  5. images folder (?)

Confirmation Question:
Has the Javascipt calendar-locals.js file been migrated?

The language.php and admin_language.php files also contain all strings for all CB related add-ons that are installed with CB 2.0.

Question:
What about language strings for the modules (login, online, workflow) and the new Admin Navigation module and the redirect plugin?

Question/Issue:
We need to decide how these CB interacting Joomla extensions are translated and how we manage the translation projects?
It looks like we will be dealing with a mix of ini files and php files. Transifex can handle different resource types in the same project, so in theory we could have a single CB Language plugin that also has ini files in it and during installation these can be moved/copied to the proper Joomla language folders.

New CB Language Plugin Concept

Extra language support for CB will be handled with the installation of CB Language plugins via the CB Plugin Installer.

New CB Language Plugin structure

The contents of a CB Language plugin package are:

  1. language.xml
  2. language.php
  3. admin_language.php
  4. index.html

The language.xml contents

The structure of the language.xml file conforms to the following sample:

<languages folder="language/default_language">
<language tag="default_language">language.php</language>
<language tag="default_language">admin_language.php</language>
</languages>

The language.php and admin_language.php files

This is an array based php file that contains language translations in the format:

return array(
'KEY_1' => 'Translation for this string',
...
);

Extra CB add-ons and their language support

A CB Plugin should contain its own default_language folder with its language.php and admin_language.php files.
This default_language folder (and also other language folders that may be included in the initial add-on distribution) should be located in the following folder:

plugin/user/plug_name/language/

When installing a CB add-on the default_language contents supporting this plugin are copied to the following folder:

plugin/language/default_language/plug_name/

Question/issue:
Some CB add-ons (see CBSubs and GroupJive and CB Activity) have Joomla modules so in theory they need ini files. How should we support such a case?

Overall Picture

Lets assume that we have CB 2.0 installed and we have also installed its en-gb language plugin.
In addition lets assume that we have installed the new CB GroupJive add-on (plug_cbgroupjive) that includes its own default_language and en-gb language support in its distribution package.

The following folder/file structure should be in place:

Community Builder installed languages
compnents/com_comprofiler/language/default_language/
compnents/com_comprofiler/language/en-gb/

Community Builder default_language structure with installed plug_cbgroupjive support
compnents/com_comprofiler/language/default_language/plug_cbgroupjive/language.php
compnents/com_comprofiler/language/default_language/plug_cbgroupjive/admin_language.php
compnents/com_comprofiler/language/default_language/plug_cbgroupjive/index.html
compnents/com_comprofiler/language/default_language/language.php
compnents/com_comprofiler/language/default_language/admin_language.php
compnents/com_comprofiler/language/default_language/language.xml
compnents/com_comprofiler/language/default_language/index.html

Default language support for plug_cbgroupjive
compnents/com_comprofiler/language/default_language/plug_cbgroupjive/language.php
compnents/com_comprofiler/language/default_language/plug_cbgroupjive/admin_language.php
compnents/com_comprofiler/language/default_language/plug_cbgroupjive/index.html

Community Builder English language support (after installation of CB English language pack and Groupjive add-on)
compnents/com_comprofiler/language/en-gb/plug_cbgroupjive/language.php
compnents/com_comprofiler/language/en-gb/plug_cbgroupjive/admin_language.php
compnents/com_comprofiler/language/en-gb/plug_cbgroupjive/index.html
compnents/com_comprofiler/language/en-gb/language.php
compnents/com_comprofiler/language/en-gb/admin_language.php
compnents/com_comprofiler/language/en-gb/language.xml
compnents/com_comprofiler/language/en-gb/index.html

English language support for Groupjive in CB english flder structure
compnents/com_comprofiler/language/en-gb/plug_cbgroupjive/language.php
compnents/com_comprofiler/language/en-gb/plug_cbgroupjive/admin_language.php
compnents/com_comprofiler/language/en-gb/plug_cbgroupjive/index.html

Groupjive language local plugin structure
components/com_comprofiler/plugin/user/plug_cbgroupjive/language/default_language/
components/com_comprofiler/plugin/user/plug_cbgroupjive/language/en-gb/

GroupJive local plugin default_language structure
components/com_comprofiler/plugin/user/plug_cbgroupjive/language/default_language/language.php
components/com_comprofiler/plugin/user/plug_cbgroupjive/language/default_language/admin_language.php
components/com_comprofiler/plugin/user/plug_cbgroupjive/language/default_language/index.html

GroupJive local plugin en-gn language structure
components/com_comprofiler/plugin/user/plug_cbgroupjive/language/en-gb/language.php
components/com_comprofiler/plugin/user/plug_cbgroupjive/language/en-gb/admin_language.php
components/com_comprofiler/plugin/user/plug_cbgroupjive/language/en-gb/index.html

Transifex Related

On Transifex we currently have 3 projects for our translations:

  1. Community Builder
  2. GroupJive
  3. CBSubs

We do not have any projects for other add-ons.

The Community Builder project currently has the cbteamplugins_language.php resource which will be depreciated (as I understand it) and instead we will create additional Transifex projects for each of out non-core plugins.

These Transifex plugins will feed and area in our gitlabs (and maybe a mirror area on github?) that will serve as a repository that will be used to automatically generate (daily build?) a single (?) CB Team add-ons plugin package for each language that will contain translations for all our extra add-ons.

Question/Issue:
The xml file of this single package needs to be defined.

Question/Issue:
Should we also have a single multi-language plugin creation process? Example: create a CB All-Languages plugin that grabs translations from all Language teams for the CB project and creates a single installable plugin that will support all languages (not even sure how this would be handled - just bringing it up for discussion).

Actions #1

Updated by nant over 10 years ago

  • Description updated (diff)
Actions #2

Updated by nant over 10 years ago

  • Description updated (diff)
Actions #3

Updated by nant over 10 years ago

  • Description updated (diff)
Actions #4

Updated by krileon over 10 years ago

  • Description updated (diff)
Actions #5

Updated by krileon over 10 years ago

  • Description updated (diff)
Actions #6

Updated by krileon over 10 years ago

  • Description updated (diff)
Actions #7

Updated by krileon over 10 years ago

  • Description updated (diff)
Actions #8

Updated by krileon over 10 years ago

Has the Javascipt calendar-locals.js file been migrated?

It's deleted, or can be deleted if not deleted, our calendar usage is 100% replaced now with a better solution which has CBTxt values sent to it.

What about language strings for the modules (login, online, workflow) and the new Admin Navigation module and the redirect plugin?

They're all CBTxt. All frontend module strings should go in language.php and all backend module strings should go in admin_language.php.

We need to decide how these CB interacting Joomla extensions are translated and how we manage the translation projects?

Anything CB related should already be loading and using CB API. In that case it should also use CBTxt and be translated by CB it self. Alternative is the module uses Joomla API and includes its own INI files, but that's not recommended. If a module belongs to a plugin (99% of the cases) then the plugin should also include the language strings for the module.

Some CB add-ons (see CBSubs and GroupJive and CB Activity) have Joomla modules so in theory they need ini files. How should we support such a case?

If a plugin ha a module then the module should be using CBTxt and have its language strings in the plugins language.php.

The xml file of this single package needs to be defined.

The basic structure of each language plugin will be pre-defined or generated as needed when the language files are pulled from transifex. It's not a single package for ALL languages, but a single package per language. So we'd have an English one, French one, German one, etc..

Should we also have a single multi-language plugin creation process? Example: create a CB All-Languages plugin that grabs translations from all Language teams for the CB project and creates a single installable plugin that will support all languages (not even sure how this would be handled - just bringing it up for discussion).

The user can do this at the Package Builder level by selecting multiple languages.

Actions #9

Updated by beat over 10 years ago

Nick, Thanks for writing down and Kyle, Thanks for the answers.

Here some additional answers:

1. index.html is there and can be kept.
­2. We could/should rename default_language.xml to language.xml
3. plugin/user/plug_name/language/ should probably be plugin/user/plug_name/language/default_language/language.php and admin_language.php

Actions #10

Updated by beat about 10 years ago

  • Tracker changed from Design to Feature proposal
  • Project changed from 139 to CB
  • Status changed from New to Closed
  • Assignee set to beat
  • Target version set to CB 2.0.0
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF