diff options
| author | Andrew Branson <andrew.branson@jolla.com> | 2026-02-10 21:14:11 +0100 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@jolla.com> | 2026-02-10 22:09:19 +0100 |
| commit | da91be4961962536c7ff021ec97674996a1cb8d0 (patch) | |
| tree | 04fef71468c3ba3611701eed57e163172aefc453 | |
| parent | 0b9869b23af94f1935839568d62fa7b849f9e5d0 (diff) | |
translation
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | rpm/sailfish-account-mastodon.spec | 14 | ||||
| -rw-r--r-- | settings/accounts/ui/MastodonSettingsDisplay.qml | 7 | ||||
| -rw-r--r-- | settings/accounts/ui/mastodon-settings.qml | 16 | ||||
| -rw-r--r-- | settings/accounts/ui/mastodon.qml | 52 |
5 files changed, 75 insertions, 15 deletions
@@ -44,6 +44,7 @@ Sailfish OS account integration for Mastodon. - `eventsview-extensions-mastodon` - `transferengine-plugin-mastodon` - Main package requires all feature subpackages. +- `%qmake5_install` already installs icon outputs from the `icons/` subproject; avoid a second explicit `icons` `make install` in `%install`. ### Root project - `sailfish-account-mastodon.pro` ties subprojects together. diff --git a/rpm/sailfish-account-mastodon.spec b/rpm/sailfish-account-mastodon.spec index 1187379..e1afb1a 100644 --- a/rpm/sailfish-account-mastodon.spec +++ b/rpm/sailfish-account-mastodon.spec @@ -72,6 +72,14 @@ Requires: %{name} = %{version}-%{release} %description -n transferengine-plugin-mastodon Mastodon image sharing plugin for Transfer Engine. +%package -n sailfish-account-mastodon-ts-devel +Summary: Translation source files for sailfish-account-mastodon +Requires: %{name} = %{version}-%{release} +Requires: eventsview-extensions-mastodon = %{version}-%{release} + +%description -n sailfish-account-mastodon-ts-devel +Translation source files for sailfish-account-mastodon components. + %prep %setup -q -n %{name}-%{version} @@ -81,8 +89,6 @@ Mastodon image sharing plugin for Transfer Engine. %install %qmake5_install -cd icons -make INSTALL_ROOT=%{buildroot} install %post /sbin/ldconfig @@ -106,6 +112,7 @@ fi %{_datadir}/accounts/ui/mastodon.qml %{_datadir}/accounts/ui/mastodon-settings.qml %{_datadir}/accounts/ui/mastodon-update.qml +%{_datadir}/translations/settings-accounts-mastodon_eng_en.qm %{_datadir}/themes/sailfish-default/silica/*/icons/icon-l-mastodon.png %files -n buteo-sync-plugin-mastodon-posts @@ -123,6 +130,9 @@ fi %{_datadir}/lipstick/eventfeed/mastodon-delegate.qml %{_datadir}/lipstick/eventfeed/MastodonFeedItem.qml %{_datadir}/translations/lipstick-jolla-home-mastodon_eng_en.qm + +%files -n sailfish-account-mastodon-ts-devel +%{_datadir}/translations/source/settings-accounts-mastodon.ts %{_datadir}/translations/source/lipstick-jolla-home-mastodon.ts %files -n transferengine-plugin-mastodon diff --git a/settings/accounts/ui/MastodonSettingsDisplay.qml b/settings/accounts/ui/MastodonSettingsDisplay.qml index be79e3a..a9e2c5a 100644 --- a/settings/accounts/ui/MastodonSettingsDisplay.qml +++ b/settings/accounts/ui/MastodonSettingsDisplay.qml @@ -28,6 +28,13 @@ StandardAccountSettingsDisplay { syncServicesRepeater.model = syncServices otherServicesDisplay.serviceModel = otherServices + var credentialsUserName = root.account.defaultCredentialsUserName + ? root.account.defaultCredentialsUserName.toString().trim() + : "" + if (credentialsUserName.length > 0 && root.account.displayName !== credentialsUserName) { + root.account.displayName = credentialsUserName + } + var autoSync = root.account.configurationValues("")["FeedViewAutoSync"] var isNewAccount = root.autoEnableAccount eventsSyncSwitch.checked = (isNewAccount || autoSync === true) diff --git a/settings/accounts/ui/mastodon-settings.qml b/settings/accounts/ui/mastodon-settings.qml index ae79ce4..630f51d 100644 --- a/settings/accounts/ui/mastodon-settings.qml +++ b/settings/accounts/ui/mastodon-settings.qml @@ -6,6 +6,21 @@ import com.jolla.settings.accounts 1.0 AccountSettingsAgent { id: root + property string accountSubtitle: { + var credentialsUserName = account.defaultCredentialsUserName + ? account.defaultCredentialsUserName.toString().trim() + : "" + if (credentialsUserName.length > 0) { + return credentialsUserName + } + return account.displayName + } + + Account { + id: account + identifier: root.accountId + } + initialPage: Page { onPageContainerChanged: { if (pageContainer == null && !credentialsUpdater.running) { @@ -46,6 +61,7 @@ AccountSettingsAgent { PageHeader { id: header title: root.accountsHeaderText + description: root.accountSubtitle } MastodonSettingsDisplay { diff --git a/settings/accounts/ui/mastodon.qml b/settings/accounts/ui/mastodon.qml index a789459..736e82e 100644 --- a/settings/accounts/ui/mastodon.qml +++ b/settings/accounts/ui/mastodon.qml @@ -76,7 +76,8 @@ AccountCreationAgent { } if (xhr.status < 200 || xhr.status >= 300) { - _showRegistrationError("Failed to register Mastodon app for " + apiHost, busyPage) + //% "Failed to register Mastodon app for %1" + _showRegistrationError(qsTrId("settings-accounts-mastodon-la-register_app_failed").arg(apiHost), busyPage) return } @@ -84,12 +85,14 @@ AccountCreationAgent { try { response = JSON.parse(xhr.responseText) } catch (err) { - _showRegistrationError("Invalid Mastodon app registration response", busyPage) + //% "Invalid Mastodon app registration response" + _showRegistrationError(qsTrId("settings-accounts-mastodon-la-invalid_app_registration_response"), busyPage) return } if (!response.client_id || !response.client_secret) { - _showRegistrationError("Mastodon app registration did not return credentials", busyPage) + //% "Mastodon app registration did not return credentials" + _showRegistrationError(qsTrId("settings-accounts-mastodon-la-app_registration_missing_credentials"), busyPage) return } @@ -102,7 +105,8 @@ AccountCreationAgent { } var postData = [] - postData.push("client_name=" + encodeURIComponent("Sailfish Mastodon")) + //% "Sailfish Mastodon" + postData.push("client_name=" + encodeURIComponent(qsTrId("settings-accounts-mastodon-la-client_name"))) postData.push("redirect_uris=" + encodeURIComponent(callbackUri)) postData.push("scopes=" + encodeURIComponent("read write")) postData.push("website=" + encodeURIComponent("https://sailfishos.org")) @@ -126,7 +130,8 @@ AccountCreationAgent { _goToSettings(accountId) }) _accountSetup.error.connect(function() { - accountCreationError("Failed to finish Mastodon account setup") + //% "Failed to finish Mastodon account setup" + accountCreationError(qsTrId("settings-accounts-mastodon-la-account_setup_failed")) }) } @@ -154,7 +159,7 @@ AccountCreationAgent { DialogHeader { id: header //% "Sign in" - acceptText: qsTrId("settings_accounts-common-bt-sign_in") + acceptText: qsTrId("settings-accounts-common-bt-sign_in") } Column { @@ -163,19 +168,34 @@ AccountCreationAgent { spacing: Theme.paddingLarge width: parent.width - Label { + Row { x: Theme.horizontalPageMargin width: parent.width - x * 2 - wrapMode: Text.Wrap - color: Theme.highlightColor - text: "Enter your Mastodon server, then sign in." + spacing: Theme.paddingMedium + + Icon { + id: promptIcon + width: Theme.iconSizeMedium + height: Theme.iconSizeMedium + source: "image://theme/icon-l-mastodon" + } + + //: Prompt shown in account setup before OAuth sign-in. + Label { + width: parent.width - promptIcon.width - parent.spacing + wrapMode: Text.Wrap + color: Theme.highlightColor + //% "Enter your Mastodon server, then sign in." + text: qsTrId("settings-accounts-mastodon-la-enter_server_then_sign_in") + } } TextField { id: instanceField x: Theme.horizontalPageMargin width: parent.width - x * 2 - label: "Server" + //% "Server" + label: qsTrId("settings-accounts-mastodon-la-server") placeholderText: "mastodon.social" inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhUrlCharactersOnly EnterKey.iconSource: "image://theme/icon-m-enter-next" @@ -191,7 +211,8 @@ AccountCreationAgent { Component { id: busyComponent AccountBusyPage { - busyDescription: "Preparing Mastodon sign-in..." + //% "Preparing Mastodon sign-in..." + busyDescription: qsTrId("settings-accounts-mastodon-la-preparing_sign_in") onStatusChanged: { if (status === PageStatus.Active && root._pendingApiHost.length > 0) { root._registerClientApplication(root._pendingApiHost, this) @@ -264,8 +285,13 @@ AccountCreationAgent { hasConfigured = true var services = ["mastodon-microblog", "mastodon-sharing"] + var credentialsUserName = newAccount.defaultCredentialsUserName + ? newAccount.defaultCredentialsUserName.toString().trim() + : "" var providerDisplayName = root._displayName(apiHost) - if (providerDisplayName.length > 0) { + if (credentialsUserName.length > 0) { + newAccount.displayName = credentialsUserName + } else if (providerDisplayName.length > 0) { newAccount.displayName = providerDisplayName } |
