Moodle

Localized strings get too long in the Moodle menu

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.6.5, 1.7.3, 1.8.3, 1.9
  • Fix Version/s: None
  • Component/s: Language, Usability
  • Labels:
    None
  • Environment:
    All localized Moodle platforms
  • Affected Branches:
    MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

Description

For the german translation we found that the strings get too long for the menu Site-Administration.

In most cases the menu entries and the headline of the linked page are using the same strings. In the headlines you will have much more space for more words but not in the menus. Therefor we will ask you for two different strings. One string should be used for the menu entry and the other should be writen as the headline on the linked page. This will help to get usable menus and readable significant headlines.

Issue Links

Activity

Hide
Ralf Hilgenstock added a comment -

This is primarly a problem in this submenus

users-authtification-auth types There are two line menus
grades There are submenus also beginning with 'grade...'
Front Page There are five submenus also beginning with 'Front page'

The texts in the lang strings a re good as side headers in the content pages but not good for the menus. If we create two different strings we can translate different for content pages and menus.

In the english translation 'Front Page' should be changed to 'Front page' in the menus. We have than the same writing rules in all menus (only first letter as an upper letter).

Show
Ralf Hilgenstock added a comment - This is primarly a problem in this submenus users-authtification-auth types There are two line menus grades There are submenus also beginning with 'grade...' Front Page There are five submenus also beginning with 'Front page' The texts in the lang strings a re good as side headers in the content pages but not good for the menus. If we create two different strings we can translate different for content pages and menus. In the english translation 'Front Page' should be changed to 'Front page' in the menus. We have than the same writing rules in all menus (only first letter as an upper letter).
Hide
Koen Roggemans added a comment -

It's not only a German problem - Also Dutch is really difficult and today I noticed Thai has also the same problem.
As for now, I try to be creative and keep the translation short. I think the suggestion of two strings is a good plan.

Show
Koen Roggemans added a comment - It's not only a German problem - Also Dutch is really difficult and today I noticed Thai has also the same problem. As for now, I try to be creative and keep the translation short. I think the suggestion of two strings is a good plan.
Hide
David Horat added a comment -
Show
David Horat added a comment - Question about this issue: http://moodle.org/mod/forum/discuss.php?d=100290
Hide
Anthony Borrow added a comment - - edited

David - My initial response is that we can continue to use the get_string function. I do not see an advantage or need to create a separate function which I think would just cause more confusion. I think if we use the same function and introduce a new string as a description of the option that you might be able to accomplish the same thing. So where you proposed:

new admin_settingpage('gradecategorysettings', get_string('gradecategorysettings', 'grades'), 'moodle/grade:manage', get_short_string('gradecategorysettings', 'grades'));

I would suggest appending _description or an abbreviated _desc and create a new string but use the same function:

New: new admin_settingpage('gradecategorysettings', get_string('gradecategorysettings', 'grades'), 'moodle/grade:manage', get_string('gradecategorysettings_desc', 'grades'));

We could even modify get_string such that if the string name ends in _desc and that string is undefined it uses the short one by default. So that is another way of approaching this that I think would accomplish what you are hoping for unless I am missing something. I'd be interested in other's comments.

Peace - Anthony

p.s. a screen shot demonstrating the problem might be helpful.

Show
Anthony Borrow added a comment - - edited David - My initial response is that we can continue to use the get_string function. I do not see an advantage or need to create a separate function which I think would just cause more confusion. I think if we use the same function and introduce a new string as a description of the option that you might be able to accomplish the same thing. So where you proposed: new admin_settingpage('gradecategorysettings', get_string('gradecategorysettings', 'grades'), 'moodle/grade:manage', get_short_string('gradecategorysettings', 'grades')); I would suggest appending _description or an abbreviated _desc and create a new string but use the same function: New: new admin_settingpage('gradecategorysettings', get_string('gradecategorysettings', 'grades'), 'moodle/grade:manage', get_string('gradecategorysettings_desc', 'grades')); We could even modify get_string such that if the string name ends in _desc and that string is undefined it uses the short one by default. So that is another way of approaching this that I think would accomplish what you are hoping for unless I am missing something. I'd be interested in other's comments. Peace - Anthony p.s. a screen shot demonstrating the problem might be helpful.
Hide
Laia Subirats added a comment -

I attach a patch according to Anthony's comments.
Right now if one needs to add an abbreviated version, he has to add by hand the get_string('whatever_desc') as the last parameter of the constructor when it's called, if not already done, and then add the corresponding string to the language file.
Another possibility would be to add in advance the last parameter to all calls, so that only language files need be modified whenever one needs to add an abbreviation, but I think the best solution would be to just be able to call the constructor like
new admin_settingpage('gradecategorysettings')
and have it look for the appropiate strings and their abbreviations, as David posted. This would make the code both more compact, easier to read/write and less error prone (no duplication of string labels). The only disadvantage is that this would not be consistent with the usage in other parts of the code base.
What do people think about this?

Show
Laia Subirats added a comment - I attach a patch according to Anthony's comments. Right now if one needs to add an abbreviated version, he has to add by hand the get_string('whatever_desc') as the last parameter of the constructor when it's called, if not already done, and then add the corresponding string to the language file. Another possibility would be to add in advance the last parameter to all calls, so that only language files need be modified whenever one needs to add an abbreviation, but I think the best solution would be to just be able to call the constructor like new admin_settingpage('gradecategorysettings') and have it look for the appropiate strings and their abbreviations, as David posted. This would make the code both more compact, easier to read/write and less error prone (no duplication of string labels). The only disadvantage is that this would not be consistent with the usage in other parts of the code base. What do people think about this?
Hide
Anthony Borrow added a comment -

Koen - I'm especially interested in your feedback on this and any comments you or Martin have about how best to provide an option for the use of a shorter string should it exist. Peace - Anthony

Show
Anthony Borrow added a comment - Koen - I'm especially interested in your feedback on this and any comments you or Martin have about how best to provide an option for the use of a shorter string should it exist. Peace - Anthony
Hide
Koen Roggemans added a comment -

hm, it's a difficult choice. I'm not so fond of the coding solutions, since they are not transparent how they work, unless documented (which no one reeds).
I think I would be most happy with duplicate strings in the language packs. It gives more flexibility to write up a good title above every page, while keeping the menu very short.
The strings could be something like gradecategorysettings, gradecategorysettings_menu. That way they show up next to eachother in the translation editor / language file, so it's easy to make them very similar or the same if possible.

I added David Mudrak as a watcher too

Show
Koen Roggemans added a comment - hm, it's a difficult choice. I'm not so fond of the coding solutions, since they are not transparent how they work, unless documented (which no one reeds). I think I would be most happy with duplicate strings in the language packs. It gives more flexibility to write up a good title above every page, while keeping the menu very short. The strings could be something like gradecategorysettings, gradecategorysettings_menu. That way they show up next to eachother in the translation editor / language file, so it's easy to make them very similar or the same if possible. I added David Mudrak as a watcher too
Hide
David Mudrak added a comment -

My +1 for Koen's proposal from 11/Jul/08 10:36 PM. The easiest solution is the best one.
My -1 for using "_desc" suffix. Here "description" is a little bit confusing for me as I would expect some sort of explanation/help instead of abbreviation.

Therefore my proposal is
1) duplicate all relevant strings and use a appropriate stringid for the new ones, e.g. gradecategorysettings_abv or gradecategorysettings_menu
2) the default value of *_abv strings will be the same as current one
3) write a script that will go thru all language packages and will do this automatically and at once
4) let translators to modify *_abv string if they need/wish to

Show
David Mudrak added a comment - My +1 for Koen's proposal from 11/Jul/08 10:36 PM. The easiest solution is the best one. My -1 for using "_desc" suffix. Here "description" is a little bit confusing for me as I would expect some sort of explanation/help instead of abbreviation. Therefore my proposal is 1) duplicate all relevant strings and use a appropriate stringid for the new ones, e.g. gradecategorysettings_abv or gradecategorysettings_menu 2) the default value of *_abv strings will be the same as current one 3) write a script that will go thru all language packages and will do this automatically and at once 4) let translators to modify *_abv string if they need/wish to
Hide
David Horat added a comment -

