Non-core contributed modules

UTF-8 lang code for MRBS Block

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Component/s: Block: Mrbs
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE

Description

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

  1. CONTRIB-624.diff
    01/Aug/08 12:06 PM
    79 kB
    Anthony Borrow
  2. lang.es.php
    01/Aug/08 12:00 AM
    11 kB
    Jesus Martin

Issue Links

Activity

Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
Anthony Borrow added a comment -

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)

Show
Anthony Borrow added a comment - 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)
Hide
Jesus Martin added a comment -

You are right. It was a mistake. It's the first time I send a issue...
Thanks

Show
Jesus Martin added a comment - You are right. It was a mistake. It's the first time I send a issue... Thanks
Hide
Anthony Borrow added a comment -

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.

Show
Anthony Borrow added a comment - 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.
Hide
Anthony Borrow added a comment -

OK, I will change it so that it is not listed as a security issue. Peace - Anthony

Show
Anthony Borrow added a comment - OK, I will change it so that it is not listed as a security issue. Peace - Anthony
Hide
Jesus Martin added a comment -

An updated Spanish translation (UTF-8 code)
I change the default language from config.inc.php:

$default_language_tokens = "es";

See you.

Show
Jesus Martin added a comment - An updated Spanish translation (UTF-8 code) I change the default language from config.inc.php: $default_language_tokens = "es"; See you.
Hide
Anthony Borrow added a comment -

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.

Show
Anthony Borrow added a comment - 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.
Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
Stephen Bourget added a comment -

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

Show
Stephen Bourget added a comment - 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
Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
Anthony Borrow added a comment -

diff for replacing mrbs language strings with moodle language strings

Show
Anthony Borrow added a comment - diff for replacing mrbs language strings with moodle language strings
Hide
Anthony Borrow added a comment -

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

Show
Anthony Borrow added a comment - 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
Hide
Anthony Borrow added a comment -

CONTRIB-624 is a subtask of CONTRIB-230

Show
Anthony Borrow added a comment - CONTRIB-624 is a subtask of CONTRIB-230
Hide
Anthony Borrow added a comment -

lang files should be OK, with removal of the language.php being part of the subtask to remove irrelevant files I am resolving this.

Show
Anthony Borrow added a comment - lang files should be OK, with removal of the language.php being part of the subtask to remove irrelevant files I am resolving this.
Hide
Anthony Borrow added a comment -

Closing all of my resolved issues. Peace - Anthony

Show
Anthony Borrow added a comment - Closing all of my resolved issues. Peace - Anthony

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: