The web interface for translation - inserting of leading spaces in strings

• Aug 13, 2012 - 21:55

Hi,

I encountered the web translation system behaviour, that prevents me from achieving the goal: insertion of space in front of sp (spatium) unit in some strings, and, the space before the % character.

Exemple:
The goal is to have this in Settings dialogs:

for example "0,7 sp" nstead of "0,7sp"

or "100 %"

When I use Qt Linguist, I have it as I need. But web interface deletes the space after confirmation-after the saving of the change in string, and when the web interface is probably the only way, how to get the changes to the place (next to the sending of the file edited in Qt Linguist to the developer - but I don't know, what the automated system would make with the leading spaces), I would like to ask for solution. Is it the thing for the string change in the file i. e.: " sp", or is there an magical way for the system to preserve that leading space using the web translation system?

Thanks


Comments

In reply to by Jojo-Schmitz

When I put   before sp in such a string using Qt Linguist - the result is the   text appears in those boxes as text just before "sp" etc. and such behaviour isn't, what is expected from the unit appearance.

I inserted it in web translation interface too and expect the same result.

I know, that the leading space in strings is possible, when needed, Qt Linguist - the source.ts files from other projects are the best evidence of this, at least I think. Maybe I am wrong, but the need for solution remains.

In reply to by Thomas

The sp, mm, % and in one case úzm units are spread through the context groups.

When I let filter sp in TextPropertiesBase context, I obtain these entries, see the third, where I've added in opposite to the other occurences the explanation of unit in brackets, and the fourth with mm unit:

http://translate.musescore.org/translate/languages/cs/edit?project=&sta…

There are   formatting marks for non breakable spaces already used (added when the post above read, and now good for quick searching of those entries in current translation. The filtering shows.

http://translate.musescore.org/translate/languages/cs/edit?project=&sta…

In reply to by pfri

Thanks for bringing this back to my attention. You may know that we are using Drupal CMS with the l10n module for the MuseScore translation server. I had no idea yet ho they implementation leading or trailing whitespaces, but this issue explained it well: http://drupal.org/node/209980

So what happens when you submit a translation:
- trim the translation on submission
- grab the leading and trailing whitespace from the source string as it is there exactly
- add the leading and trailing whitespace to the translation
- save the translation to the DB

So the whitespace issue you raised Pavel is caused by the first step, the trimming (l10n_community_trim($translation, $source)). Is it a bug? Not by design it seems. But I filed a support request and asked what to do with this.

In reply to by Thomas

Also it seemes to me, that it has two solutions. Maybe cleaner would be, when the leading space would have been added to the source string by developers - in case the developers consider it esthetically necessary to have space between the number and unit, another way - handling with the system to allow the user his translator´s customization. I am looking forward for the solution.

In reply to by pfri

Regarding your first proposal, to add the leading space to the source string, this is indeed the right thing to do. In this case, it's about convention I assume.

For %, mm, sp, Hz, is it convention to have a space between the value and the unit name?
So 2% or 2 %?
So 2mm or 2 mm?

Another way to solve it is to use placeholders in the code: "%value unit" where the %value placeholder is replaced by the actual value.

In reply to by pfri

I've been talking this issue through with lasconic and it becomes clear it's either a code issue, either an UI issue. So it's not an issue which should be solved on the translator level. If someone believes that there should be more space between a value and a unit or a form field and a unit, this can be filed as an issue in the tracker.

In the particular case of the units that you translated Pavel, we checked one as an example:

spinbox20.png spinbox12.png

The space between the value and the unit is controlled in a UI file or sometimes declared xml.
In this case it's at https://github.com/musescore/MuseScore/blob/master/mscore/boxproperties…

So the end conclusion is that for each case, we'll have to look up where it's declared in the code and fix it from there based on convention and/or best user experience.

Attachment Size
spinbox20.png 3.4 KB
spinbox12.png 748 bytes

Do you still have an unanswered question? Please log in first to post your question.