Skip to content

Commit

Permalink
Bug fix: IOS Flutter SDK- Translation: English is not translated in t…
Browse files Browse the repository at this point in the history
…he Subtitle section
  • Loading branch information
linjie-firework committed May 8, 2024
1 parent 34c6b68 commit 47c6180
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion FireworkVideoUI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FireworkVideoUI'
s.version = '0.1.0'
s.version = '0.1.1'
s.summary = 'An extension library meant to provide easier interfaces for the FireworkVideoSDK.'
s.homepage = 'https://github.com/loopsocial/firework_ios_sdk_ui_extensions'
s.license = 'Apache License, Version 2.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public class AppLanguageManager {
UITextView.swizzleTextViewMethodsForAppLanguage()
UIWindow.swizzleWindowMethodsForAppLanguage()
UIView.swizzleViewMethodsForAppLanguage()
NSLocale.swizzleNSLocaleMethodsForAppLanguage()
}

LayoutFlipManager.swizzelMethods()
Expand Down
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()
}
}

0 comments on commit 47c6180

Please sign in to comment.