I agree with David Mudrak that we should take the opposite approach and the abbreviation should be the new string. So my proposal is similar to his but a bit easy to integrate in the current Moodle:

1) We will have a new stringid for the new ones which will be the same as the original+"_abv". Example: gradecategorysettings and gradecategorysettings_abv.

2) If the original+"_abv" is not found, we will use the original one, so we dont need to go through all language packages to do the new ones.

Do you prefer "_abv" for abbreviation of "_menu" because it is the menu entry? Personally I prefer the one with "_abv".

If you all agree, I will implement it as soon as possible to be integrated with the next stable version of Moodle.

Show
David Horat added a comment - I agree with David Mudrak that we should take the opposite approach and the abbreviation should be the new string. So my proposal is similar to his but a bit easy to integrate in the current Moodle: 1) We will have a new stringid for the new ones which will be the same as the original+"_abv". Example: gradecategorysettings and gradecategorysettings_abv. 2) If the original+"_abv" is not found, we will use the original one, so we dont need to go through all language packages to do the new ones. Do you prefer "_abv" for abbreviation of "_menu" because it is the menu entry? Personally I prefer the one with "_abv". If you all agree, I will implement it as soon as possible to be integrated with the next stable version of Moodle.
Hide
Anthony Borrow added a comment -

David - I'm not a fan of abbreviations - especially for abbreviation. Perhaps the shorter string could use _short. I'm primarily thinking of readability of the code. I'm afraid abv would be confusing - is that "absolute value", "above", or perhaps the developers dream "alcohol by volume"? Peace - Anthony

Show
Anthony Borrow added a comment - David - I'm not a fan of abbreviations - especially for abbreviation. Perhaps the shorter string could use _short. I'm primarily thinking of readability of the code. I'm afraid abv would be confusing - is that "absolute value", "above", or perhaps the developers dream "alcohol by volume"? Peace - Anthony
Hide
David Mudrak added a comment -

My +1 for Anthony's "short" proposal coming from his long experience
My -1 for David Horat's solution from 07/Nov 03:01 - I do not like such additional "_short" rules as they are making things more difficult even being simple themselves. Generally, If we add more and more such exceptions from the current simple mechanism, maintaining language packs and writing additional language tools will require more attention and documentation and will lead to more bugs. Note for example there is no way at the moment to add a new string into a non-English langpack only. So if the English pack does not contain "gradecategorysettings_short", no other language packs should not contain it, too. I consider writing a script that will duplicate all relevant admin menu strings cleaner approach.

Show
David Mudrak added a comment - My +1 for Anthony's "short" proposal coming from his long experience My -1 for David Horat's solution from 07/Nov 03:01 - I do not like such additional "_short" rules as they are making things more difficult even being simple themselves. Generally, If we add more and more such exceptions from the current simple mechanism, maintaining language packs and writing additional language tools will require more attention and documentation and will lead to more bugs. Note for example there is no way at the moment to add a new string into a non-English langpack only. So if the English pack does not contain "gradecategorysettings_short", no other language packs should not contain it, too. I consider writing a script that will duplicate all relevant admin menu strings cleaner approach.
Hide
Koen Roggemans added a comment -

i like _short too: it says what it should be->short
I don't think it is necessary to write a duplicate script, although it would be nice. (We went to almost 1k of new errormessages - a few administration interface strings will be fine too. The short and the long will be next to each other anyway.)
As you say David: keep it as simple as possible - the language mechanics are already difficult enough.

Show
Koen Roggemans added a comment - i like _short too: it says what it should be->short I don't think it is necessary to write a duplicate script, although it would be nice. (We went to almost 1k of new errormessages - a few administration interface strings will be fine too. The short and the long will be next to each other anyway.) As you say David: keep it as simple as possible - the language mechanics are already difficult enough.

Dates

  • Created:
    Updated: