فهرست منبع

fix english search

polscm32 aka Marvout 1 سال پیش
والد
کامیت
5f7da42967
1فایلهای تغییر یافته به همراه9 افزوده شده و 4 حذف شده
  1. 9 4
      FreeAPS/Sources/Modules/Settings/SettingItems.swift

+ 9 - 4
FreeAPS/Sources/Modules/Settings/SettingItems.swift

@@ -311,10 +311,15 @@ extension LocalizedStringKey {
     var englishValue: String {
         let mirror = Mirror(reflecting: self)
         let children = mirror.children
-        if let label = children.first(where: { $0.label == "key" })?.value as? String {
-            return Bundle.main.localizedString(forKey: label, value: nil, table: nil)
-        } else {
-            return ""
+
+        if let key = children.first(where: { $0.label == "key" })?.value as? String {
+            if let path = Bundle.main.path(forResource: "en", ofType: "lproj"),
+               let bundle = Bundle(path: path)
+            {
+                return bundle.localizedString(forKey: key, value: nil, table: nil)
+            }
         }
+
+        return ""
     }
 }