Exploring the use of lang packs and multilang for bandwidth adaptivity

Exploring the use of lang packs and multilang for bandwidth adaptivity

by Roel Cantada -
Number of replies: 9
Hi fellow Moodlers,

I am exploring the use of lang packs and the multilang filter to allow users to select a resource based on their bandwidth (Instead of the system selecting it for them).

The process involves creating three lang packs, namely lo_band, mid_band, and hi_band. Then using the multilang filter, so that the user can just select one of these lang packs for their Low, mid or high bandwidth environment.

Each pack will only have the moodle.php in it with the following strings:

$string['thislanguage'] = 'Low Bandwidth';
$string['thischarset'] = 'UTF-8';
$string['locale'] = 'en.UTF-8';
$string['parentlanguage'] = 'en_utf8';

I created an en_utf8_local first and tried to rename that in the moodledata/lang folder but it seems that Moodle no longer scans the lang folder. The moodledata/lang/lo_band language does not appear in the dropdown boxes for selecting the language. Even when I turned off language caching.

I tested this in local installation of moodle in an Ubuntu 8.10 pc. The version installation is Moodle 1.9.4+ (Build: 20090204).

I know I should be creating a filter for this purpose but I don't have enough programming skills for such. Can anyone please help me find out why lo_band will not appear in the language dropdown box?

TIA,

Roel

Average of ratings: -
In reply to Roel Cantada

Re: Exploring the use of lang packs and multilang for bandwidth adaptivity

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Cool way to avoid writing a new filter! smile

Not sure about your problem, but try adding _utf8 to your new lang folder names, and make sure you don't have a 'langlist' defined in the admin menus.
In reply to Martin Dougiamas

Re: Exploring the use of lang packs and multilang for bandwidth adaptivity

by Roel Cantada -
Thanks Martin, I'll try that smile.
In reply to Martin Dougiamas

Solved: Exploring the use of lang packs and multilang for bandwidth adaptivity

by Roel Cantada -
I forgot to include language.php in lo_band folder. It's because it did not show up in the lang strings drop-down list to be edited and there seemed to be redundant strings in moodle.php like "thislanguage".

With language.php included, the language shows up in the list of languages.
In reply to Roel Cantada

Re: Solved: Exploring the use of lang packs and multilang for bandwidth adaptivity

by Jeff Forssell -
Sounds like an interesting idea. Hope you will keep us posted about how it works.
In reply to Jeff Forssell

Re: Blog Report: Exploring the use of lang packs and multilang for bandwidth adaptivity

by Roel Cantada -
Hi Jeff,

Here is my blog report on a test of this hack: http://paaralan.blogspot.com/2009/08/hack-bandwidth-adaptivity-for-moodle.html

If any moodler has any suggestion to improve it, I would really appreciate it.

Roel
Average of ratings: Useful (1)
In reply to Roel Cantada

Re: Blog Report: Exploring the use of lang packs and multilang for bandwidth adaptivity

by Jeff Forssell -
Nice work! Wish I have the opportunity to try it out now.

At any rate I have put in a link to your invitingly clear blogpost in the Moodle Docs for the multilang filter: http://docs.moodle.org/en/Multi_language_content#Tips_and_tricks

One thought I had: There is a [Lang[V]] dropdown in the HTML editor (at least in later Moodle versions) which can be used for marking up multilang content. Unfortunately that isn't documented in the docs yet. Is there a way to get your tags into that list? (Maybe they turn up automatically, though I doubt it.) I expect that there can be a problem with "long" langs like loband when the others are two letter abbreviations, like en, maybe it would be good to have some 2 character abbreviations like: b1 b2 b3 that wouldn't conflict with other languages. (I don't even know it you hack can coexist with other languages, but that would perhaps make a future multilang/bandwidth filter more easily backwards compatible.)

In reply to Jeff Forssell

Re: Blog Report: Exploring the use of lang packs and multilang for bandwidth adaptivity

by Roel Cantada -
Thanks Jeff.

With regards to the lang dropdown in html, I never paid attention to it before. And I've been hand coding all all this time. I thought that list changed the html editor interface smile. They would probably turn up automatically because as I type this I see Multi and pt-br in the list. I'll check it out in my local pc installation of Moodle 2.0 and 1.9 and report back to the forum.

In order for the hack to work with other languages, it will require something like loband-tl for tagalog. That would be a separate lang pack. This hack is useful only if a moodle site has one parent language. If the parent language is french then the language.php and moodle.php settings would have to be changed (i.e. just copy from the french lang pack). I don't think it would be a good idea to write a php code to change the lang strings themselves. Perhaps for multilanguage sites a real filter is the best way to go.

But when I think about it, who would have the time and resources to create 3 version for more than 3 languages? Perhaps an auto translator will be needed with natural language processing capability to automate such a task.

Roel


In reply to Jeff Forssell

How can I add a new language in the html editor lang dropdown box?

by Roel Cantada -
The html editor (htmlarea in moodle 1.9+) lang dropdown box appears to read /moodle/lib/languages.php rather than scanning what languages are installed in the system.

I tried to add loband => "Low Bandwidth"; to the languages.php list but it resulted in the html editor disappearing in favor of the text editor. So its not as simple as that.

Perhaps the developers who integrated the html editor can inform us how to add a language in that list. Or better yet, make the Lang dropdown box's data scan the installed languages in the system rather than relying on a static list.

I wonder where I should suggest this?
In reply to Roel Cantada

Re: How can I add a new language in the html editor lang dropdown box?

by Jeff Forssell -
It looks to me like the dropdown is intended for 2 char abbreviations (looks like 5 chars might fit). I haven't looked at the code at all.

Assuming you don't need Afar, Abkhazian or Avestan (I don't even know where they are spoken smile ) :
What happens if you add
aa=>"low bandwidth"
ab=>"medium bandwidth"
ae=>"the high road"
?

When scrolling down to Swedish, I think I have often felt it was easier to chose "aa" and change it by hand. (It is also possible to hit [S] 4 times until "se" is marked.) So I would also vote for a simple way to only include the langs being used.