Multilanguage content

Multilanguage content

by Shin Okada -
Number of replies: 8
I followed the moodle doc http://docs.moodle.org/en/Multi_language_content
but none of examples work with my moodle site.

I turned on Filter all strings filterall under Administration Appearance Filter setting.
And also I turned on Multilanguage content under Administration Modules Filters.
I am using Moodle 1.8.

One of example is that
<span lang="en" class="multilang">Growth is often a major concern in planning society.
 How can one avoid superficial conclusions? <br>
(Exists in Swedish too. Finns på svenska också)</span>
 <span lang="sv" class="multilang">Tillväxt är ofta använt i samhällsdebatten.
Hur kan man undvika ytliga slutsatser?
 (Finns på engelska också. Exists in English too.)
<br /></span> 
Then what I get is ..

Growth is often a major concern in planning society. How can one avoid superficial conclusions?
(Exists in Swedish too. Finns på svenska också)satser? (Finns på engelska också. Exists in English too.)

And the next example wrote ...

"If you wish to translate a word or phrase in an English text to another language:

If I want to include an explanation <span lang="en"> </span>
 <span lang="sv" class="multilang">(sv: förklaring)</span> in a running text can I do it?
<br />
<br /><span lang="en" class="multilang>If I want to include an explanation in a running text
 can I do it? </span>
<span lang="sv" class="multilang>If I want to include an explanation (sv: förklaring) in a
running text can I do it?</span>
"
Then I get ...

If I want to include an explanation (sv: förklaring) in a running text can I do it?
Last modified: Saturday, 29 September 2007, 09:09 PM

-----


Average of ratings: -
In reply to Shin Okada

Re: Multilanguage content

by Jeff Forssell -
I wrote a goodly portion of that Moodle Docs after struggling quite a bit with this interesting feature. (Which explains why the alternative lang is Swedish!).

I still haven't gotten around to upgrading my site from 1.7 to 1.8 so I can't guarantee that everything will work properly there, but I think it will because the change in the span markup had already been made.

If you have copied and pasted directly from the wiki, there might be some wiki markup that followed along that might be sabotaging things. You should click and the source button [<>] in the HTML editor on the page and see if there might be some extra (wiki) tags that followed along.

Someone has added these notes in the wiki:

+ * Extra characters between language span tags - editor might add <nowiki><br /></nowiki> or other tags, please review the html in source view
  + * Extra spaces in language span tag

Here is a direct link to a page that I have that is changeable between Swedish and English:
http://www.tupo.biz/moodle1.6/mod/resource/view.php?id=2

Hope that helps. Otherwise get back here.

In reply to Jeff Forssell

Re: Multilanguage content

by Shin Okada -
Thanks Jeff.

I am a newbie and did not realize that I need to put a language box at the top right which I found it after I saw your link.

I need to learn a bit more about this. How can I put that language box at the top?
In reply to Shin Okada

Re: Multilanguage content

by Jeff Forssell -
I'm "shooting from the hip" just now, but here goes:

To be able to choose different languages, you must have installed the language packs for Moodle itself. This is quite easily done from the SITE administration interface. Language > Language packs > Install selected language. So in order to see my example work you would need to download the Swedish language pack. I believe there is some 70 languages. (Unfortunately not Swahili). (It is also possible to create a new language pack and make that choose-able.)

You would have to Check the Display Lang Menu: Below I've copied part of the interface (from Moodle 1.7):

Language settings

Default language lang [Svenska (sv)}
Choose a default language for the whole site. Users can override this setting later.
Display language menu [_]
In reply to Jeff Forssell

Re: Multilanguage content

by Shin Okada -
Thanks again, Jeff.

Yes, I put at least 8 languages and I was able to change in different languages for the Moodle Themes. But what I am trying to do is that I want to create multilanguage content in a text page or HTML page. Can I do it?
In reply to Shin Okada

Re: Multilanguage content

by Jeff Forssell -
You can't do it in a "text" page, because you can't include HTML tags there.

But in a HTML page that you import to Moodle or make with the Moodle HTML editor you can. I think I have even seen a special button in a later version (1.8? 1.9?) in the html editor for inserting those tags. Otherwise you must insert them manually in HTML mode in the editor.

I make a string with the languages I'll be using like:

<span lang="en" class="multilang">EEE English eee</span> <span lang="sv" class="multilang">SSS Swedish sss</span>

than I go into a new HTML page, go to html-source (with [<>] ) and past that in. Then I go back to ordinary edit mode, it then looks like:

EEE English eeeSSS Swedish sss

And replace the word English with all the English stuff and the word Swedish with all the Swedish content. Then I carefully remove the EEE eee SSS and sss. Don't delete eeeSSS as one block, it might possibly disturb the tags there. But you can also put in the tags after writing your different language blocks.
In reply to Jeff Forssell

Re: Multilanguage content

by Shin Okada -
After doing this I am not able to find any language box at the top right, so that I can change to Swedish or English etc. I can find the multilanguage box in the home page but not other pages.

How can I show it?
In reply to Shin Okada

Re: Multilanguage content

by Jeff Forssell -
I have also looked in vain for that possibility. I suppose that for the students it may be of minor interest, with the exception of IF they come with a link directly to the course (so they don't see the site homepage). I also just remembered that I have updated one of my sites from 1.7 to 1.8 and checked there, but no difference.

All registered user can choose their preferred language in their profile and then the courses will adjust (when possible).

I just tried looking in the Bug tracker "CHOOSE AND LANGUAGE" to see if there is any feature request, but didn't see any.

So I have created improvement request containing this description:

A user can choose the language on a Moodle Site Homepage and in his profile.

There are situations where this is less than ideal:
1) If a student comes directly to a course or resource with a link (so he never sees the site homepage)
2) When checking multilingual content (especially for the person editing the course/page)
3) When working in another language and wanting to easily change to English to see if the strings/documentation is correctly translated or equally complete

I would like there to be choices at the _course_ administration level to

Display language choice menu [_] on course start page, [_] on all (possible) pages in the course.
Languages on language menu (langlist) [_______________________________________]

I would even like this possible even if the language choice menu was not chosen as display at the homepage administration level. There could be situations where it could be good to have different general and specific settings.

If anyone would like to vote or comment on this "bug" see:
http://tracker.moodle.org/browse/MDL-11531

Or if I'm "knocking down open doors", please tell us how to do it!
In reply to Jeff Forssell

Re: Multilanguage content

by Jeff Forssell -

Just some added notes:

I have written in the DOCs about multilang how one can quickly change the language displayed by adding &lang=sv (for Swedish) to the end of the URL in the location bar (and pressing <enter> or [Go])

In the newer HTML editor I don't see anything for putting in the multilang tags.