-
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 fix: IOS Flutter SDK- Translation: English is not translated in t…
…he Subtitle section
- Loading branch information
1 parent
34c6b68
commit 47c6180
Showing
3 changed files
with
26 additions
and
1 deletion.
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
24 changes: 24 additions & 0 deletions
24
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,24 @@ | ||
// | ||
// 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)) | ||
} | ||
|
||
@objc static func fw_current() -> Locale { | ||
if let language = AppLanguageManager.shared.appLanguage { | ||
return Locale(identifier: language) | ||
} | ||
|
||
return fw_current() | ||
} | ||
} |