The web interface for translation - inserting of leading spaces in strings
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
Can't you just put in a " " (a non-breaking space)?
In reply to Can't you just put in a 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 - non-breaking space by pfri
it seems that the web system interprets the marking well? Or I forgot it really enter. :-) I meant: "put " "
Could you share with me the direct link to the string in the translation server?
In reply to Link 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 Links to the translation server by pfri
Oh, I thought you were talking about the website content.
In reply to Link by Thomas
Any progress? - I would like to replace the sequence with space (before the MuseScore 2.0 release :-).
In reply to Leading space - translation server 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 Question forwarded to Drupal developer community 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 Leading space 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 Convention by Thomas
That last proposal I'd support. Gives us most felxibility, esp. if it comes to national differences in this area
In reply to That last proposal I'd by Jojo-Schmitz
For MuseScore 2.0, we have this coding standard now to always use placeholders if possible.
For places where it's not possible, e.g. as a unit used in the context of a form element, we'll solve it either by tweaking the margins, either by adding a space in the code.
In reply to End conclusion by Thomas
Also I can delete the strings from Czech translation (via translation server) now, as there is no need for it anymore, I suppose. (?)
In reply to - non-breaking space - deletion of this string from file by pfri
I always forget to enclose " " in quotes - and it "vanish".
In reply to by pfri
And it vanished again. .-)
nbsp;
In reply to Leading space - translation server 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:
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.