Change strings to address i18n issues

Review Request #129568 - Created Nov. 27, 2016 and updated

Information
Peter Wu
spectacle
5e82662...
Reviewers
kdegraphics
aacid, bgupta

Change strings to address i18n issues

Change "Preferences" to "Configure" (window title) and use a
KStandardAction::preferences item (and get the "Configure Spectacle..."
text for free).

Add TODO comment for inconsistent use of "screen" and "monitors", this
requires more changes beyond changing text.

Checked text under Save menu (icon has also changed), Configure dialog.

Issues

  • 2
  • 2
  • 0
  • 4
Description From Last Updated
Can you try if you can just use a KConfigDialog instead of a KPageDialog and then this translation comes in ... Albert Astals Cid Albert Astals Cid
is there a reason this really needs to be a double? Is it critical to be able to take a ... Albert Astals Cid Albert Astals Cid
Boudhayan Gupta
Albert Astals Cid
Albert Astals Cid
Peter Wu
Peter Wu
Review request changed

Change Summary:

Oops, accidentally dropped Albert from reviewers. Re-added. Also, do you want to add this to the 5.9 branch?

People:

+aacid
Albert Astals Cid

   
src/Gui/SmartSpinBox.cpp (Diff revision 2)
 
 

is there a reason this really needs to be a double?

Is it critical to be able to take a screenshot in 2.4 seconds?

If it is, this thing should probably look like

if (val == (int)val) {
// it's an integer
setSuffix(i18np(" second", " seconds", int(val)));
} else {
// it's a decimal number
setSuffix(i18n(" seconds"));
}

  1. Being able to take a screenshot after 100ms (ASAP, but allowing the cursor to be moved for example) might be a valid use case.

    What is the reason for adding a special case for decimal numbers? I am following the suggestion from https://bugs.kde.org/show_bug.cgi?id=341692#c5 to use floor(val). Your suggestion would result in "1.1 seconds" while Alexander thinks it should be "1.1 second".

  2. I don't know why you reopened that bug.

    The solution was clear, the only people that need different forms for plurals are scottish gaelic, and they are using scripted translations to handle that, so i18n(" seconds") is fine for them.

    Please tell me why what I suggested doesn't work.

  3. I reopened that bug since i18np(" second", " seconds", double(val)) does not work when the value is a real number instead of an integer (bug?). The API silently ignores the value and assumes value zero IIRC.

    Now that I read Alexander's comment again, it seems that some languages really have a different translations for non-integer values (point "2" in his comment, the "else" branch in your suggestion). Is that a correct understanding?

  4. The solution was clear, the only people that need different forms for plurals are scottish gaelic, and they are using scripted translations to handle that, so i18n(" seconds") is fine for them.

    Albert,

    I don't think it's scriptable because the string " seconds" (as in your i18n(" seconds")) does not have enough information to determine the plural form for Scottish Gaelic.

    What Chusslove suggested in https://bugs.kde.org/show_bug.cgi?id=341692#c1 does only work when you have i18np("some string", value).

  5. So basically you're saying we can't produce a proper plural for Scottish Gaelic if using decimal numbers, i don't see how this should block this code review specifically since there's probably lots of places in our code with this issue.

  6. ping?

  7. So basically you're saying we can't produce a proper plural for Scottish Gaelic if using decimal numbers,

    Wrong. Like said in https://bugs.kde.org/show_bug.cgi?id=341692 , "real numbers behave like their floors in respect to plural forms", thus you can produce proper plurals for Scottish Gaelic if using integer numbers. But you can't produce proper Russian plurals using integers.

    BTW, decimal != integer.

    i don't see how this should block this code review specifically since there's probably lots of places in our code with this issue.

    This code review can be merged as it probably doesn't make things much worse for most languages. However, for English "0.5 second" becomes "0.5 seconds" which may be bad.

  8. Like said in https://bugs.kde.org/show_bug.cgi?id=341692 , "real numbers behave like their floors in respect to plural forms", thus you can produce proper plurals for Scottish Gaelic if using integer numbers. But you can't produce proper Russian plurals using integers.

    I can't parse this sentence.

    However, for English "0.5 second" becomes "0.5 seconds" which may be bad.

    0.5 seconds is the correct way to say it

  9. To clear this up I made this table which tells how many word forms we should have for these languages:

    N | Russian form | Scottish Gaelic form
    0 | Z | D
    0.5 | Y (same for all decimals) | D (same as for 0)
    1 | X | A
    1.5 | Y (same for all decimals) | A (same as for 1)
    2 | Y | B
    2.5 | Y (same for all decimals) | B (same as for 2)
    3 | Y | C
    5 | Z | C
    100 | Z | D
    100.5 | Y (same for all decimals) | D (same as for 100)

    This may work:

    if (val == (int)val) {
    // it's an integer
    setSuffix(i18ncp("integer number", " second", " seconds", int(val)));
    } else {
    // it's a decimal number
    setSuffix(i18ncp("decimal number, %1=floor of the number", " seconds", " seconds", int(val)));
    }

Loading...