Strings beginning with space

Re: Strings beginning with space

Nicolas Martignoni-mit -
Antal besvarelser: 4
Language pack maintainers-ip assinga

I completely agree. I suggest to amend the Coding Style documentation page to clarify this and add an example under "Language strings > Structure": https://docs.moodle.org/dev/Coding_style#Language_strings.

Is there some procedure to follow (e.g. "policy" issue to open, as this is a quite official document) or can I do it directly?

I svar til Nicolas Martignoni

Re: Strings beginning with space

David Mudrák-mit -
Language pack maintainers-ip assinga

Yes, there is a procedure - please report such a suggestion as a new MDL issue, component "Policy".

I agree it is a bad practice to design strings with trailing and heading whitespace and I believe it should be considered a bug in the original English strings.

Meanwhile, you should be able to insert strings with whitespaces into AMOS though - https://lang.moodle.org/mod/forum/discuss.php?d=5908#p6932

I svar til David Mudrák

Re: Strings beginning with space

Séverin Terrier-mit -

Thanks David for (pointing to) the tip : Maintaining CTRL before clicking on text editing place to avoid AMOS filtering smiler

Here's a command to search for english files containing trailing space (launch from Moodle dir) :

for i in `find . -type f -name '*.php' | grep 'lang/en/'`
  do grep -Hne " ';$" $i | grep string
done | sort | cut -c 3-

There are more than for begining space. I suppose my search won't find multiple lines strings...

Séverin

I svar til David Mudrák

Re: Strings beginning with space

Nicolas Martignoni-mit -
Language pack maintainers-ip assinga

Just a notice about AMOS: it's impossible to propagate strings with leading spaces to other versions (or at least I didn't find how to).

Is it worth opening an tracker issue?