Comments (1)
1. While I am changing app language it is not changing language of storyboard. It only changes string which is hard coded in code.
Yes you'r right. Unfortunately, currently I can't do anything with it, but you can check my answer for similar issue #7
L10n.shared.language = "fr"
this property don't reload views! It only sets language for future localization.For reload all text you need to re-localization all the texts (using @IBOutlets) or you have to reload all visible controllers in your application. Look at this example.
2. While I Re-Run app it runs with default language not with previously selected language
This library doesn't store the user's set language between application sessions. If you want to get this functionality, then on the side of your application you should take care of storing and restoring this language.
Example
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// restore
if let language = UserDefaults.standard.string(forKey: "language") {
L10n.shared.language = language
}
// store
NotificationCenter.default.addObserver(forName: .L10nLanguageChanged, object: self, queue: nil) { _ in
UserDefaults.standard.set(L10n.shared.language, forKey: "language")
}
return true
}
}
from l10n-swift.
Related Issues (20)
- Too long localization keys problem
- Plural localization not working HOT 14
- Support l10n for header of the static table view HOT 1
- Language doesn't change in static variables. HOT 2
- Wrong result/missing support for multiple arguments in plural function HOT 1
- Swift 5.0 Support HOT 6
- fails to install with swift pm HOT 9
- Info.plist localization support HOT 1
- How to set resource provider to load from jSON file? HOT 1
- SwiftUI Support HOT 1
- Line break are escaped in translated strings HOT 1
- Not support Localization in custom Framework HOT 15
- IBInspectable with custom bundle HOT 1
- Plurals does not work HOT 8
- 'L10n' is not a member type of class 'FrameworkMainClass.FrameworkMainClass' HOT 1
- Language change on macOS doesn't update system menubar items HOT 1
- Get compilation error "Cannot convert value of type 'Int' to expected argument type 'L10n'" HOT 2
- ios widget extension not working
- Conformance with CVarArg HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from l10n-swift.