Skip to content

Lable values only load at second time #34

Open

Description

@breakline87

Hello,

I have this problem where on first start I see the Labels instead of the values. I use this code in AppDelegate:

`func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
#if DEBUG
NetworkActivityLogger.shared.level = .debug
NetworkActivityLogger.shared.startLogging()
#endif
UITabBar.appearance().tintColor = UIColor.gray
Localization.start(appKey: "...")
Localization.ifEmptyShowKey = true
Localization.setLanguage("hun")
Localization.buildLanguageCode = "hun"

    return true
}`

This works, but only the second time. Also, loading into UILabels dont work at all, I had to populate them manually

Activity

  1. willpowell8 commented on Jun 1, 2018

    @willpowell8
    Owner

    I will take a look

  2. willpowell8 commented on Jun 2, 2018

    @willpowell8
    Owner

    @breakline87 you are looking for Hungarian as the language? If so the code should be hu rather than hun this would cause both issues you have mentioned. I will look at putting some validation into the codebase for the language codes

  3. breakline87 commented on Jun 4, 2018

    @breakline87
    Author

    Well then the language wouldnt load the second time. I fixed this issue by using a timeout on my first screen to populate manually everything. Basically I suspect you can arrive at a screen and the language might be still loading while you call Localizationkit related functions?

  4. rursache commented on Jun 7, 2018

    @rursache

    same issue here. also, Localization.buildLanguageCode = "ro" does not work, it always defaults to english, not Romanian

  5. breakline87 commented on Aug 26, 2018

    @breakline87
    Author

    Can we get an update on this? To summarize the problem, the localization module starts loading the language on start, but the user might reach the UI before loading the language file finishes. There is no "language available" listener or similar implemented, which would at least give us a way to know when can we direct the user to a screen where translations are used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions