Fix translated text
ClosedPublic

Authored by abalaji on Dec 18 2018, 1:52 PM.

Details

Summary

i18n doesn't work before QCoreApplication is created, hence statically initialized text is not translated.

Related: D12626

Diff Detail

Repository
R166 Spectacle
Branch
fix-translations
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 6132
Build 6150: arc lint + arc unit
abalaji created this revision.Dec 18 2018, 1:52 PM
Restricted Application added a project: Spectacle. · View Herald TranscriptDec 18 2018, 1:52 PM
abalaji requested review of this revision.Dec 18 2018, 1:52 PM
yurchor added inline comments.
src/QuickEditor/QuickEditor.cpp
68

Typo: seletion -> selection

abalaji updated this revision to Diff 47767.Dec 18 2018, 2:20 PM
abalaji marked an inline comment as done.
  • Fix typo

Localization folks, does this fix the issue?

Localization folks, does this fix the issue?

Yes. Before the patch, the bottom help panel was shown untranslated in Ukrainian. After the patch, it is shown translated.

However, the whole structure of the messages after 958fdc0a2532e30e7edfd1ec71f63fd3c87b5d35 is a classic case of word puzzles [1]. Anyway. it is better with this patch. So my +1.

[1] https://techbase.kde.org/Development/Tutorials/Localization/i18n_Mistakes#Pitfall_.232:_Word_Puzzles

However, the whole structure of the messages after 958fdc0a2532e30e7edfd1ec71f63fd3c87b5d35 is a classic case of word puzzles [1]. Anyway. it is better with this patch. So my +1.

Oh I see. I think lines 64-65 in particular violate this rule. Do the translators get to see the actual code, or do they just work with individual strings? In case of the former, I can leave a note to the translators in a comment.

pino added a subscriber: pino.Dec 18 2018, 5:50 PM

However, the whole structure of the messages after 958fdc0a2532e30e7edfd1ec71f63fd3c87b5d35 is a classic case of word puzzles [1]. Anyway. it is better with this patch. So my +1.

Oh I see. I think lines 64-65 in particular violate this rule. Do the translators get to see the actual code, or do they just work with individual strings? In case of the former, I can leave a note to the translators in a comment.

Translators usually work only on the strings. Please do not split them, even by new lines, if they are a single block of text with one or more sentences.

They only see a string. In the cases where a string is short or potentially ambiguous (e.g. i18n("Shift:")), it's useful to provide some context, e.g. i18nc("Keyboard modifier key", "Shift:")

abalaji updated this revision to Diff 47993.Dec 22 2018, 8:10 AM
  • Add comments to i18n strings
yurchor accepted this revision as: yurchor.Dec 22 2018, 9:30 AM
This revision is now accepted and ready to land.Dec 22 2018, 9:30 AM
ngraham accepted this revision.Dec 22 2018, 4:28 PM
This revision was automatically updated to reflect the committed changes.