~ubuntu-branches/ubuntu/natty/unity-2d/natty-updates

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/unity2dtr.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert, Oliver Grawert, Aurélien Gâteau
  • Date: 2011-04-08 16:03:10 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20110408160310-yth7qb9kbgabkqk0
Tags: 3.8.2-0ubuntu1
[ Oliver Grawert ]
* New upstream bugfix release
 - (LP: #632526)  Dash elipsizes file and application names too soon, making them
   unreadable
 - (LP: #669926) [launcher] Web favorites support
 - (LP: #708479) Dash view should use "Prefferred Applications" icons where
   appropriate
 - (LP: #718686) [dash] Group of results sometimes badly positioned
 - (LP: #727483) unity-2d-panel crashed with SIGSEGV in g_return_if_fail_warning()
 - (LP: #731449) [launcher] Dragging a tile at the top of the launcher while
   autoscrolling makes autoscroll wrong afterwards
 - (LP: #736097) [dash] home screen misses icons for applications that are not
   installed
 - (LP: #744999) [launcher] launchers are truncated when too many items to fit
   onscreen
 - (LP: #745077) [spread] clicking launcher with open windows not working correctly
   across workspaces
 - (LP: #745237) [dash] search field default string not translated
 - (LP: #746693) [launcher] .places messages not i18nized
 - (LP: #747836) [dash] Banshee no longer works from the dash home page in 3.8.2
 - (LP: #750753) [dash] showing/hiding places causing graphical corruption
 - (LP: #670608) [dash] Home screen customization should be easy
 - (LP: #683084) Global menu doesn't work well with more than one screen
 - (LP: #714646) [launcher] icons jagged edges during animation
 - (LP: #717744) [panel] inactive menus are clickable
 - (LP: #729002) First four items in Dash begin "Find" "Find" "Find" "Find"
 - (LP: #745758) [spread] super+s should toggle the workspace switcher
 - (LP: #751284) [launcher] Escaping of title broken with webfavorites
 - (LP: #751325) [panel] circle of friends button icon needs to be updated to match
   Unity's
 - (LP: #697816) [launcher] if an urgent window is available then the spread should
   not be activated
 - (LP: #729478) [launcher] Clicking middle mouse button should launch another
   instance of application
 - (LP: #750244) [launcher] Newly installed lenses don’t appear
 - (LP: #752948) Home's "Shortcuts" not i18n/l10n

[ Aurélien Gâteau ]
* Include .mo files in unity-2d package (LP: #751425)

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    context->setContextProperty("u2d", &helper);
47
47
}
48
48
 
49
 
QString QmlHelper::tr(const QString& text)
 
49
QString QmlHelper::tr(const QString& text, const QString& domain)
50
50
{
51
 
    return ::u2dTr(text.toUtf8().constData());
 
51
    if (domain.isNull()) {
 
52
        return ::u2dTr(text.toUtf8().constData());
 
53
    } else {
 
54
        return ::u2dTr(text.toUtf8().constData(), domain.toUtf8().constData());
 
55
    }
52
56
}
53
57
 
54
 
QString QmlHelper::tr(const QString& singular, const QString& plural, int n)
 
58
QString QmlHelper::tr(const QString& singular, const QString& plural, int n, const QString& domain)
55
59
{
56
 
    return ::u2dTr(
57
 
        singular.toUtf8().constData(),
58
 
        plural.toUtf8().constData(),
59
 
        n);
 
60
    if (domain.isNull()) {
 
61
        return ::u2dTr(singular.toUtf8().constData(), plural.toUtf8().constData(), n);
 
62
    } else {
 
63
        return ::u2dTr(singular.toUtf8().constData(), plural.toUtf8().constData(), n, domain.toUtf8().constData());
 
64
    }
60
65
}
61
66
 
62
67
} // namespace
63
68
 
64
 
QString u2dTr(const char* text)
 
69
QString u2dTr(const char* text, const char* domain)
65
70
{
66
 
    return QString::fromUtf8(gettext(text));
 
71
    return QString::fromUtf8(dgettext(domain, text));
67
72
}
68
73
 
69
 
QString u2dTr(const char* singular, const char* plural, int n)
 
74
QString u2dTr(const char* singular, const char* plural, int n, const char* domain)
70
75
{
71
 
    QString text = QString::fromUtf8(ngettext(singular, plural, n));
 
76
    QString text = QString::fromUtf8(dngettext(domain, singular, plural, n));
72
77
    // Note: if `text` is "%%n" (meaning the string on screen should be "%n"
73
78
    // literally), this will fail. I think we don't care for now.
74
79
    text.replace("%n", QString::number(n));