-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14475 from nextcloud/nmc/useLocalizedLogMessage
Use localized log message
- Loading branch information
Showing
7 changed files
with
17 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* | ||
* Nextcloud - Android Client | ||
* | ||
* SPDX-FileCopyrightText: 2023-2024 TSI-mc <[email protected]> | ||
* SPDX-FileCopyrightText: 2023-2025 TSI-mc <[email protected]> | ||
* SPDX-FileCopyrightText: 2019-2021 Tobias Kaminsky <[email protected]> | ||
* SPDX-FileCopyrightText: 2018 Andy Scherzinger <info@andy-scherzinger> | ||
* SPDX-FileCopyrightText: 2017 Mario Danic <[email protected]> | ||
|
@@ -1344,9 +1344,9 @@ public void onAuthenticatorTaskCallback(RemoteOperationResult<UserInfo> result) | |
// initWebViewLogin(mServerInfo.mBaseUrl + WEB_LOGIN, false); | ||
DisplayUtils.showSnackMessage(this, | ||
accountSetupWebviewBinding.loginWebview, R.string.auth_access_failed, | ||
result.getLogMessage()); | ||
result.getLogMessage(this)); | ||
} else { | ||
DisplayUtils.showSnackMessage(this, R.string.auth_access_failed, result.getLogMessage()); | ||
DisplayUtils.showSnackMessage(this, R.string.auth_access_failed, result.getLogMessage(this)); | ||
|
||
// init webView again | ||
updateAuthStatusIconAndText(result); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* Nextcloud - Android Client | ||
* | ||
* SPDX-FileCopyrightText: 2023 Alper Ozturk <[email protected]> | ||
* SPDX-FileCopyrightText: 2022 TSI-mc | ||
* SPDX-FileCopyrightText: 2022-2025 TSI-mc <[email protected]> | ||
* SPDX-FileCopyrightText: 2021 Chris Narkiewicz <[email protected]> | ||
* SPDX-FileCopyrightText: 2018-2020 Tobias Kaminsky <[email protected]> | ||
* SPDX-FileCopyrightText: 2018 Andy Scherzinger <[email protected]> | ||
|
@@ -567,7 +567,7 @@ public OCFile saveFileWithParent(OCFile ocFile, Context context) { | |
} else { | ||
Exception exception = result.getException(); | ||
String message = "Error during saving file with parents: " + ocFile.getRemotePath() + " / " | ||
+ result.getLogMessage(); | ||
+ result.getLogMessage(context); | ||
|
||
if (exception != null) { | ||
throw new RemoteOperationFailedException(message, exception); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
* | ||
* SPDX-FileCopyrightText: 2019 Chris Narkiewicz <[email protected]> | ||
* SPDX-FileCopyrightText: 2018 Edvard Holst <[email protected]> | ||
* SPDX-FileCopyrightText: 2025 TSI-mc <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only | ||
*/ | ||
package com.owncloud.android.ui.activities.data.activities; | ||
|
@@ -94,7 +95,7 @@ protected Boolean doInBackground(Void... voids) { | |
} else { | ||
Log_OC.d(TAG, result.getLogMessage()); | ||
// show error | ||
errorMessage = result.getLogMessage(); | ||
errorMessage = result.getLogMessage(MainApp.getAppContext()); | ||
if (result.getHttpCode() == HttpStatus.SC_NOT_MODIFIED) { | ||
errorMessage = context.getString(R.string.file_list_empty_headline_server_search); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
* SPDX-FileCopyrightText: 2020 Chris Narkiewicz <[email protected]> | ||
* SPDX-FileCopyrightText: 2017 Mario Danic <[email protected]> | ||
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH | ||
* SPDX-FileCopyrightText: 2025 TSI-mc <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only | ||
*/ | ||
package com.owncloud.android.ui.activity | ||
|
@@ -259,7 +260,7 @@ class NotificationsActivity : AppCompatActivity(), NotificationsContract.View, I | |
runOnUiThread { | ||
setEmptyContent( | ||
getString(R.string.notifications_no_results_headline), | ||
result?.logMessage | ||
result?.getLogMessage(this) | ||
) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
* SPDX-FileCopyrightText: 2018 Tobias Kaminsky <[email protected]> | ||
* SPDX-FileCopyrightText: 2017 Mario Danic <[email protected]> | ||
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH | ||
* SPDX-FileCopyrightText: 2025 TSI-mc <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only | ||
*/ | ||
package com.owncloud.android.ui.activity; | ||
|
@@ -317,7 +318,7 @@ private void fetchAndSetData() { | |
// show error | ||
runOnUiThread(() -> setErrorMessageForMultiList( | ||
getString(R.string.user_information_retrieval_error), | ||
result.getLogMessage(), | ||
result.getLogMessage(this), | ||
R.drawable.ic_list_empty_error) | ||
); | ||
Log_OC.d(TAG, result.getLogMessage()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,15 @@ | |
* | ||
* SPDX-FileCopyrightText: 2019 Tobias Kaminsky <[email protected]> | ||
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH | ||
* SPDX-FileCopyrightText: 2025 TSI-mc <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only | ||
*/ | ||
package com.owncloud.android.ui.asynctasks; | ||
|
||
import android.os.AsyncTask; | ||
|
||
import com.nextcloud.client.account.User; | ||
import com.owncloud.android.MainApp; | ||
import com.owncloud.android.R; | ||
import com.owncloud.android.datamodel.FileDataStorageManager; | ||
import com.owncloud.android.datamodel.OCFile; | ||
|
@@ -60,7 +62,7 @@ protected String doInBackground(Void... voids) { | |
|
||
if (!result.isSuccess()) { | ||
Exception exception = result.getException(); | ||
String message = "Fetching file " + remotePath + " fails with: " + result.getLogMessage(); | ||
String message = "Fetching file " + remotePath + " fails with: " + result.getLogMessage(MainApp.getAppContext()); | ||
|
||
if (exception != null) { | ||
return exception.getMessage(); | ||
|
@@ -95,7 +97,7 @@ protected String doInBackground(Void... voids) { | |
|
||
fileDisplayActivity.setFile(ocFile); | ||
} else { | ||
return remoteOperationResult.getLogMessage(); | ||
return remoteOperationResult.getLogMessage(MainApp.getAppContext()); | ||
} | ||
|
||
return ""; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
* | ||
* SPDX-FileCopyrightText: 2019 Chris Narkiewicz <[email protected]> | ||
* SPDX-FileCopyrightText: 2018 Andy Scherzinger <[email protected]> | ||
* SPDX-FileCopyrightText: 2025 TSI-mc <[email protected]> | ||
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only | ||
*/ | ||
package com.owncloud.android.ui.fragment; | ||
|
@@ -331,7 +332,7 @@ private void fetchAndSetData(int lastGiven) { | |
} else { | ||
Log_OC.d(TAG, result.getLogMessage()); | ||
// show error | ||
String logMessage = result.getLogMessage(); | ||
String logMessage = result.getLogMessage(requireContext()); | ||
if (result.getHttpCode() == HttpStatus.SC_NOT_MODIFIED) { | ||
logMessage = getString(R.string.activities_no_results_message); | ||
} | ||
|