Skip to content

Revise 2D Mapper class to allow better translation#1810

Merged
vadi2 merged 8 commits intoMudlet:developmentfrom
SlySven:Enhance_allow2DMapperInfoDisplayToBeInternationalised
Feb 6, 2019
Merged

Revise 2D Mapper class to allow better translation#1810
vadi2 merged 8 commits intoMudlet:developmentfrom
SlySven:Enhance_allow2DMapperInfoDisplayToBeInternationalised

Conversation

@SlySven
Copy link
Copy Markdown
Member

@SlySven SlySven commented Jul 13, 2018

This was prompted by items 6, 7 and 8 of #1802 .

It add the third (integer quantity inserted into translation at %n position) 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

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
@SlySven SlySven requested a review from a team July 13, 2018 17:42
@SlySven SlySven requested a review from a team as a code owner July 13, 2018 17:42
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>
@SlySven SlySven changed the title Enhance: revise 2D Mapper information text to allow better translations Enhance: revise 2D Mapper class to allow better translation Jul 13, 2018
Copy link
Copy Markdown
Contributor

@Kebap Kebap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few remarks

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>")));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you outsource the surrounding p tag as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Kebap Kebap removed their assignment Jul 23, 2018
@Kebap Kebap changed the title Enhance: revise 2D Mapper class to allow better translation WIP. Revise 2D Mapper class to allow better translation Sep 10, 2018
@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Sep 16, 2018

@SlySven ping, would you be able to finish this up?

@Kebap Kebap changed the title WIP. Revise 2D Mapper class to allow better translation Revise 2D Mapper class to allow better translation Oct 29, 2018
@Kebap
Copy link
Copy Markdown
Contributor

Kebap commented Jan 24, 2019

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 SlySven assigned vadi2 and Kebap and unassigned SlySven Jan 24, 2019
@SlySven SlySven requested a review from a team January 24, 2019 21:58
@SlySven SlySven requested review from a team and removed request for a team January 24, 2019 21:58
Copy link
Copy Markdown
Member Author

@SlySven SlySven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things to do there then.

SlySven added a commit to SlySven/Mudlet that referenced this pull request Feb 2, 2019
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>
Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point about using { and } for human-readable text in UI's still stands - I don't see other major software using it... it's not really idiomatic design and not very aesthetic. Maybe you have examples of others using it @SlySven?

@vadi2 vadi2 removed their assignment Feb 3, 2019
Also adopted the optimum(?) `QString` initialisation process!

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty close - lets get it over and done with...

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Feb 5, 2019

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"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this problem? lupdate has been fixed to handle C++11 string literals (finally, after 8 years...)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vadi2 vadi2 merged commit 1eca7cb into Mudlet:development Feb 6, 2019
@SlySven SlySven deleted the Enhance_allow2DMapperInfoDisplayToBeInternationalised branch March 18, 2019 19:17
@SlySven SlySven restored the Enhance_allow2DMapperInfoDisplayToBeInternationalised branch June 22, 2020 18:06
@SlySven SlySven deleted the Enhance_allow2DMapperInfoDisplayToBeInternationalised branch June 22, 2020 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants