multi-language in profile

multi-language in profile

by Ulrike Albers -
Number of replies: 15

Hallo,

I will post here again a post which I put in "filters" http://moodle.org/mod/forum/discuss.php?d=143788 - but maybe it was in the wrong section. Dear moderators please eliminate the one in the wrong place.

I have the following problem: using multi-span, profiles get dammaged:

Since the beginning, I had added too fields to the users' profile. Today, I edited these in order to translate them, to see why the one that should be "required field" was optional, and to add that one to the sign up form.

So as I use multi-language span, I put the names like this for the fields:

<span class="multilang" lang="fr">Autres langues</span><span class="multilang" lang="en">Other languages</span><span class="multilang" lang="de">Andere Sprachen</span><span class="multilang" lang="es">Otros idiomas</span>

and I choosed, for the first one (required), to figure in the sign up form.

Now user's profiles show only image (and description if there is one) and the code above when they indicate something in the fields, but are shown normally when there's nothing in the fields; when I eliminate the spans, everything is working again. 

Here is what I see in admin>users > accounts >users' profile fields

Thank you for any help

Ulrike


champs_profil.jpg
Average of ratings: -
In reply to Ulrike Albers

Re: multi-language in profile

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Ulrike,

This seems like a bug. I just created a ticket here: MDL-21845. Please vote for its resolution!

Nicolas

Average of ratings: Useful (1)
In reply to Nicolas Martignoni

Re: multi-language in profile

by Ulrike Albers -

Hallo,

Thank you a lot, Nicolas !

Sorry I'm coming back so late. I went to your page (first time I was going to vote) but if I understand, it has been already fixed. Please tell me if I'm wrong !

Thanks again for everything !

Ulrike

In reply to Ulrike Albers

Re: multi-language in profile

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

You're right, the problem was corrected, but the patch is not yet in the code. I'll be merged soon, I hope. I'm sure David will inform us about it.

Cheers!

Nicolas

In reply to Ulrike Albers

Re: multi-language in profile

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Ulrike,

make sure you have enabled Site Administration > Modules > Filters > Manage filters > Filter all strings.
Average of ratings: Useful (1)
In reply to David Mudrák

Re: multi-language in profile

by Geraldi Catur Pamuji -
i use <span lang="en" class="multilang"></span>

Not <span class="multilang" lang="en"></span>

It's working... i don't know why?? Maybe it has to do something with the source code?
In reply to Geraldi Catur Pamuji

Re: multi-language in profile

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Well, it's working because it is expected to do so... Both the lines of your code above are actually identical - in HTML, the order of the attributes does not matter.
Average of ratings: Useful (1)
In reply to David Mudrák

Re: multi-language in profile

by Antonello Lobianco -

hello, just to be precise for me :

<span class="multilang" lang="en">Example</span> ==> WORKS

<span lang="en" class="multilang">Example</span> ==> DOESN'T WORK

(Moodle 2.1.2+ - build 20111102)

 

In reply to Antonello Lobianco

Re: multi-language in profile

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Sorry, I can't reproduce this error. I just tried on 2.1.4+ and both forms work. I also checked the source code for the filter and both forms are expected to work. There was no change in this part of the multilang filter since 2.1.0 so I really can't understand why the second form does not work for you...
In reply to David Mudrák

Re: multi-language in profile

by Ulrike Albers -

Hallo,

Yes I have. I went to Nicolas' page and saw you all have been fixing it - thank you very much !

Ulrike

In reply to Ulrike Albers

Re: multi-language in profile

by Christian Pfisterer -
Hello again,

For some reason I still get this error! I've installed moodle just 2 weeks ago!

Here is what I see when I check my profile:
profile

it works fine as soon as I edit my profile!? What am I doing wrong?

desktop2.png

I checked "Filter all strings" and it works perfect everywhere except in the profile summary
In reply to Ulrike Albers

Re: multi-language in profile

by Ulrike Albers -

Hallo,

I upgradet (1.9.9) but the problem's still the same for me too....

Ulrike

In reply to Ulrike Albers

Re: multi-language in profile

by Lucas Sá -
I posted a solution for this issue of User Profile View in ticket MDL-21845. Even though the previous solution fixed the bug of viewing on administration, it did not on profile view.


In reply to Lucas Sá

Re: multi-language in profile

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Ah, sorry. I missed the actual user profile form. I just fixed it in CVS. It will be available in the next weekly build.

Note for Lucas: I replaced s() with format_string(). The s() in your patch is redundant. But you spotted the place correctly - well done!