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

Anthony Borrow made changes - 31/Jul/08 10:30 PM
Field Original Value New Value
Security Minor security issue [ 10001 ]
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.


Jesus Martin made changes - 01/Aug/08 12:00 AM
Attachment lang.es.php [ 14727 ]
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.


arborrow committed 33 files to 'Contrib CVS' - 01/Aug/08 05:55 AM
CONTRIB-624 - I went ahead and bit the bullet and converted all of MRBSs get_vocab string calls to Moodle get_strings
ADD plugins/blocks/mrbs/lang/es_utf8/Attic/lang.es.php   Rev. 1.1    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/web/help.php   Rev. 1.3    (+8 -8 lines)
MODIFY plugins/blocks/mrbs/web/Attic/functions_mail.php   Rev. 1.3    (+3 -3 lines)
MODIFY plugins/blocks/mrbs/web/mrbs_auth.php   Rev. 1.2    (+4 -4 lines)
MODIFY plugins/blocks/mrbs/web/config.inc.php   Rev. 1.5    (+6 -5 lines)
MODIFY plugins/blocks/mrbs/web/Attic/pgsql.php   Rev. 1.2    (+2 -2 lines)
MODIFY plugins/blocks/mrbs/web/admin.php   Rev. 1.3    (+18 -18 lines)
MODIFY plugins/blocks/mrbs/web/report.php   Rev. 1.4    (+39 -39 lines)
MODIFY plugins/blocks/mrbs/web/edit_area_room.php   Rev. 1.3    (+20 -20 lines)
MODIFY plugins/blocks/mrbs/web/del.php   Rev. 1.3    (+6 -6 lines)
MODIFY plugins/blocks/mrbs/web/edit_entry.php   Rev. 1.4    (+33 -32 lines)
MODIFY plugins/blocks/mrbs/lang/en_utf8/block_mrbs.php   Rev. 1.4    (+224 -29 lines)
MODIFY plugins/blocks/mrbs/web/style.php   Rev. 1.3    (+3 -6 lines)
MODIFY plugins/blocks/mrbs/web/week.php   Rev. 1.4    (+15 -15 lines)
MODIFY plugins/blocks/mrbs/web/search.php   Rev. 1.3    (+17 -17 lines)
MODIFY plugins/blocks/mrbs/web/Attic/lang.es.php   Rev. 1.4    (+2 -2 lines)
MODIFY plugins/blocks/mrbs/web/Attic/lang.en.php   Rev. 1.3    (+2 -2 lines)
MODIFY plugins/blocks/mrbs/web/mysql.php   Rev. 1.3    (+2 -2 lines)
MODIFY plugins/blocks/mrbs/web/Attic/session_http.php   Rev. 1.2    (+6 -6 lines)
MODIFY plugins/blocks/mrbs/web/day.php   Rev. 1.5    (+14 -14 lines)
MODIFY plugins/blocks/mrbs/web/functions.php   Rev. 1.3    (+23 -25 lines)
MODIFY plugins/blocks/mrbs/web/mrbs_sql.php   Rev. 1.3    (+4 -4 lines)
MODIFY plugins/blocks/mrbs/web/Attic/language.php   Rev. 1.3    (+3 -3 lines)
MODIFY plugins/blocks/mrbs/web/Attic/session_cookie.php   Rev. 1.2    (+13 -13 lines)
MODIFY plugins/blocks/mrbs/web/session_php.php   Rev. 1.2    (+13 -13 lines)
MODIFY plugins/blocks/mrbs/lang/es_utf8/block_mrbs.php   Rev. 1.3    (+202 -6 lines)
MODIFY plugins/blocks/mrbs/web/Attic/edit_users.php   Rev. 1.3    (+24 -24 lines)
MODIFY plugins/blocks/mrbs/web/view_entry.php   Rev. 1.5    (+20 -20 lines)
MODIFY plugins/blocks/mrbs/web/month.php   Rev. 1.4    (+9 -9 lines)
MODIFY plugins/blocks/mrbs/lang/de_utf8/block_mrbs.php   Rev. 1.4    (+224 -32 lines)
MODIFY plugins/blocks/mrbs/web/trailer.php   Rev. 1.3    (+5 -5 lines)
MODIFY plugins/blocks/mrbs/web/mysqli.php   Rev. 1.2    (+2 -2 lines)
MODIFY plugins/blocks/mrbs/web/edit_entry_handler.php   Rev. 1.3    (+6 -6 lines)
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 made changes - 01/Aug/08 09:54 AM
Affects Version/s 2.0 [ 10156 ]
Affects Version/s 1.9.1 [ 10262 ]
arborrow committed 33 files to 'Contrib CVS' - 01/Aug/08 12:02 PM
CONTRIB-624 - replacing duplicated or similar language strings with moodle strings (e.g. - user_name with username, YES with yes, etc.), removed extra strings from language file block_mrbs.php
MODIFY plugins/blocks/mrbs/web/Attic/session_cookie.php   Rev. 1.3    (+10 -10 lines)
MODIFY plugins/blocks/mrbs/web/style.php   Rev. 1.4    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/web/Attic/session_http.php   Rev. 1.3    (+4 -4 lines)
MODIFY plugins/blocks/mrbs/web/week.php   Rev. 1.5    (+2 -2 lines)
MODIFY plugins/blocks/mrbs/web/functions.php   Rev. 1.4    (+12 -12 lines)
MODIFY plugins/blocks/mrbs/web/search.php   Rev. 1.4    (+7 -7 lines)
MODIFY plugins/blocks/mrbs/web/report.php   Rev. 1.5    (+7 -7 lines)
MODIFY plugins/blocks/mrbs/web/del.php   Rev. 1.4    (+1 -1 lines)
MODIFY plugins/blocks/mrbs/web/mysql.php   Rev. 1.4    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/web/day.php   Rev. 1.6    (+2 -2 lines)
MODIFY plugins/blocks/mrbs/web/mysqli.php   Rev. 1.3    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/web/help.php   Rev. 1.4    (+1 -1 lines)
MODIFY plugins/blocks/mrbs/web/trailer.php   Rev. 1.4    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/web/config.inc.php   Rev. 1.6    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/web/edit_entry.php   Rev. 1.5    (+5 -5 lines)
MODIFY plugins/blocks/mrbs/web/edit_area_room.php   Rev. 1.4    (+7 -7 lines)
MODIFY plugins/blocks/mrbs/web/admin.php   Rev. 1.4    (+6 -6 lines)
MODIFY plugins/blocks/mrbs/web/view_entry.php   Rev. 1.6    (+2 -2 lines)
MODIFY plugins/blocks/mrbs/web/Attic/functions_mail.php   Rev. 1.4    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/web/edit_entry_handler.php   Rev. 1.4    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/lang/de_utf8/block_mrbs.php   Rev. 1.5    (+1 -44 lines)
MODIFY plugins/blocks/mrbs/web/Attic/pgsql.php   Rev. 1.3    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/web/Attic/lang.en.php   Rev. 1.4    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/settings.php   Rev. 1.5    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/web/Attic/language.php   Rev. 1.4    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/web/session_php.php   Rev. 1.3    (+10 -10 lines)
MODIFY plugins/blocks/mrbs/web/Attic/lang.es.php   Rev. 1.5    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/web/Attic/edit_users.php   Rev. 1.4    (+16 -16 lines)
MODIFY plugins/blocks/mrbs/web/mrbs_sql.php   Rev. 1.4    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/lang/en_utf8/block_mrbs.php   Rev. 1.5    (+1 -44 lines)
MODIFY plugins/blocks/mrbs/web/month.php   Rev. 1.5    (+0 -0 lines)
MODIFY plugins/blocks/mrbs/lang/es_utf8/block_mrbs.php   Rev. 1.4    (+0 -43 lines)
MODIFY plugins/blocks/mrbs/web/mrbs_auth.php   Rev. 1.3    (+0 -0 lines)
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 made changes - 01/Aug/08 12:06 PM
Attachment CONTRIB-624.diff [ 14733 ]
arborrow committed 2 files to 'Contrib CVS' - 02/Aug/08 10:03 PM
CONTRIB-624 - replacing get_vocab with get_string in new files added as part of CONTRIB-230
MODIFY plugins/blocks/mrbs/web/mysqli.php   Rev. 1.5    (+1 -1 lines)
MODIFY plugins/blocks/mrbs/web/Attic/session_remote_user.php   Rev. 1.2    (+3 -3 lines)
arborrow committed 1 file to 'Contrib CVS' - 03/Aug/08 01:56 AM
CONTRIB-624 - locale is now set to the Moodle user's language preference which cleans up the day of week, month, and other date related strings so that the page appears consistently in the chosen language
MODIFY plugins/blocks/mrbs/web/Attic/language.php   Rev. 1.6    (+1 -1 lines)
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


arborrow committed 1 file to 'Contrib CVS' - 03/Aug/08 02:10 AM
CONTRIB-624 - removing unused edit_users.php file since all user editing should be done via the Moodle user interface
DEL plugins/blocks/mrbs/web/Attic/edit_users.php   Rev. 1.6    (+0 -0 lines)
Anthony Borrow made changes - 03/Aug/08 04:33 AM
Link This issue will help resolve CONTRIB-230 [ CONTRIB-230 ]
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.

Anthony Borrow made changes - 03/Aug/08 04:38 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
QA Assignee sbourget