marinofaggiana 4 years ago
parent
commit
d963364fba

+ 9 - 9
iOSClient/Main/Menu/CCMain+Menu.swift

@@ -44,17 +44,17 @@ extension CCMain {
     
     @objc func SetSortButtonText() {
         
-        let orderSettings = CCUtility.getOrderSettings()
-        
-        if orderSettings == "fileName" {
-            self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_order_by_name_a_z_", comment: "") : NSLocalizedString("_order_by_name_z_a_", comment: "")), for: .normal)
-        } else if orderSettings == "date" {
-            self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_order_by_date_less_recent_", comment: "") : NSLocalizedString("_order_by_date_more_recent_", comment: "")), for: .normal)
-        } else if orderSettings == "size" {
-            self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_order_by_size_largest_", comment: "") : NSLocalizedString("_order_by_size_smallest_", comment: "")), for: .normal)
+        switch CCUtility.getOrderSettings() {
+        case "fileName":
+            self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_sorted_by_name_a_z_", comment: "") : NSLocalizedString("_sorted_by_name_z_a_", comment: "")), for: .normal)
+        case "date":
+            self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_sorted_by_date_less_recent_", comment: "") : NSLocalizedString("_sorted_by_date_more_recent_", comment: "")), for: .normal)
+        case "size":
+            self.sortButton.setTitle((CCUtility.getAscendingSettings() ? NSLocalizedString("_sorted_by_size_largest_", comment: "") : NSLocalizedString("_sorted_by_size_smallest_", comment: "")), for: .normal)
+        default:
+            break
         }
     }
-    
 
     private func initSortMenu() -> [NCMenuAction] {
         var actions = [NCMenuAction]()

+ 6 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -363,11 +363,17 @@
 "_file_not_present_"            = "Error: File not present, please reload.";
 "_order_by_"                    = "Sort by";
 "_order_by_name_a_z_"           = "Sort by name (from A to Z)";
+"_sorted_by_name_a_z_"          = "Sorted by name (from A to Z)";
 "_order_by_name_z_a_"           = "Sort by name (from Z to A)";
+"_sorted_by_name_z_a_"          = "Sorted by name (from Z to A)";
 "_order_by_date_more_recent_"   = "Sort from the most recent";
+"_sorted_by_date_more_recent_"  = "Sorted from the most recent";
 "_order_by_date_less_recent_"   = "Sort from the less recent";
+"_sorted_by_date_less_recent_"  = "Sorted from the less recent";
 "_order_by_size_smallest_"      = "Sort from the smallest";
+"_sorted_by_size_smallest_"     = "Sorted from the smallest";
 "_order_by_size_largest_"       = "Sort from the largest";
+"_sorted_by_size_largest_"      = "Sorted from the largest";
 "_delete_selected_files_"       = "Delete files";
 "_move_selected_files_"         = "Move files";
 "_move_or_copy_selected_files_" = "Move or copy files";