Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS localization value on swizzleMainBundle() doesn't work #1

Open
ghost opened this issue Oct 19, 2023 · 0 comments
Open

iOS localization value on swizzleMainBundle() doesn't work #1

ghost opened this issue Oct 19, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 19, 2023

I have the package set up, I can see the LingoHub SDK downloads the file but when I try to use it in the app there is no value.

NSLocalizedString("correct_key", comment: "") the output is the key, not value
LingoHubSDK.shared.localizedString(forKey: "correct_key") the output is the key, not the value

In the didFinishLaunchingWithOptions I call:

LingoHubSDK.shared.configure(withApiKey: apiKey, projectId: projectId)
LingoHubSDK.shared.isPreproductionEnabled = true
LingoHubSDK.shared.swizzleMainBundle()
LingoHubSDK.shared.update { result in
            switch result {
            case .success(let value):
                print("LingoHubSDK update: \(value)")
            case .failure(let error):
                print("LingoHubSDK error: \(error.localizedDescription)")
            }
        }

and in the ViewController I've tried both methods as shown above.
The LingoHubSDK.shared.update comes as true when I generate a new version of the package.

I've created a new project just to test the SDK and followed the steps in here:
https://lingohub.com/blog/2020/09/ios-sdk-localization
Screenshot 2023-10-16 at 16 51 30
Screenshot 2023-10-16 at 16 51 37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants