diff --git a/SessionUtilitiesKit/General/Localization.swift b/SessionUtilitiesKit/General/Localization.swift
index fe8a0c290..4cfa983d5 100644
--- a/SessionUtilitiesKit/General/Localization.swift
+++ b/SessionUtilitiesKit/General/Localization.swift
@@ -33,14 +33,8 @@ final public class LocalizationHelper: CustomStringConvertible {
// If the localized string matches the key provided then the localisation failed
var localizedString: String = NSLocalizedString(template, comment: "")
- for (key, value) in replacements {
- localizedString = localizedString.replacingOccurrences(of: tokenize(key), with: value)
- }
-
- // Replace html tag "
" with "\n"
- localizedString = localizedString.replacingOccurrences(of: "
", with: "\n")
-
// Deal with plurals
+ // Note: We have to deal with plurals first, so we can get the correct string
if !self.numbers.isEmpty {
localizedString = String(
format: localizedString,
@@ -48,6 +42,13 @@ final public class LocalizationHelper: CustomStringConvertible {
arguments: self.numbers
)
}
+
+ for (key, value) in replacements {
+ localizedString = localizedString.replacingOccurrences(of: tokenize(key), with: value)
+ }
+
+ // Replace html tag "
" with "\n"
+ localizedString = localizedString.replacingOccurrences(of: "
", with: "\n")
return localizedString
}