-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bug] IOS Flutter SDK- Translation: English is not translated in the …
…Subtitle section (#14)
- Loading branch information
1 parent
34c6b68
commit f88acaf
Showing
5 changed files
with
67 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Sources/FireworkVideoUI/AppLanguage/Extensions/Foundation/NSLocale+AppLanguage.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// Locale+AppLanguage.swift | ||
// | ||
// Created by linjie jiang on 5/7/24. | ||
// | ||
|
||
import Foundation | ||
|
||
extension NSLocale { | ||
static func swizzleNSLocaleMethodsForAppLanguage() { | ||
Swizzle.swizzleClassSelector( | ||
cls: self, | ||
originalSelector: #selector(getter: NSLocale.current), | ||
customSelector: #selector(NSLocale.fw_current)) | ||
Swizzle.swizzleClassSelector( | ||
cls: self, | ||
originalSelector: #selector(getter: NSLocale.autoupdatingCurrent), | ||
customSelector: #selector(NSLocale.fw_autoupdatingCurrent)) | ||
Swizzle.swizzleClassSelector( | ||
cls: self, | ||
originalSelector: #selector(getter: NSLocale.preferredLanguages), | ||
customSelector: #selector(NSLocale.fw_preferredLanguages)) | ||
} | ||
|
||
@objc class func fw_current() -> Locale { | ||
if let language = AppLanguageManager.shared.appLanguage { | ||
return Locale(identifier: language) | ||
} | ||
|
||
return fw_current() | ||
} | ||
|
||
@objc class func fw_autoupdatingCurrent() -> Locale { | ||
if let language = AppLanguageManager.shared.appLanguage { | ||
return Locale(identifier: language) | ||
} | ||
|
||
return fw_autoupdatingCurrent() | ||
} | ||
|
||
@objc class func fw_preferredLanguages() -> [String] { | ||
let languages = fw_preferredLanguages() | ||
if let language = AppLanguageManager.shared.appLanguage { | ||
return [language] + languages | ||
} | ||
|
||
return languages | ||
} | ||
} |
25 changes: 0 additions & 25 deletions
25
Sources/FireworkVideoUI/AppLanguage/Extensions/Foundation/NumberFormatter+AppLanguage.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters