Moodle

Database 'insufficient entries' string is not very good

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Trivial Trivial
  • Resolution: Unresolved
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

Something reported by our technical testing - they don't like the string: '1 more entries needed to view this database'.

The database string 'insufficiententries' is printed in a rather bad way:

notify (($data->requiredentriestoview - data_numentries($data)).' '.get_string('insufficiententries','data'));

The string itself is:

$string['insufficiententries'] = 'more entries needed to view this database';

This is bad for two reasons:

1) The string should have $a, for languages where it's more convenient to put the number elsewhere in the string.

2) In the most common case, the string says '1 more entries needed to view this database' - this is grammatically wrong, a bit unclear as to exactly what the user needs to do, and incorrect as to what they've done before (it says 'more' entries, but you haven't actually added any yet).

I propose creating two new language strings (I'm assuming that for legacy translation reasons, existing string should not be reused):

$string['insufficiententries_1']='You must add your own entry before you can view this database'
$string['insufficiententries_n']='You must add $a entries of your own before you can view this database'

I'm perfectly willing to do the change. Is this ok?

Issue Links

Activity

Hide
Koen Roggemans added a comment -

It seems fine by me, knowing that it doesn't solve problems for all languages. There are some with very odd grammar concerning one and more then one (e.g. two, three).
Thanks for respecting the old strings.

Show
Koen Roggemans added a comment - It seems fine by me, knowing that it doesn't solve problems for all languages. There are some with very odd grammar concerning one and more then one (e.g. two, three). Thanks for respecting the old strings.
Hide
Sam Marshall added a comment -

I saw the issues about languages with 'dual' as well as singular/plural (most notably Arabic, according to Wikipedia). However this change would still improve things for many languages at least. Thanks for the comment.

However Petr has suggested it might be better to make a more general change to get_string, so that if you call get_string with $a = an integer, it looks for 'string_num' (string_1, if the integer was 1) before falling back to the base value 'string'. [Would do this after it finds the base value, so it only looks in the same language it's going to use for base.] This could be complex but I will investigate it. If it turns out to be easy, I will provide a patch for that and link it for discussion on forums. (Obviously that's a more significant change as it doesn't just affect one string!)

Show
Sam Marshall added a comment - I saw the issues about languages with 'dual' as well as singular/plural (most notably Arabic, according to Wikipedia). However this change would still improve things for many languages at least. Thanks for the comment. However Petr has suggested it might be better to make a more general change to get_string, so that if you call get_string with $a = an integer, it looks for 'string_num' (string_1, if the integer was 1) before falling back to the base value 'string'. [Would do this after it finds the base value, so it only looks in the same language it's going to use for base.] This could be complex but I will investigate it. If it turns out to be easy, I will provide a patch for that and link it for discussion on forums. (Obviously that's a more significant change as it doesn't just affect one string!)
Hide
Sam Marshall added a comment -

Probably best not to address this until there is a general 'plurals' solution.

Show
Sam Marshall added a comment - Probably best not to address this until there is a general 'plurals' solution.

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated: