Moodle

Move colon signs form source code into language packs

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.9
  • Fix Version/s: None
  • Component/s: Language
  • Labels:
    None
  • Affected Branches:
    MOODLE_15_STABLE, MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

Description

At some places, the colon sign in text message is hard-coded at the level of PHP source code and not in the language pack. This is problem as some languages (e.g. Khmer) do not use colon signs at all.

There is a proposal to remove all such colon signs from PHP and move them into en_ut8 lang pack. A list of changed strings would be kept (e.g. at docs.moodle.org) so translator could update their language packs. Correct approach would be to introduce new strings in order to keep backwards compatibility, but it represents more work for translators.

More at http://moodle.org/mod/forum/post.php?reply=373735

Issue Links

Activity

Hide
David Mudrak added a comment -

Another solution might be to introduce new setting in langconfig.php $string['colonsign'] = ':'; and use it. This would keep backward compatibility and allow change this sign in Khmer language.

Show
David Mudrak added a comment - Another solution might be to introduce new setting in langconfig.php $string['colonsign'] = ':'; and use it. This would keep backward compatibility and allow change this sign in Khmer language.
Hide
Koen Roggemans added a comment -

I transfer this to Moodle.com. It is quite a major thing, since it is difficult to find the colons in the code (they are everywhere).
I think the list of strings, followed by a colon is necessary. That is something that could be done by the people who need it.

Show
Koen Roggemans added a comment - I transfer this to Moodle.com. It is quite a major thing, since it is difficult to find the colons in the code (they are everywhere). I think the list of strings, followed by a colon is necessary. That is something that could be done by the people who need it.
Hide
Séverin Terrier added a comment -

I like David's proposal. It's simple, and would allow to add a space juste before the colon sign, as it should be done in french

Show
Séverin Terrier added a comment - I like David's proposal. It's simple, and would allow to add a space juste before the colon sign, as it should be done in french
Hide
David Mudrak added a comment -

For Czech, I would set the $string['colonsign'] = ': ' (no space before, space after the colon sign).

Show
David Mudrak added a comment - For Czech, I would set the $string['colonsign'] = ': ' (no space before, space after the colon sign).
Hide
Nicolas Martignoni added a comment -

And for french, it should be $string['colonsign'] = ' : ' (non breaking space before, normal space after, as Séverin indicated).

Show
Nicolas Martignoni added a comment - And for french, it should be $string['colonsign'] = ' : ' (non breaking space before, normal space after, as Séverin indicated).
Hide
Leang Chumsoben added a comment - - edited

And for Khmer, it will be $string['colonsign'] = ' <Khmer : sign> ' (non breaking space before, normal space after).

Show
Leang Chumsoben added a comment - - edited And for Khmer, it will be $string['colonsign'] = ' <Khmer : sign> ' (non breaking space before, normal space after).
Hide
Olli Savolainen added a comment -

$string['colonstring'] might also solve situations where the colon is used between two user-generated strings, such as:

print_heading($pagetitle.": ".$quizname, 'left', 2);

or otherwise, I have no idea how to fix this in /mod/quiz/edit.php

Show
Olli Savolainen added a comment - $string['colonstring'] might also solve situations where the colon is used between two user-generated strings, such as: print_heading($pagetitle.": ".$quizname, 'left', 2); or otherwise, I have no idea how to fix this in /mod/quiz/edit.php
Hide
David Mudrak added a comment -

I just re-assigned this to myself.

Show
David Mudrak added a comment - I just re-assigned this to myself.
Hide
Martin Dougiamas added a comment -

These sound like good ideas, David.

Show
Martin Dougiamas added a comment - These sound like good ideas, David.
Hide
David Mudrak added a comment -

As discussed in the chat, I will add new core function colonise() that will add the language-specific colon sign to the end of the string, if it is not there yet.

Show
David Mudrak added a comment - As discussed in the chat, I will add new core function colonise() that will add the language-specific colon sign to the end of the string, if it is not there yet.
Hide
David Mudrak added a comment -

New string is available and can be used as get_string('labelsep', 'langconfig'). Please read the commit message for more information. Leaving this opened as there are still many places that have ': ' hardcoded and we do not have enough time to fix them all now.

Show
David Mudrak added a comment - New string is available and can be used as get_string('labelsep', 'langconfig'). Please read the commit message for more information. Leaving this opened as there are still many places that have ': ' hardcoded and we do not have enough time to fix them all now.
Hide
David Mudrak added a comment -

We have regression here. If we set label in a way like this:

$s = new single_select($this->page->url, 'lang', $langs, $currlang, null);
$s->label = get_accesshide(get_string('language'));

then the colon is displayed but the label tag itself is hidden via CSS. Options:

  • single_select() and friends would need ->colonize property, true by default
  • or the accesshidden label should have to be set via ->accesshiddenlabel instead of ->label
  • or the colon sign will be within label tag, but we wanted to avoid it so that screenreaders do not read it
Show
David Mudrak added a comment - We have regression here. If we set label in a way like this:
$s = new single_select($this->page->url, 'lang', $langs, $currlang, null);
$s->label = get_accesshide(get_string('language'));
then the colon is displayed but the label tag itself is hidden via CSS. Options:
  • single_select() and friends would need ->colonize property, true by default
  • or the accesshidden label should have to be set via ->accesshiddenlabel instead of ->label
  • or the colon sign will be within label tag, but we wanted to avoid it so that screenreaders do not read it
Hide
Tim Hunt added a comment -

The fact that we don't want screen-readers to read the : confirms my view that they are pointless.

Also: http://moodle.org/mod/cvsadmin/view.php?conversationid=5162#c208631. You see: forms look good without them.

So why not save ourselves a lot of grief, and get rid of them.

Show
Tim Hunt added a comment - The fact that we don't want screen-readers to read the : confirms my view that they are pointless. Also: http://moodle.org/mod/cvsadmin/view.php?conversationid=5162#c208631. You see: forms look good without them. So why not save ourselves a lot of grief, and get rid of them.
Hide
Petr Škoda (skodak) added a comment -

I do not like colons, I personally vote for CSS visual separation of label and form field

Show
Petr Škoda (skodak) added a comment - I do not like colons, I personally vote for CSS visual separation of label and form field
Hide
David Mudrak added a comment -

I do not like colons in field labels, too. But I guess MD will have to decide the final color of this bike shed.

Show
David Mudrak added a comment - I do not like colons in field labels, too. But I guess MD will have to decide the final color of this bike shed.
Hide
Martin Dougiamas added a comment -

Grr, I just rediscovered the accesshide issue and came here to report it.

Show
Martin Dougiamas added a comment - Grr, I just rediscovered the accesshide issue and came here to report it.
Hide
Martin Dougiamas added a comment -

I've set the labelsep for "en" to " " because this accesshide thing is annoying me so much.

Show
Martin Dougiamas added a comment - I've set the labelsep for "en" to " " because this accesshide thing is annoying me so much.
Hide
David Mudrak added a comment -

I've set the labelsep back to ": " for English and temporarily disabled the effect of $colonize parameter unless the issue with accesshide is fixed.

Show
David Mudrak added a comment - I've set the labelsep back to ": " for English and temporarily disabled the effect of $colonize parameter unless the issue with accesshide is fixed.
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Nicolas Martignoni added a comment -

AFAIK, still here and still needs fixing.

Show
Nicolas Martignoni added a comment - AFAIK, still here and still needs fixing.

Dates

  • Created:
    Updated: