Open rlam3 opened 7 years ago
It seems to work well
I'm getting a weird error that i cannot run the ./genstrings file. How do I run this file?
Would love to see a video tutorial for this cocoapod. Thanks!
@RemyDCF How do we localize storyboard labels with use of localize-swift? It doesn't seem to be pickup the localizations/labels from storyboard. Thanks!
Unfortunately, If you want to localize statics objects in storyboards, you can't use the genstrings.swift file, because this script will search all .localized() and NSLocalizedString (and others function to localize) in your project. The Storyboard is using a separate strings file, and instead of using a custom key, you have to use the storyboard iD of the object.
I made a little video to show you by image: https://youtu.be/HEuB7swacP0
In this video, you can see that:
Otherwise, you can use add an outlet to your view to change the text in your code with .localized() or NSLocalizedString
And if you don't find the genstrings.swift file, you can copy this to your folder.
You can run it with swift genstrings.swift > Localizable.swift
.
It's will work even if you don't have Localize-Swift in your project.
@RemyDCF
So in essence, if I translate the storyboards via the Localize
button on the right pane. Will Localize Swift pick up those elements? Or should I leave Storyboard Static string seperate from the string localization all together? Thanks!
I'm also looking at BartyCrouch.. Was wondering what your thoughts on this were as well
Seems to be another solution. I think you can use it for translate storyboards. Good luck!
This library works with Xcode 8.3 and Xcode 9: https://github.com/willpowell8/LocalizationKit_iOS
Does this work with 8.3 Xcode?