Issue Details (XML | Word | Printable)

Key: CONTRIB-624
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Anthony Borrow
Reporter: Jesus Martin
Votes: 0
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Non-core contributed modules

UTF-8 lang code for MRBS Block

Created: 31/Jul/08 09:29 PM   Updated: 03/Aug/08 04:38 AM
Return to search
Component/s: Block: Mrbs
Affects Version/s: 2.0
Fix Version/s: None

File Attachments: 1. File CONTRIB-624.diff (79 kB)
2. Text File lang.es.php (11 kB)

Issue Links:
Dependency
 

Participants: Anthony Borrow, Jesus Martin and Stephen Bourget
Security Level: None
QA Assignee: Stephen Bourget
Resolved date: 03/Aug/08
Affected Branches: MOODLE_20_STABLE


 Description  « Hide
Review MRBS Block lang code in order to adecuate it to utf-8 codification.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Anthony Borrow added a comment - 31/Jul/08 09:38 PM
Why is this a security issue? I did not realize that the character encoding could cause a security problem. Could you say more? Peace - Anthony

Anthony Borrow added a comment - 31/Jul/08 10:07 PM
Actually - I am having trouble getting it to show me anything in Spanish. Can you tell me how you changed the MRBS language to Spanish. Peace - Anthony

p.s. - Did you try simply changing the encoding type in the lang.es.php file to utf-8? The files on the CVS server should already be encoded as utf-8 (if you think otherwise let me know)


Jesus Martin added a comment - 31/Jul/08 10:07 PM
You are right. It was a mistake. It's the first time I send a issue...
Thanks

Anthony Borrow added a comment - 31/Jul/08 10:08 PM
Ideally, I would for the MRBS block to use the language of the user's preference. So let's work toward that and also ensure that they are utf-8 encoded.

Anthony Borrow added a comment - 31/Jul/08 10:30 PM
OK, I will change it so that it is not listed as a security issue. Peace - Anthony

Jesus Martin added a comment - 01/Aug/08 12:00 AM
An updated Spanish translation (UTF-8 code)
I change the default language from config.inc.php:

$default_language_tokens = "es";

See you.


Anthony Borrow added a comment - 01/Aug/08 01:50 AM
Jesús - Gracias, ya habia cambiado $default_language_tokens pero no me dio el resultado hasta que también utilizé del variable $disable_automatic_language_changing = 1; ahora lo tengo en español.

translation - thanks, I had already changed $default_langauge_token but it was not giving the desired results until I set $disable_automatic_language_changing = 1; now I have it in Spanish.


Anthony Borrow added a comment - 01/Aug/08 06:00 AM
As a first step toward shoring up the MRBS code and bringing it up to Moodle standards, I went ahead and switched all MRBS get_vocab language string calls to Moodle get_string calls. I merged the MRBS lang.xx.php file into /blocks/mrbs/lang/xx_utf8/block_mrbs.php. There are a great number of strings in block_mrbs that could be removed (for example, YES, NO, etcc); however, for the sake of simplicity I did not remove those and change them to simple get_string calls from the main moodle.php file. As a result of this, the only languages officially supported now are English, Spanish, and German. If others want to provide a translation they are welcome and can be posted here. I will use this tracker issue as a sort of meta-issue for language related issue with the MRBS block. Please test and report problems here. Peace - Anthony

Anthony Borrow added a comment - 01/Aug/08 06:01 AM
Stephen - I know I am crazy, but I figured I would update you on this. Let me know what you think. I hope it is a step in the right direction. Peace - Anthony

Anthony Borrow added a comment - 01/Aug/08 06:06 AM
Some smaller issues to follow up on:

1) edit_users.php still makes use of $vocab. The get_loc_field_names function needs be evaluated and cleaned up.
2) function_mail.php using $mail_vocab - I'll come back and fix this up later to remove it
3) language.php defines the get_vocab function - I have left it there for now since it is not hurting anything but ultimately would like to eliminate this file
4) in /blocks/mrbs/lang/xx_utf8/block_mrbs.php there are strings like mail_body_changed_entry which previously had a prepended $mail variable which I removed for the sake of simplicity; however, these will need to be cleaned up and may break some of the mail functionality.
5) I would like to clean up the day of week, month, and other date related strings so that the page appears completely in the chosen language


Stephen Bourget added a comment - 01/Aug/08 08:30 AM
Anthony,

I took a quick look at it and it looks good.

One thought however, Should strings like YES, NO, OK etc be pulled from the block_mrbs language file or Moodle itself. (For example settings.php pulls some of the strings from calendar.php and from other files inside moodle/ang/en_utf8/.)

It might be worth reviewing the strings used with the MRBS integration and removing the strings that duplicate with the standard distribution of Moodle.

-Steve


Anthony Borrow added a comment - 01/Aug/08 09:52 AM
Steve - Thanks for looking it over. Yep, that is exactly what I was thinking about cleaning this up. I just wanted to go through on the first run and be thorough and treat everything the same. Now I can go back and comb through and see what we can get rid of. A little time consuming but I think it will be worth it in the long run. Peace - Anthony

Anthony Borrow added a comment - 01/Aug/08 12:05 PM
Steve - I have checked in the removal of unnecessary language strings. Let me know if I broke anything. I'll attach the diff file so that you can see what I did (and in case we need to undo it for some reason). All in all about 40 strings were eliminate. This should give us a slightly more Moolde-like experience as the vocabulary will be a slightly more similar. It wasn't bad to begin with but a few things will be more consistent. Let me know if you think of other strings we could get rid of by using Moodle native language strings. Peace - Anthony

Anthony Borrow added a comment - 01/Aug/08 12:06 PM
diff for replacing mrbs language strings with moodle language strings

Anthony Borrow added a comment - 03/Aug/08 02:08 AM
Stephen - Since the MRBS Moodle block makes use of Moodle's mdl_user table I was thinking that in response to my comment above:

1) edit_users.php still makes use of $vocab. The get_loc_field_names function needs be evaluated and cleaned up.

One solution is simply to remove the edit_users.php. In fact, this is probably safer since it takes away possible access. Do you see any reason not to delete the edit_users.php file.

Peace - Anthony


Anthony Borrow added a comment - 03/Aug/08 04:34 AM
CONTRIB-624 is a subtask of CONTRIB-230

Anthony Borrow added a comment - 03/Aug/08 04:38 AM
lang files should be OK, with removal of the language.php being part of the subtask to remove irrelevant files I am resolving this.