String need to end with a space, AMOS doesn't allow it (Moodle mobile)

String need to end with a space, AMOS doesn't allow it (Moodle mobile)

дэргэд Romário Rodrigues Ramos -
Хариу нийтлэлийн тоо: 11
I trying to put a space in the end of translated string of mm.login.credentialsdescription, but AMOS remove it.


The screenshot shows the string and the URL.

Хавсралт Screenshot_2016-03-03-07-57-30.jpg
Хавсралт Screenshot_2016-03-03-08-50-58.jpg
Romário Rodrigues Ramos-н хариуд

Re: String need to end with a space, AMOS doesn't allow it (Moodle mobile)

дэргэд David Mudrák -
Language pack maintainers зураг

Thanks Romário.

AMOS behaviour is expected and it is an intended feature. I asked our Moodle Mobile app lead developer Juan Leyva to comment on this issue as there might be a bug in the app.

David Mudrák-н хариуд

Re: String need to end with a space, AMOS doesn't allow it (Moodle mobile)

дэргэд Shamim Rezaie -
Language pack maintainers зураг

it's not just about mobile app.

There are other places that having a space at the end is needed.

For example 'labelsep' in core_langconfig. The English text is ': ' with a space at the end but this luxury is only available to English.

Shamim Rezaie-н хариуд

Re: String need to end with a space, AMOS doesn't allow it (Moodle mobile)

дэргэд Luca Bösch -

I second Shamim Rezaie's view and would find it useful if AMOS permitted a regular space at the end of a string.

mysubmission | mod_assign is just another example, "My submission: ", where, in german, the final space is missing.

So will submit that string with an   at the end.

Luca Bösch-н хариуд

Re: String need to end with a space, AMOS doesn't allow it (Moodle mobile)

дэргэд koen roggemans -
Language pack maintainers зураг

How do people feel about filing a bug for the component if it contains a string with a space at the end?

There shouldn't be a space at the end of a language string because it tricks translators into errors: you can't see it unless it gets reported by someone who notices the missing space in the interface.

koen roggemans-н хариуд

Re: String need to end with a space, AMOS doesn't allow it (Moodle mobile)

дэргэд Vadim Dvorovenko -

koen, we have many strings in core, wich end with space. And much more in contributed plugins.


I argee, that default behaviour in such case should be to remove leading and trailing spaces. But in rare cases we need a way to say to AMOS, that trailing spaces should not be trimmed. I see some variants:

* adding checkbox under translator area for skipping trimming (not shure it will work, beacuse yo should leave editing area before you can click checkbox, so string will be trimmed anyway)

* adding some "secret" substitution, for example '{space}' at the end and begining of string will be converted to spaces after trimming.

* adding some "secret" tags. e.g. text containing in '{pre} ... {\pre}' should not be cleaned

* "secret" prefix. If string starts with '{PRE}' it will not be cleaned, but {PRE} will be deleted

* adding special non-cleared (for example with red box) editor area, that is opened on doubleclick/rightclick/wheel click. Maybe create contextmenu with 'edit' and 'edit without cleaning' commands.



Maybe we should disable string trimming, but add some notifications to stage and translator interface like:

* Original string has leading/trailing space, but translated does not.

* Translated string has leading/trailing space, but original does not.

Mantainers and translators will see such anounces and will decide, what to do.

koen roggemans-н хариуд

Re: String need to end with a space, AMOS doesn't allow it (Moodle mobile)

дэргэд Shamim Rezaie -
Language pack maintainers зураг

"There shouldn't be ...";

I agree, but let's face it. There is. And English translation has found a way to deal with it.

I agree that a proper fix should be applied to code so there would be no need for a space at the end of strings, but I don't think that this is a "trivial" issue that we must live with until then. It wouldn't be trivial if it was the case with English.

What are we supposed to enter for "parentlanguage"? The only option that we have at the moment is to not translate it at all and live with having one additional untranslated string.

Shamim Rezaie-н хариуд

Re: String need to end with a space, AMOS doesn't allow it (Moodle mobile)

дэргэд koen roggemans -
Language pack maintainers зураг

Parent language should only be set if there is a parent language, so this has to stay empty if the fall back language is English. 

E.g for de_kids, the parent language is de. Strings not in de_kids will be searched in de before falling  back to English.

Parent language is not counted to reach 100% translated нүд ирмэх

koen roggemans-н хариуд

Re: String need to end with a space, AMOS doesn't allow it (Moodle mobile)

дэргэд Vadim Dvorovenko -

Returning to this discussion afted 9 month. I've open issue on tracker MDLSITE-5269 and provided patch.

It allows to bypass string trimming, if you click cell in transator string while holding Ctrl key. You may watch this issue and invite someone to discussion