Commit c52677d6 authored by Albert Astals Cid's avatar Albert Astals Cid

Load translations

We need to define the TRANSLATION_DOMAIN for the .cpp parts since it's a
library (could also replace i18n with i18nd but this is simpler)

For qml there's no TRANSLATION_DOMAIN to i18n -> i18nd and i18nc ->
i18ndc
parent 9a41655f
add_definitions(-DTRANSLATION_DOMAIN="kaccounts-integration")
add_subdirectory(kded)
add_subdirectory(lib)
add_subdirectory(declarative)
......
......@@ -17,7 +17,7 @@ import org.kde.kaccounts 1.2 as KAccounts
ScrollViewKCM {
id: component;
title: i18n("Account Details")
title: i18nd("kaccounts-integration", "Account Details")
property alias model: servicesList.model
......@@ -56,11 +56,11 @@ ScrollViewKCM {
Layout.fillWidth: true
text: {
if (model.accountDisplayName.length > 0 && model.accountProviderName.length > 0) {
return i18n("%1 (%2)", model.accountDisplayName, model.accountProviderName)
return i18nd("kaccounts-integration", "%1 (%2)", model.accountDisplayName, model.accountProviderName)
} else if (model.accountDisplayName.length > 0) {
return model.accountDisplayName
} else {
return i18n("%1 account", model.accountProviderName)
return i18nd("kaccounts-integration", "%1 account", model.accountProviderName)
}
}
}
......@@ -70,7 +70,7 @@ ScrollViewKCM {
Layout.preferredWidth: Kirigami.Units.iconSizes.large
onClicked: accountRenamer.open();
Controls.ToolTip {
text: i18nc("Button which spawns a dialog allowing the user to change the displayed account's human-readable name", "Change Account Display Name")
text: i18ndc("kaccounts-integration", "Button which spawns a dialog allowing the user to change the displayed account's human-readable name", "Change Account Display Name")
}
}
}
......@@ -78,14 +78,14 @@ ScrollViewKCM {
leftPadding: Kirigami.Units.smallSpacing
visible: servicesList.count > 0
level: 3
text: i18nc("Heading for a list of services available with this account", "Use This Account For")
text: i18ndc("kaccounts-integration", "Heading for a list of services available with this account", "Use This Account For")
}
}
footer: RowLayout {
Controls.Button {
Layout.alignment: Qt.AlignRight
text: i18n("Remove This Account")
text: i18nd("kaccounts-integration", "Remove This Account")
icon.name: "edit-delete-remove"
onClicked: accountRemover.open();
}
......@@ -107,7 +107,7 @@ ScrollViewKCM {
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
text: i18nc("A text shown when an account has no configurable services", "There are no configurable services available for this account. You can still change its display name by clicking the edit icon above.")
text: i18ndc("kaccounts-integration", "A text shown when an account has no configurable services", "There are no configurable services available for this account. You can still change its display name by clicking the edit icon above.")
}
}
......
......@@ -44,18 +44,18 @@ ScrollViewKCM {
Layout.fillWidth: true
text: {
if (model.displayName.length > 0 && model.providerName.length > 0) {
return i18n("%1 (%2)", model.displayName, model.providerName)
return i18nd("kaccounts-integration", "%1 (%2)", model.displayName, model.providerName)
} else if (model.displayName.length > 0) {
return model.displayName
} else {
return i18n("%1 account", model.providerName)
return i18nd("kaccounts-integration", "%1 account", model.providerName)
}
}
}
}
actions: [
Kirigami.Action {
text: i18nc("Tooltip for an action which will offer the user to remove the mentioned account", "Remove %1", accountDelegate.contentItem.text)
text: i18ndc("kaccounts-integration", "Tooltip for an action which will offer the user to remove the mentioned account", "Remove %1", accountDelegate.contentItem.text)
iconName: "edit-delete-remove"
onTriggered: {
accountRemover.accountId = model.id;
......@@ -72,10 +72,10 @@ ScrollViewKCM {
visible: view.count === 0
anchors.centerIn: parent
width: parent.width - (Kirigami.Units.largeSpacing * 4)
text: i18nc("A text shown when a user has not yet added any accounts", "No accounts added yet")
text: i18ndc("kaccounts-integration", "A text shown when a user has not yet added any accounts", "No accounts added yet")
helpfulAction: Kirigami.Action {
text: i18n("Add New Account...")
text: i18nd("kaccounts-integration", "Add New Account...")
icon.name: "contact-new"
onTriggered: kcm.push("AvailableAccounts.qml")
}
......@@ -91,7 +91,7 @@ ScrollViewKCM {
Controls.Button {
visible: !noAccountsLayout.visible
Layout.alignment: Qt.AlignRight
text: i18n("Add New Account...")
text: i18nd("kaccounts-integration", "Add New Account...")
icon.name: "contact-new"
onClicked: kcm.push("AvailableAccounts.qml")
}
......
......@@ -16,7 +16,7 @@ import org.kde.kaccounts 1.2 as KAccounts
ScrollViewKCM {
id: root
title: i18n("Add New Account")
title: i18nd("kaccounts-integration", "Add New Account")
header: Kirigami.InlineMessage {
id: errorMessage
......
......@@ -17,19 +17,19 @@ MessageBoxSheet {
property string displayName
property string providerName
signal accountRemoved()
title: i18nc("The title for a dialog which lets you remove an account", "Remove Account?")
title: i18ndc("kaccounts-integration", "The title for a dialog which lets you remove an account", "Remove Account?")
text: {
if (displayName.length > 0 && providerName.length > 0) {
return i18nc("The text for a dialog which lets you remove an account when both provider name and account name are available", "Are you sure you wish to remove the \"%1\" account \"%2\"?", providerName, displayName)
return i18ndc("kaccounts-integration", "The text for a dialog which lets you remove an account when both provider name and account name are available", "Are you sure you wish to remove the \"%1\" account \"%2\"?", providerName, displayName)
} else if (displayName.length > 0) {
return i18nc("The text for a dialog which lets you remove an account when only the account name is available", "Are you sure you wish to remove the account \"%1\"?", displayName)
return i18ndc("kaccounts-integration", "The text for a dialog which lets you remove an account when only the account name is available", "Are you sure you wish to remove the account \"%1\"?", displayName)
} else {
return i18nc("The text for a dialog which lets you remove an account when only the provider name is available", "Are you sure you wish to remove this \"%1\" account?", providerName)
return i18ndc("kaccounts-integration", "The text for a dialog which lets you remove an account when only the provider name is available", "Are you sure you wish to remove this \"%1\" account?", providerName)
}
}
actions: [
Kirigami.Action {
text: i18nc("The label for a button which will cause the removal of a specified account", "Remove Account")
text: i18ndc("kaccounts-integration", "The label for a button which will cause the removal of a specified account", "Remove Account")
onTriggered: {
var job = accountRemovalJob.createObject(component, { "accountId": component.accountId });
job.start();
......
......@@ -14,7 +14,7 @@ import org.kde.kaccounts 1.2 as KAccounts
MessageBoxSheet {
id: component
title: i18nc("The title for a dialog which lets you set the human-readable name of an account", "Rename Account")
title: i18ndc("kaccounts-integration", "The title for a dialog which lets you set the human-readable name of an account", "Rename Account")
property int accountId
property string currentDisplayName
signal accountRenamed()
......@@ -28,13 +28,13 @@ MessageBoxSheet {
Layout.margins: Kirigami.Units.largeSpacing
Controls.TextField {
id: newAccountDisplayName
Kirigami.FormData.label: i18nc("Label for the text field used to enter a new human-readable name for an account", "Enter new name:")
Kirigami.FormData.label: i18ndc("kaccounts-integration", "Label for the text field used to enter a new human-readable name for an account", "Enter new name:")
}
}
actions: [
Kirigami.Action {
enabled: newAccountDisplayName.text.length > 0 && newAccountDisplayName.text !== component.currentDisplayName
text: i18nc("Text of a button which will cause the human-readable name of an account to be set to a text specified by the user", "Set Account Name")
text: i18ndc("kaccounts-integration", "Text of a button which will cause the human-readable name of an account to be set to a text specified by the user", "Set Account Name")
onTriggered: {
var job = accountDisplayNameJob.createObject(component, { "accountId": component.accountId, "displayName": newAccountDisplayName.text })
job.start();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment