mostly setting the correct translation domain
wilder-5.14
Lukáš Tinkl 12 years ago
parent bfebf2fb2e
commit 01853d48d8
  1. 2
      ksmserver/CMakeLists.txt
  2. 1
      ksmserver/client.h
  3. 2
      ksmserver/legacy.cpp
  4. 71
      ksmserver/main.cpp
  5. 3
      ksmserver/screenlocker/CMakeLists.txt
  6. 3
      ksmserver/screenlocker/greeter/CMakeLists.txt
  7. 6
      ksmserver/screenlocker/greeter/fallbacktheme/Greeter.qml
  8. 10
      ksmserver/screenlocker/greeter/fallbacktheme/SessionSwitching.qml
  9. 4
      ksmserver/screenlocker/greeter/main.cpp
  10. 3
      ksmserver/server.cpp
  11. 2
      ksmserver/server.h
  12. 7
      ksmserver/startup.cpp
  13. 10
      ksmserver/themes/contour/main.qml

@ -1,5 +1,7 @@
project(ksmserver) project(ksmserver)
add_definitions(-DTRANSLATION_DOMAIN=\"ksmserver\")
add_subdirectory( tests ) add_subdirectory( tests )
# #
if(NOT WIN32) if(NOT WIN32)

@ -28,7 +28,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// needed to avoid clash with INT8 defined in X11/Xmd.h on solaris // needed to avoid clash with INT8 defined in X11/Xmd.h on solaris
#define QT_CLEAN_NAMESPACE 1 #define QT_CLEAN_NAMESPACE 1
#include <kapplication.h>
#include <kworkspace.h> #include <kworkspace.h>
#include "server.h" #include "server.h"

@ -44,7 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <kconfig.h> #include <kconfig.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <kglobal.h> #include <KSharedConfig>
#include <kshell.h> #include <kshell.h>
#include <kdebug.h> #include <kdebug.h>
#include <kwindowsystem.h> #include <kwindowsystem.h>

@ -33,14 +33,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <KMessageBox> #include <KMessageBox>
#include <QtDBus/QtDBus> #include <QtDBus/QtDBus>
#include <k4aboutdata.h>
#include <kcmdlineargs.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <kdbusservice.h> #include <kdbusservice.h>
#include <kdebug.h> #include <kdebug.h>
#include <klocale.h> #include <KLocalizedString>
#include <kglobal.h>
#include <kconfig.h> #include <kconfig.h>
#include <KSharedConfig>
#include <kmanagerselection.h> #include <kmanagerselection.h>
#include <kwindowsystem.h> #include <kwindowsystem.h>
#include "server.h" #include "server.h"
@ -135,47 +133,47 @@ void checkComposite()
void sanity_check( int argc, char* argv[] ) void sanity_check( int argc, char* argv[] )
{ {
QString msg; QString msg;
QByteArray path = getenv("HOME"); QByteArray path = qgetenv("HOME");
QByteArray readOnly = getenv("KDE_HOME_READONLY"); const QByteArray readOnly = qgetenv("KDE_HOME_READONLY");
if (path.isEmpty()) if (path.isEmpty())
{ {
msg = QLatin1String("$HOME not set!"); msg = i18n("$HOME not set!");
} }
if (msg.isEmpty() && access(path.data(), W_OK)) if (msg.isEmpty() && access(path.data(), W_OK))
{ {
if (errno == ENOENT) if (errno == ENOENT)
msg = QStringLiteral("$HOME directory (%1) does not exist."); msg = i18n("$HOME directory (%1) does not exist.");
else if (readOnly.isEmpty()) else if (readOnly.isEmpty())
msg = QStringLiteral("No write access to $HOME directory (%1)."); msg = i18n("No write access to $HOME directory (%1).");
} }
if (msg.isEmpty() && access(path.data(), R_OK)) if (msg.isEmpty() && access(path.data(), R_OK))
{ {
if (errno == ENOENT) if (errno == ENOENT)
msg = QStringLiteral("$HOME directory (%1) does not exist."); msg = i18n("$HOME directory (%1) does not exist.");
else else
msg = QStringLiteral("No read access to $HOME directory (%1)."); msg = i18n("No read access to $HOME directory (%1).");
} }
if (msg.isEmpty() && readOnly.isEmpty() && !writeTest(path)) if (msg.isEmpty() && readOnly.isEmpty() && !writeTest(path))
{ {
if (errno == ENOSPC) if (errno == ENOSPC)
msg = QStringLiteral("$HOME directory (%1) is out of disk space."); msg = i18n("$HOME directory (%1) is out of disk space.");
else else
msg = QStringLiteral("Writing to the $HOME directory (%1) failed with\n " msg = i18n("Writing to the $HOME directory (%2) failed with "
"the error '")+QString::fromLocal8Bit(strerror(errno))+QStringLiteral("'"); "the error '%1'", QString::fromLocal8Bit(strerror(errno)));
} }
if (msg.isEmpty()) if (msg.isEmpty())
{ {
path = getenv("ICEAUTHORITY"); path = getenv("ICEAUTHORITY");
if (path.isEmpty()) if (path.isEmpty())
{ {
path = getenv("HOME"); path = qgetenv("HOME");
path += "/.ICEauthority"; path += "/.ICEauthority";
} }
if (access(path.data(), W_OK) && (errno != ENOENT)) if (access(path.data(), W_OK) && (errno != ENOENT))
msg = QStringLiteral("No write access to '%1'."); msg = i18n("No write access to '%1'.");
else if (access(path.data(), R_OK) && (errno != ENOENT)) else if (access(path.data(), R_OK) && (errno != ENOENT))
msg = QStringLiteral("No read access to '%1'."); msg = i18n("No read access to '%1'.");
} }
if (msg.isEmpty()) if (msg.isEmpty())
{ {
@ -185,10 +183,10 @@ void sanity_check( int argc, char* argv[] )
if (!writeTest(path)) if (!writeTest(path))
{ {
if (errno == ENOSPC) if (errno == ENOSPC)
msg = QStringLiteral("Temp directory (%1) is out of disk space."); msg = i18n("Temp directory (%1) is out of disk space.");
else else
msg = QStringLiteral("Writing to the temp directory (%1) failed with\n " msg = i18n("Writing to the temp directory (%2) failed with\n "
"the error '")+QString::fromLocal8Bit(strerror(errno))+QStringLiteral("'"); "the error '%1'", QString::fromLocal8Bit(strerror(errno)));
} }
} }
if (msg.isEmpty() && (path != "/tmp")) if (msg.isEmpty() && (path != "/tmp"))
@ -197,36 +195,35 @@ void sanity_check( int argc, char* argv[] )
if (!writeTest(path)) if (!writeTest(path))
{ {
if (errno == ENOSPC) if (errno == ENOSPC)
msg = QStringLiteral("Temp directory (%1) is out of disk space."); msg = i18n("Temp directory (%1) is out of disk space.");
else else
msg = QStringLiteral("Writing to the temp directory (%1) failed with\n " msg = i18n("Writing to the temp directory (%2) failed with\n "
"the error '")+QString::fromLocal8Bit(strerror(errno))+QStringLiteral("'"); "the error '%1'", QString::fromLocal8Bit(strerror(errno)));
} }
} }
if (msg.isEmpty()) if (msg.isEmpty())
{ {
path += "/.ICE-unix"; path += "/.ICE-unix";
if (access(path.data(), W_OK) && (errno != ENOENT)) if (access(path.data(), W_OK) && (errno != ENOENT))
msg = QStringLiteral("No write access to '%1'."); msg = i18n("No write access to '%1'.");
else if (access(path.data(), R_OK) && (errno != ENOENT)) else if (access(path.data(), R_OK) && (errno != ENOENT))
msg = QStringLiteral("No read access to '%1'."); msg = i18n("No read access to '%1'.");
} }
if (!msg.isEmpty()) if (!msg.isEmpty())
{ {
const char *msg_pre = msg = msg.arg(QFile::decodeName(path));
"The following installation problem was detected\n" const QString msg_pre =
"while trying to start KDE:" i18n("The following installation problem was detected\n"
"while trying to start KDE:") +
"\n\n "; "\n\n ";
const char *msg_post = "\n\nKDE is unable to start.\n"; const QString msg_post = i18n("\n\nKDE is unable to start.\n");
fputs(msg_pre, stderr); fputs(msg_pre.toUtf8().constData(), stderr);
fprintf(stderr, "%s", qPrintable(msg.arg(QFile::decodeName(path)))); fprintf(stderr, "%s", msg.toUtf8().constData());
fputs(msg_post, stderr); fputs(msg_post.toUtf8().constData(), stderr);
QApplication a(argc, argv); QApplication a(argc, argv);
QString qmsg = QString::fromLatin1(msg_pre) + const QString qmsg = msg_pre + msg + msg_post;
msg.arg(QFile::decodeName(path)) + KMessageBox::error(0, qmsg, i18n("Plasma Workspace installation problem!"));
QString::fromLatin1(msg_post);
KMessageBox::error(0, qmsg, QStringLiteral("KDE Workspace installation problem!"));
exit(255); exit(255);
} }
} }
@ -250,7 +247,7 @@ extern "C" Q_DECL_EXPORT int kdemain( int argc, char* argv[] )
a->setQuitOnLastWindowClosed(false); // #169486 a->setQuitOnLastWindowClosed(false); // #169486
QCommandLineParser parser; QCommandLineParser parser;
parser.setApplicationDescription(QString::fromLatin1(description)); parser.setApplicationDescription(i18n(description));
parser.addHelpOption(); parser.addHelpOption();
parser.addVersionOption(); parser.addVersionOption();

