From b0a17075d05e3375cafb597362c3517644a59fb5 Mon Sep 17 00:00:00 2001 From: Aaron Hastings Date: Tue, 10 Feb 2015 15:00:57 +0000 Subject: [PATCH 1/6] Fixed issue where space character wouldn't appear in last update time of a library, e.g. "15minutes ago" instead of "15 minutes ago" This was due to a literal space (' ') being used in the "_ago" string rather than the special " " character. --- res/values/strings.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 1db2185ae..6db10bfdf 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -149,10 +149,10 @@ Finished Cancelled Failed - days ago - hours ago - minutes ago - seconds ago +  days ago +  hours ago +  minutes ago +  seconds ago Just now Error when loading starred files Open as From 6de9d52a8d14574812f31c98d41fa22dbb57a294 Mon Sep 17 00:00:00 2001 From: Aaron Hastings Date: Wed, 11 Feb 2015 11:47:27 +0000 Subject: [PATCH 2/6] Series of grammatical/formatting fixes. --- res/values/strings.xml | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 6db10bfdf..34462459c 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -82,9 +82,9 @@ Other Wait - No image Found + No image found Choose photos/videos to upload - select items to upload + Select items to upload %d items selected Please enter the name of the folder Please enter the name of the file @@ -98,12 +98,12 @@ No app can be found Add to Seafile OK - Please setup an account in Seafile first + Please set up an account in Seafile first You have no library yet Choose an account Choose a library Choose a folder - Failed to load seafile accounts + Failed to load Seafile accounts Failed to load libraries Failed to load contents of this folder This type of share is not supported @@ -116,7 +116,7 @@ last modified modified file size - The library have been deleted. + The library has been deleted. Export this file No upload tasks yet No download tasks yet @@ -138,7 +138,7 @@ Open navigation drawer Close navigation drawer No starred file yet - The selected file(s) is added to the upload tasks list. + The selected file(s) have been added to the upload tasks list. The photo is being uploaded Take Photo successfully Libraries @@ -156,18 +156,18 @@ Just now Error when loading starred files Open as - select files to upload + Select files to upload Storage was removed Error when selecting file %d file(s) selected Empty folder Choose a file - security check failed + Security check failed The security certificate of %s is not trusted. Do you want to continue? %s uses an invalid security certificate. The connection is not secure. Do you want to continue? Untrusted Connection Issued To - Finger Prints + Fingerprints Period of Validity SHA-1 %s MD5 %s @@ -178,14 +178,14 @@ Yes No Remember my choice - Copied Successfully - Moved Successfully + Copied successfully + Moved successfully Internal Server Error Copying file Moving file Copying folder Moving folder - upload is started + Upload is started You can\'t copy a folder to its subfolder You can\'t move a folder to its subfolder Cancel @@ -209,22 +209,22 @@ Pattern cell added Pattern detected Forgot password - Failed 5 times, please wait for 30 seconds before trying + Failed 5 times, please wait 30 seconds before trying You can retry %d seconds later Incorrect pattern, you can try another %d times - Linking points not long enough, pelase try again + Linking points not long enough, please try again Retry Next OK Please draw Gesture Lock Pattern Learn how to draw Gesture Lock Pattern - Link at least 4 points, try again! + Swipe across at least 4 points, try again! Pattern saved Please draw Gesture Lock pattern Please confirm your pattern - Pattern not match, try again! - Confirm to save your pattern - Move away your firgure after drawing" + Pattern didn't match. Try again. + Tap OK to save your pattern + Release finger when finished drawing Gesture Lock Pattern successfully saved @@ -252,7 +252,7 @@ About Author Seafile Andoird Client +
Seafile Android Client

%s

Contact Us

@@ -265,11 +265,11 @@ ]]> - ADVANCE FEATURE + ADVANCED FEATURE Cache size Clear cache Do you want to clear cache? - Clear cache successfully + Clear cache successful Clear cache failed 0 KB @@ -277,7 +277,7 @@ Pull to refresh… Release to refresh… Loading… - Last update :  + Last update:   seconds ago  minutes ago  hours ago @@ -294,7 +294,7 @@ Server is empty! Server should starts with either http:// or https:// - Error: + Error:  Shibboleth Login Input server... Login with Shibboleth From dff0f4b1ed43250038ec13266c12a7c3473e0f94 Mon Sep 17 00:00:00 2001 From: Logan Date: Thu, 12 Feb 2015 10:29:56 +0800 Subject: [PATCH 3/6] improve code style --- res/values/strings.xml | 10 +++++----- src/com/seafile/seadroid2/util/Utils.java | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 34462459c..474b0f8c2 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -149,10 +149,10 @@ Finished Cancelled Failed -  days ago -  hours ago -  minutes ago -  seconds ago + %d days ago + %d hours ago + %d minutes ago + %d seconds ago Just now Error when loading starred files Open as @@ -222,7 +222,7 @@ Pattern saved Please draw Gesture Lock pattern Please confirm your pattern - Pattern didn't match. Try again. + Pattern didn\'t match. Try again. Tap OK to save your pattern Release finger when finished drawing Gesture Lock Pattern successfully saved diff --git a/src/com/seafile/seadroid2/util/Utils.java b/src/com/seafile/seadroid2/util/Utils.java index e045b3ef2..9bd9216d2 100644 --- a/src/com/seafile/seadroid2/util/Utils.java +++ b/src/com/seafile/seadroid2/util/Utils.java @@ -375,15 +375,15 @@ public static String translateCommitTime(long timestampInMillis) { SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); return fmt.format(d); } else if (days > 0) { - return days + SeadroidApplication.getAppContext().getString(R.string.days_ago); + return SeadroidApplication.getAppContext().getString(R.string.days_ago, days); } else if (seconds >= 60 * 60) { long hours = seconds / 3600; - return hours + SeadroidApplication.getAppContext().getString(R.string.hours_ago); + return SeadroidApplication.getAppContext().getString(R.string.hours_ago, hours); } else if (seconds >= 60) { long minutes = seconds / 60; - return minutes + SeadroidApplication.getAppContext().getString(R.string.minutes_ago); + return SeadroidApplication.getAppContext().getString(R.string.minutes_ago, minutes); } else if (seconds > 0) { - return seconds + SeadroidApplication.getAppContext().getString(R.string.seconds_ago); + return SeadroidApplication.getAppContext().getString(R.string.seconds_ago, seconds); } else { return SeadroidApplication.getAppContext().getString(R.string.just_now); } From f3612edb73cc4342a0891c4a18b794ef34a4900b Mon Sep 17 00:00:00 2001 From: Logan Date: Thu, 12 Feb 2015 11:17:05 +0800 Subject: [PATCH 4/6] use plurals --- res/values/strings.xml | 43 ++++++++++++------- .../seafile/seadroid2/data/DataManager.java | 6 +-- .../MultiFileChooserActivity.java | 3 +- .../MultipleImageSelectionActivity.java | 3 +- .../UnlockGesturePasswordActivity.java | 6 +-- 5 files changed, 36 insertions(+), 25 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 474b0f8c2..9b53833e2 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1,5 +1,5 @@ - + Seafile http://seafile.com Welcome to Seafile @@ -85,7 +85,11 @@ No image found Choose photos/videos to upload Select items to upload - %d items selected + + %1$d item selected + %1$d items selected + + Please enter the name of the folder Please enter the name of the file Please enter the password @@ -159,7 +163,10 @@ Select files to upload Storage was removed Error when selecting file - %d file(s) selected + + %1$d file selected + %1$d files selected + Empty folder Choose a file Security check failed @@ -193,7 +200,7 @@ Account User info - loading... + loading… Space used Sign out Click to sign out @@ -210,9 +217,15 @@ Pattern detected Forgot password Failed 5 times, please wait 30 seconds before trying - You can retry %d seconds later - Incorrect pattern, you can try another %d times - Linking points not long enough, please try again + + You can retry %1$d second later + You can retry %1$d seconds later + + + Incorrect pattern, you can try another %1$d time + Incorrect pattern, you can try another %1$d times + + Linking points not long enough, pelase try again Retry Next OK @@ -274,13 +287,13 @@ 0 KB - Pull to refresh… - Release to refresh… - Loading… + Pull to refresh… + Release to refresh… + Loading… Last update:  -  seconds ago -  minutes ago -  hours ago + %d seconds ago + %d minutes ago + %d hours ago Could not open file %s. @@ -296,9 +309,9 @@ Server should starts with either http:// or https:// Error:  Shibboleth Login - Input server... + Input server… Login with Shibboleth - loading... + loading… Network connection error, please try again later! diff --git a/src/com/seafile/seadroid2/data/DataManager.java b/src/com/seafile/seadroid2/data/DataManager.java index 9888e7b27..295694678 100644 --- a/src/com/seafile/seadroid2/data/DataManager.java +++ b/src/com/seafile/seadroid2/data/DataManager.java @@ -783,7 +783,7 @@ public String getLastPullToRefreshTime(String whichFragment) { sb.append(SeadroidApplication.getAppContext().getString(R.string.pull_to_refresh_last_update)); if (seconds < 60) { - sb.append(seconds + SeadroidApplication.getAppContext().getString(R.string.pull_to_refresh_last_update_seconds_ago)); + sb.append(SeadroidApplication.getAppContext().getString(R.string.pull_to_refresh_last_update_seconds_ago, seconds)); } else { int minutes = (seconds / 60); if (minutes > 60) { @@ -792,11 +792,11 @@ public String getLastPullToRefreshTime(String whichFragment) { Date date = new Date(lastUpdate); sb.append(ptrDataFormat.format(date)); } else { - sb.append(hours + SeadroidApplication.getAppContext().getString(R.string.pull_to_refresh_last_update_hours_ago)); + sb.append(SeadroidApplication.getAppContext().getString(R.string.pull_to_refresh_last_update_hours_ago, hours)); } } else { - sb.append(minutes + SeadroidApplication.getAppContext().getString(R.string.pull_to_refresh_last_update_minutes_ago)); + sb.append(SeadroidApplication.getAppContext().getString(R.string.pull_to_refresh_last_update_minutes_ago, minutes)); } } return sb.toString(); diff --git a/src/com/seafile/seadroid2/fileschooser/MultiFileChooserActivity.java b/src/com/seafile/seadroid2/fileschooser/MultiFileChooserActivity.java index 44a6ba2fc..a73b19b9b 100644 --- a/src/com/seafile/seadroid2/fileschooser/MultiFileChooserActivity.java +++ b/src/com/seafile/seadroid2/fileschooser/MultiFileChooserActivity.java @@ -141,8 +141,7 @@ private void updateSelectionStatus() { if (nSelected == 0) { status = getResources().getString(R.string.select_upload_files); } else { - status = String.format(getResources().getString(R.string.n_upload_files_selected), - nSelected); + status = getResources().getQuantityString(R.plurals.n_upload_files_selected, nSelected, nSelected); } mFooterFragment.getStatusView().setText(status); } diff --git a/src/com/seafile/seadroid2/gallery/MultipleImageSelectionActivity.java b/src/com/seafile/seadroid2/gallery/MultipleImageSelectionActivity.java index 429c1684a..6aca7b33e 100644 --- a/src/com/seafile/seadroid2/gallery/MultipleImageSelectionActivity.java +++ b/src/com/seafile/seadroid2/gallery/MultipleImageSelectionActivity.java @@ -585,8 +585,7 @@ private void updateSelectionStatus() { if (nSelected == 0) { status = getResources().getString(R.string.select_upload_items); } else { - status = String.format(getResources().getString(R.string.n_upload_items_selected), - nSelected); + status = getResources().getQuantityString(R.plurals.n_upload_items_selected, nSelected, nSelected); } mSelectionStatus.setText(status); } diff --git a/src/com/seafile/seadroid2/ui/activity/UnlockGesturePasswordActivity.java b/src/com/seafile/seadroid2/ui/activity/UnlockGesturePasswordActivity.java index 8b0d88282..a554fc98a 100644 --- a/src/com/seafile/seadroid2/ui/activity/UnlockGesturePasswordActivity.java +++ b/src/com/seafile/seadroid2/ui/activity/UnlockGesturePasswordActivity.java @@ -105,8 +105,8 @@ public void onPatternDetected(List pattern) { - mFailedPatternAttemptsSinceLastTimeout; if (retry >= 0) { if (retry == 0) - ToastUtils.show(UnlockGesturePasswordActivity.this, getResources().getString(R.string.lockscreen_access_pattern_failure)); - mHeadTextView.setText(getResources().getString(R.string.lockscreen_access_pattern_failure_left_try_times, retry)); + ToastUtils.show(UnlockGesturePasswordActivity.this, getResources().getString(R.string.lockscreen_access_pattern_failure)); + mHeadTextView.setText(getResources().getQuantityString(R.plurals.lockscreen_access_pattern_failure_left_try_times, retry, retry)); mHeadTextView.setTextColor(Color.RED); mHeadTextView.startAnimation(mShakeAnim); } @@ -143,7 +143,7 @@ public void run() { public void onTick(long millisUntilFinished) { int secondsRemaining = (int) (millisUntilFinished / 1000) - 1; if (secondsRemaining > 0) { - mHeadTextView.setText(getResources().getString(R.string.lockscreen_access_pattern_failure_left_try_seconds, secondsRemaining)); + mHeadTextView.setText(getResources().getQuantityString(R.plurals.lockscreen_access_pattern_failure_left_try_seconds, secondsRemaining, secondsRemaining)); } else { mHeadTextView.setText(R.string.lockscreen_access_pattern_hint); mHeadTextView.setTextColor(Color.WHITE); From a6cadf78b3f26c3ec3e368fd1a0c492104a086b7 Mon Sep 17 00:00:00 2001 From: Logan Date: Fri, 27 Feb 2015 11:21:06 +0800 Subject: [PATCH 5/6] add translatable support --- res/values/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 9b53833e2..85f813587 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1,7 +1,7 @@ - Seafile - http://seafile.com + Seafile + http://seafile.com Welcome to Seafile Choose an account to start Edit @@ -28,7 +28,7 @@ Cached Activities Upload - https + https Transfer List Accounts Settings From f1e118cb485e4ea5f19a86df4cf6aaba0e112015 Mon Sep 17 00:00:00 2001 From: Logan Date: Fri, 27 Feb 2015 11:29:17 +0800 Subject: [PATCH 6/6] improve strings style --- res/values/strings.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 85f813587..a1bb2f9e3 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -20,7 +20,7 @@ Download again Cancel Unknown file type - Can not find App to open this file + Can\`t find App to open this file Refresh Add Account Personal @@ -48,9 +48,9 @@ No network connection Unknown error Invalid server address - Server address can not be empty - Email can not be empty - Password can not be empty + Server address can\`t be empty + Email can\`t be empty + Password can\`t be empty Login failed Email or password error Upload @@ -282,8 +282,8 @@ Cache size Clear cache Do you want to clear cache? - Clear cache successful - Clear cache failed + Cache cleared successfully + Cache cleared failed 0 KB @@ -296,13 +296,13 @@ %d hours ago - Could not open file %s. - Can not open directory. + Couldn\'t open file %s. + Can\`t open directory. File %s not cached. - Could not find/open thumbnail %s. - Could not download file %s from server. - Can not open directory for reading/writing. - Could not find Seafile account. + Couldn\'t find/open thumbnail %s. + Couldn\'t download file %s from server. + Can\`t open directory for reading/writing. + Couldn\'t find Seafile account. Server is empty! @@ -326,6 +326,6 @@ Searching… Please input keywords Nothing was found - Oops, Search was not supported on this server! + Oops, search was not supported on this server! Couldn\'t find this library. It may be deleted