Skip to content

Commit

Permalink
ModifySharingLinkErr (#916)
Browse files Browse the repository at this point in the history
* Modify the failed message for generating share links

* 1,Update sharing and generating link prompt information
2,Update translation

* 1,Modify the title of the share Generate link dialog
2,Update the translation

* Update the translation
  • Loading branch information
maxiaoping authored Nov 20, 2021
1 parent 45dad57 commit a2f4d2a
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId 'com.seafile.seadroid2'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 116
versionName "2.2.41"
versionCode 117
versionName "2.2.42"
multiDexEnabled true
resValue "string", "authorities", applicationId + '.cameraupload.provider'
resValue "string", "account_type", "com.seafile.seadroid2.account.api2"
Expand Down
14 changes: 13 additions & 1 deletion app/src/main/java/com/seafile/seadroid2/SeafConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,19 @@ private void checkRequestResponseStatus(HttpRequest req, int expectedStatusCode)
throw new SeafException(req.code(), req.message());
}
} else {
throw new SeafException(req.code(), req.message());
try {
String result = new String(req.bytes(), "UTF-8");
if (result != null && Utils.parseJsonObject(result) != null) {
JSONObject json = Utils.parseJsonObject(result);
throw new SeafException(req.code(), json.optString("error_msg"));
} else {
throw new SeafException(req.code(), req.message());
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
throw new SeafException(req.code(), req.message());
}

}
} else {
// Log.v(DEBUG_TAG, "HTTP request ok : " + req.url());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,14 @@ protected void hideLoadingPro() {
}

protected void showError(String error) {
errorText.setText(error);

if (error.equals("Password is required.")) {
errorText.setText(R.string.required_password);
} else if (error.equals("Password is too weak.")) {
errorText.setText(R.string.weak_password);
} else {
errorText.setText(error);
}
errorText.startAnimation(AnimationUtils.loadAnimation(
getActivity(), android.R.anim.fade_in));
errorText.setVisibility(View.VISIBLE);
Expand Down
23 changes: 23 additions & 0 deletions app/src/main/res/values-cs-rCZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,37 @@
<string name="welcome_to_seafile">Vítejte v Seafile</string>
<string name="select_account">Nejprve vyberte svůj účet</string>
<string name="edit_account">Upravit</string>
<string name="delete_account">Smazat</string>
<string name="delete">Odstranit</string>
<string name="delete_repo">Opravdu chcete tuto knihovnu smazat?</string>
<string name="delete_file">Opravdu chcete tento soubor nebo složku smazat?</string>
<string name="delete_successful">Úspěšně smazáno</string>
<string name="delete_repo_title">Smazat knihovnu</string>
<string name="delete_file_f">Odstranit soubor</string>
<string name="recover_library">Obnovit knihovnu</string>
<string name="recover_file">Obnovit soubor</string>
<string name="move_file">Přesunout soubor</string>
<string name="update_file">Aktualizovat soubor</string>
<string name="recover_folder">Obnovit složku</string>
<string name="move_folder">Přesunout složku</string>
<string name="delete_dir">Odstranit složku</string>
<string name="name_hint">Název</string>
<string name="server_hint">Adresa serveru</string>
<string name="email_hint">E-mail nebo uživatelské jméno</string>
<string name="passwd_hint">Heslo</string>
<string name="passwd_min_len_limit_hint">Heslo (alespoň %d znaků)</string>
<string name="passwd_confirmation_hint">Zopakování hesla</string>
<string name="login">Přihlásit se</string>
<string name="open_file">Otevřít</string>
<string name="download_file">Stáhnout</string>
<string name="redownload_file">Stáhnout znovu</string>
<string name="cancel_download">Zrušit</string>
<string name="unknown_file_type">Neznámý typ souboru</string>
<string name="activity_not_found">Nelze najít aplikaci pro otevření tohoto souboru</string>
<string name="refresh">Obnovit</string>
<string name="add_account">Přidat účet</string>
<string name="personal">Osobní</string>
<string name="shared">Sdíleno</string>
<string name="libraries">Knihovny</string>
<string name="cached">V mezipaměti</string>
<string name="activities">Aktivity</string>
Expand All @@ -34,6 +53,8 @@
<string name="err_server_andress_empty">Adresa serveru nesmí být prázdná</string>
<string name="err_email_empty">Email nesmí být prázdný</string>
<string name="err_passwd_empty">Heslo nesmí být prázdné</string>
<string name="err_passwd_too_short">Heslo je příliš krátké</string>
<string name="err_passwd_mismatch">Zadání hesla se neshodují</string>
<string name="err_login_failed">Přihlášení selhalo</string>
<string name="err_wrong_user_or_passwd">Špatný email nebo heslo</string>
<string name="err_token_expired">Přihlášení vypršelo, prosím přihlašte se znovu</string>
Expand All @@ -49,6 +70,8 @@
<string name="task_remove">Smazat</string>
<string name="task_remove_all_cancelled">Odstranit zrušené</string>
<string name="task_remove_all_finished">Odstranit dokončené úlohy</string>
<string name="repo_action_delete">Smazat</string>
<string name="repo_action_rename">Přejmenovat</string>
<string name="file_action_star">Oblíbené</string>
<string name="file_action_download">Stáhnout</string>
<string name="file_action_update">Nahrát</string>
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -539,4 +539,11 @@ E-mail : [email protected]<br>
<string name="channel_name_error">Alertes d\'erreur</string>
<string name="channel_name_upload">Information d\'envoi de fichier</string>
<string name="channel_name_download">Information téléchargement de fichier</string>
<string name="above_quota">Quota dépassé.</string>
<string name="camera_upload_state">Information d\'envoi</string>
<string name="waiting_state">Envoi en attente</string>
<string name="Upload_completed">La dernière synchronisation s\'est terminée à </string>
<string name="is_scanning">Balayage</string>
<string name="is_uploading">Envoi</string>
<string name="network_unavailable">Réseau indisponible</string>
</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -538,4 +538,6 @@
<string name="is_scanning">扫描中</string>
<string name="is_uploading">上传中</string>
<string name="network_unavailable">网络不可用</string>
<string name="required_password">需要密码</string>
<string name="weak_password">密码太弱</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<dimen name="dialog_msg_title_txt_size">16sp</dimen>
<dimen name="dialog_msg_txt_size">20sp</dimen>
<dimen name="dialog_msg_progressbar_height">30dp</dimen>
<dimen name="dialog_error_txt_size">12sp</dimen>
<dimen name="dialog_error_txt_size">14sp</dimen>
<dimen name="dialog_btn_txt_size">14sp</dimen>
<dimen name="dialog_et_txt_size">16sp</dimen>

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -566,4 +566,7 @@
<string name="is_scanning">Scanning</string>
<string name="is_uploading">Uploading</string>
<string name="network_unavailable">Network unavailable</string>

<string name="required_password">Password is required.</string>
<string name="weak_password">Password is too weak.</string>
</resources>

0 comments on commit a2f4d2a

Please sign in to comment.