@ -1,3 +1,6 @@
remove_definitions(-DTRANSLATION_DOMAIN=\"ksmserver\")
add_definitions(-DTRANSLATION_DOMAIN=\"kscreenlocker\")
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1223) add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1223)
add_subdirectory(kcheckpass) add_subdirectory(kcheckpass)
add_subdirectory(greeter) add_subdirectory(greeter)

@ -1,3 +1,6 @@
remove_definitions(-DTRANSLATION_DOMAIN=\"kscreenlocker\")
add_definitions(-DTRANSLATION_DOMAIN=\"kscreenlocker_greet\")
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${KCheckPass_SOURCE_DIR}/kcheckpass ${KCheckPass_SOURCE_DIR}/kcheckpass

@ -102,7 +102,7 @@ Item {
AccelButton { AccelButton {
id: switchUser id: switchUser
label: i18n("&Switch Users") label: i18nd("kscreenlocker_greet", "&Switch Users")
iconSource: "fork" iconSource: "fork"
visible: switchUserEnabled visible: switchUserEnabled
onClicked: switchUserClicked() onClicked: switchUserClicked()
@ -110,7 +110,7 @@ Item {
AccelButton { AccelButton {
id: unlock id: unlock
label: i18n("Un&lock") label: i18nd("kscreenlocker_greet", "Un&lock")
iconSource: "object-unlocked" iconSource: "object-unlocked"
enabled: !authenticator.graceLocked enabled: !authenticator.graceLocked
onClicked: authenticator.tryUnlock(password.text) onClicked: authenticator.tryUnlock(password.text)
@ -147,7 +147,7 @@ Item {
Connections { Connections {
target: authenticator target: authenticator
onFailed: { onFailed: {
root.notification = i18n("Unlocking failed"); root.notification = i18nd("kscreenlocker_greet", "Unlocking failed");
} }
onGraceLockedChanged: { onGraceLockedChanged: {
if (!authenticator.graceLocked) { if (!authenticator.graceLocked) {

@ -52,7 +52,7 @@ Item {
delegate: PlasmaComponents.ListItem { delegate: PlasmaComponents.ListItem {
content: PlasmaComponents.Label { content: PlasmaComponents.Label {
text: i18nc("thesession name and the location where the session is running (what vt)", "%1 (%2)", session, location) text: i18ndc("kscreenlocker_greet", "thesession name and the location where the session is running (what vt)", "%1 (%2)", session, location)
} }
} }
highlight: PlasmaComponents.Highlight { highlight: PlasmaComponents.Highlight {
@ -73,7 +73,7 @@ Item {
PlasmaComponents.Label { PlasmaComponents.Label {
id: explainText id: explainText
text: i18n("The current session will be hidden " + text: i18nd("kscreenlocker_greet", "The current session will be hidden " +
"and a new login screen or an existing session will be displayed.\n" + "and a new login screen or an existing session will be displayed.\n" +
"An F-key is assigned to each session; " + "An F-key is assigned to each session; " +
"F%1 is usually assigned to the first session, " + "F%1 is usually assigned to the first session, " +
@ -98,7 +98,7 @@ Item {
AccelButton { AccelButton {
id: activateSession id: activateSession
label: i18n("Activate") label: i18nd("kscreenlocker_greet", "Activate")
iconSource: "fork" iconSource: "fork"
onClicked: { onClicked: {
sessions.activateSession(userSessionsView.currentIndex); sessions.activateSession(userSessionsView.currentIndex);
@ -107,7 +107,7 @@ Item {
} }
AccelButton { AccelButton {
id: newSession id: newSession
label: i18n("Start New Session") label: i18nd("kscreenlocker_greet", "Start New Session")
iconSource: "fork" iconSource: "fork"
visible: sessions.startNewSessionSupported visible: sessions.startNewSessionSupported
onClicked: { onClicked: {
@ -117,7 +117,7 @@ Item {
} }
AccelButton { AccelButton {
id: cancelSession id: cancelSession
label: i18n("Cancel") label: i18nd("kscreenlocker_greet", "Cancel")
iconSource: "dialog-cancel" iconSource: "dialog-cancel"
onClicked: cancel() onClicked: cancel()
} }

@ -50,6 +50,8 @@ static void signalHandler(int signum)
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
KLocalizedString::setApplicationDomain("kscreenlocker_greet");
ScreenLocker::UnlockApp app(argc, argv); ScreenLocker::UnlockApp app(argc, argv);
QCoreApplication::setApplicationName(QStringLiteral("kscreenlocker_greet")); QCoreApplication::setApplicationName(QStringLiteral("kscreenlocker_greet"));
QCoreApplication::setApplicationVersion(QStringLiteral("0.1")); QCoreApplication::setApplicationVersion(QStringLiteral("0.1"));
@ -69,7 +71,7 @@ int main(int argc, char* argv[])
QStringLiteral("milliseconds"), QStringLiteral("milliseconds"),
QStringLiteral("0")); QStringLiteral("0"));
QCommandLineOption nolockOption(QStringLiteral("nolock"), QCommandLineOption nolockOption(QStringLiteral("nolock"),
i18n("Don't show any lock user interface.")); i18n("Don't show any lock user interface."));
parser.addOption(testingOption); parser.addOption(testingOption);
parser.addOption(immediateLockOption); parser.addOption(immediateLockOption);

@ -73,7 +73,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <kactioncollection.h> #include <kactioncollection.h>
#include <kauthorized.h> #include <kauthorized.h>
#include <klocale.h> #include <klocale.h>
#include <kglobal.h>
#include <kconfig.h> #include <kconfig.h>
#include <kdesktopfile.h> #include <kdesktopfile.h>
#include <kapplication.h> #include <kapplication.h>
@ -612,8 +611,6 @@ KSMServer::KSMServer( const QString& windowManager, bool _only_local, bool locks
, logoutEffectWidget( NULL ) , logoutEffectWidget( NULL )
{ {
#ifdef COMPILE_SCREEN_LOCKER #ifdef COMPILE_SCREEN_LOCKER
KGlobal::locale()->insertCatalog(QLatin1String( "libkworkspace" ));
ScreenLocker::KSldApp::self(); ScreenLocker::KSldApp::self();
if (lockscreen) { if (lockscreen) {
ScreenLocker::KSldApp::self()->lock(ScreenLocker::EstablishLock::Immediate); ScreenLocker::KSldApp::self()->lock(ScreenLocker::EstablishLock::Immediate);

@ -44,9 +44,9 @@ extern "C" {
#include <QStringList> #include <QStringList>
#include <QObject> #include <QObject>
#include <kapplication.h>
#include <kworkspace.h> #include <kworkspace.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <KConfigGroup>
#include <QTimer> #include <QTimer>
#include <QTime> #include <QTime>
#include <QMap> #include <QMap>

@ -29,7 +29,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************/ ******************************************************************/
#include <kglobalsettings.h>
#include <QDir> #include <QDir>
#include <krun.h> #include <krun.h>
#include <config-workspace.h> #include <config-workspace.h>
@ -58,17 +57,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <limits.h> #include <limits.h>
#endif #endif
#include <QPushButton>
#include <QTimer> #include <QTimer>
#include <QtDBus/QtDBus> #include <QtDBus/QtDBus>
#include <klocale.h>
#include <kglobal.h>
#include <kconfig.h> #include <kconfig.h>
#include <kapplication.h>
#include <ktemporaryfile.h>
#include <knotification.h> #include <knotification.h>
#include <kconfiggroup.h> #include <kconfiggroup.h>
#include <KSharedConfig>
#include <kprocess.h> #include <kprocess.h>
#include "global.h" #include "global.h"

@ -70,8 +70,8 @@ PlasmaCore.FrameSvgItem {
running = false running = false
sleepButton.clicked(null) sleepButton.clicked(null)
} }
automaticallyDoLabel.text = i18np("Sleeping in 1 second", automaticallyDoLabel.text = i18ndp("ksmserver", "Sleeping in 1 second",
"Sleeping in %1 seconds", automaticallyDoSeconds) "Sleeping in %1 seconds", automaticallyDoSeconds)
--automaticallyDoSeconds; --automaticallyDoSeconds;
} }
} }
@ -103,7 +103,7 @@ PlasmaCore.FrameSvgItem {
id: lockScreenButton id: lockScreenButton
iconSource: "system-lock-screen" iconSource: "system-lock-screen"
iconSize: shutdownUi.iconSize iconSize: shutdownUi.iconSize
text: i18n("Lock") text: i18nd("ksmserver", "Lock")
font.pixelSize: 1.5*automaticallyDoLabel.font.pixelSize font.pixelSize: 1.5*automaticallyDoLabel.font.pixelSize
onClicked: { onClicked: {
@ -117,7 +117,7 @@ PlasmaCore.FrameSvgItem {
id: sleepButton id: sleepButton
iconSource: "system-suspend" iconSource: "system-suspend"
iconSize: shutdownUi.iconSize iconSize: shutdownUi.iconSize
text: i18n("Sleep") text: i18n("ksmserver", "Sleep")
font.pixelSize: 1.5*automaticallyDoLabel.font.pixelSize font.pixelSize: 1.5*automaticallyDoLabel.font.pixelSize
onClicked: { onClicked: {
@ -137,7 +137,7 @@ PlasmaCore.FrameSvgItem {
id: shutdownButton id: shutdownButton
iconSource: "system-shutdown" iconSource: "system-shutdown"
iconSize: shutdownUi.iconSize iconSize: shutdownUi.iconSize
text: i18n("Turn off") text: i18nd("ksmserver", "Turn off")
font.pixelSize: 1.5*automaticallyDoLabel.font.pixelSize font.pixelSize: 1.5*automaticallyDoLabel.font.pixelSize
onClicked: { onClicked: {

Loading…
Cancel
Save