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)

by Romário Rodrigues Ramos -
Number of replies: 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.

Attachment Screenshot_2016-03-03-07-57-30.jpg
Attachment Screenshot_2016-03-03-08-50-58.jpg
In reply to Romário Rodrigues Ramos

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

by David Mudrák -
Picture of 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.

In reply to David Mudrák

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

by Shamim Rezaie -
Picture of 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.

In reply to Shamim Rezaie

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

by Ralf Krause -
Picture of Language pack maintainers

Hi

It's not very nice to add an   (non breakable space) at the end of the string but it helps. You also can try to add an alt-space character.  smile

Best regards, Ralf

In reply to Shamim Rezaie

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

by 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.

In reply to Luca Bösch

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

by koen roggemans -
Picture of 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.

In reply to koen roggemans

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

by 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.

In reply to Vadim Dvorovenko

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

by Shamim Rezaie -
Picture of Language pack maintainers

Having a checkbox for skipping trimming is nice. It will work. You just need to select it before writing your text.

In reply to koen roggemans

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

by Shamim Rezaie -
Picture of 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.

In reply to Shamim Rezaie

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

by koen roggemans -
Picture of 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 wink

In reply to koen roggemans

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

by 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