Sfoglia il codice sorgente

add plurals localization extension to Strings class with fallback to english

cyberta 6 anni fa
parent
commit
820c372659
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      deltachat-ios/Helper/Extensions.swift

+ 6 - 0
deltachat-ios/Helper/Extensions.swift

@@ -59,6 +59,12 @@ extension String {
 			else { return value }
 		return NSLocalizedString(stringID, bundle: bundle, comment: "")
 	}
+
+	static func localized(stringID: String, count: Int) -> String {
+		let formatString: String = localized(stringID)
+		let resultString: String = String.localizedStringWithFormat(formatString, count)
+		return resultString;
+	}
 }
 
 extension URL {