← Back to team overview

mahara-contributors team mailing list archive

[Bug 1296407] Re: Multilinguality of Mahara artefacts

 

I was thinking about the same problem in Moodle/Totara and came up with
another approach that could be considered a hybrid between the two.

I have two ideas for how it could work:

1. Define first, use later

* Each user would have an area where they could define multilingual strings. Each string would require a unique key, then a set of language/text pairs, one for each language they choose to provide. One language would be marked as the default. For example a user might create a key 'aboutme' with translations in English and French.
* To use a multilingual string the user enters it into a text field anywhere on the site surrounded by a special delimiter. E.g. for example the delimiter might be %%% in which case a user would enter '%%%aboutme%%%' into a text box.
* A site-wide filter could detect the short delimiter wrapped keys and convert them into the viewing user's language if available, otherwise use the default.

2. Use first, define later

* The system defines a special delimiter to indicate something will be multilingual. Let's say '%%%' again.
* When users enter content in any text field they provide text in their language, but surround each phrase to be translated with those tags. For example:

Page title: %%%This is a page title in English because my language is
set to English%%%

* This is the tricky bit - something, perhaps in dml.lib needs to scan
for and detect new delimited strings. When found the contents between
the delimiters is hashed and new entries are made in two tables:

translation_keys
id   hash   usrid

translation_strings
id   translation_key_id   lang    value

In the second table lang would be the user who inserted the string and
value would be the contents between the delimiters.

* With those records in place it would be possible to display an area to the user containing template strings in their language that they have used and allow them to translate into other languages (which creates more records in translation_strings
* Finally a filter would detect any delimited strings, hash the contents, and do a lookup in the viewing user's language if available (falling back to the original string).

I think the second approach would be cleaner from a user point of view
but potentially harder to implement.

There are several parts of this idea that need further consideration
(performance for one) but thought I'd put it out there for discussion.

Simon

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1296407

Title:
  Multilinguality of Mahara artefacts

Status in Mahara ePortfolio:
  Confirmed

Bug description:
  Mahara supports different language packs for the web interface of the
  individual user account, but it isn’t possible to have portfolio pages
  in two languages at the same time (for example a presentation
  portfolio with a CV in German and one in English). To achieve this it
  would be necessary for artefacts to contain values in different
  languages.

  The main problem are not labels (which can be in different languages),
  but artefact values, which can not be in more than one language at a
  time.

  In the terms of multilinguality it would be also good if the user
  would have the option of selecting in which language the page should
  be displayed.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1296407/+subscriptions


References