Revise 2D Mapper class to allow better translation#1810
Conversation
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Further improvements to the class file which picks out some more texts for translation and improves disambiguation/translation comments. Some more are also better identified for plural handling. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
src/T2DMap.cpp
Outdated
| .arg(tr("<p>Click on a line to select or deselect that room number (with the given name if the " | ||
| "rooms are named) to add or remove the room from the selection. Click on the " | ||
| "relevant header to sort by that method. Note that the name column willl only " | ||
| "show if at least one of the rooms has a name.</p>"))); |
There was a problem hiding this comment.
Can you outsource the surrounding p tag as well?
There was a problem hiding this comment.
I deliberately make an exception for paragraph tags because if there is more than one it is better to not hide just the first opening and last closing ones - on the basis that it causes less surprise then if there is a </p><p> in the middle of a string.
There was a problem hiding this comment.
Fair enough, but there are no such in the middle here?
I want to outsource these html marks as many and as often as possible.
Agreed on avoiding the surprising paragraph tags. In those cases where they are in the middle, they should stay on the edges as well. But in this case, no tags are needed for translation at all, at all.
|
@SlySven ping, would you be able to finish this up? |
|
Changing "Work in progress" to "Backlog", as this hasn't been updated in a few months already. |
…nternationalised Conflicts resolved in: - src/T2DMap.cpp Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
The buttons on the form that the user uses to select a normal exit direction to draw a new custom exit line for have texts that will need to be translated but the code was examining the literal text used which would break as soon as it was changed for another language. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Change some `QString`s to use `QLatin1String`s constructor where it helps (place where it is use can accept them directly; no parameter replacements are needed, where same QString is used multiple times in the same file and compiler will arrange for the literals to be merged). Revised the text of a couple of translator comments. Comment out an unused line preceding some other commented out code. Changed capitalisation on "create room" menu item to match all others in the same compilation unit. Removed terminal punctuation on "create Label" context menu item tool tip to match all others in the same compilation unit. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
…merge Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
SlySven
left a comment
There was a problem hiding this comment.
Some things to do there then.
With the introduction of translations AND also after the conversion of the internal exit direction keys for normal exits in the `TRoom` data structures for custom exit lines, in: Mudlet#2106 (which was included in Mudlet 3.16.0) it has not possible to create new custom exit lines without encountering a bug that means the lines are drawn in black and do not show up whilst drawing, the properties dialogue also has no idea of the destination room and there are other oddities. This commit contains an extract from: Mudlet#1810 that was pending and had the fix for this problem Note that this does not fix the lua getCustomLines(...) function which, since 3.16.0 has also been using lower case keys to return the normal exit direction custom exit line details. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Also adopted the optimum(?) `QString` initialisation process! Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
vadi2
left a comment
There was a problem hiding this comment.
Pretty close - lets get it over and done with...
|
With the very important #2317 now in, let's get this merged so we can do a bugfix. |
Also take out a double negative that is not that helpful in a tooltip and convert a menu item from the plural to the singular case as it can only do one item (custom exit line) per invocation. This also introduces some non-breaking spaces and hyphens so that fragments of the info texts are kept together should the display area be too narrow to fit each line as a whole. Due to at least one Qt bug it is not possible to put non-breaking spaces within the source file directly and have to be introduced in a different way - I have done it here by using the first reparable parameter (%1). Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
| .arg(_paid_name, | ||
| infoText = tr("Area:%1%2 ID:%1%3 x:%1%4%1<‑>%1%5 y:%1%6%1<‑>%1%7 z:%1%8%1<‑>%1%9\n", | ||
| // Intentional separator | ||
| "This text uses non-breaking spaces (as '%1's, as Qt Creator cannot handle" |
There was a problem hiding this comment.
What is this problem? lupdate has been fixed to handle C++11 string literals (finally, after 8 years...)
There was a problem hiding this comment.
https://bugreports.qt.io/browse/QTCREATORBUG-17875 converted into https://bugreports.qt.io/browse/QTBUG-56538 and then closed as a duplicate. - However the fix in the latter is not applicable/relevant for the former (I think) but no-one seems to have picked up on it - I only found this bug recently when I wanted to include some non-breaking spaces here...
There was a problem hiding this comment.
Now reported by me as: https://bugreports.qt.io/browse/QTCREATORBUG-22052 ! 😀
This was prompted by items 6, 7 and 8 of #1802 .
It add the third (integer quantity inserted into translation at
%nposition) argument needed for effective translations of quantifiable numbers of a noun in a sentence for one translation and explains the multiple replaceable parameters for all of the touched translations. As the one with %n will always be for two or more arguments there is technically no need for the single or none quantity translations if they fall outside of the different plural forms in a particular language...Signed-off-by: Stephen Lyons slysven@virginmedia.com