How to make UILabel content non-localizable when generating a string via ibtool?

I have tags on my xib. Some of them do not have to be localized. When I create a line file through ibtool, the contents of all the shortcuts are included in the result file. How can I exclude some user interface objects in IB from localization when generating strings?

+5
ios interface-builder localization xib
source share
2 answers

Unfortunately, there is no way to annotate the contents of your nib / xib files so that the ibtool --export-strings-file command ignores certain lines.

Instead, you can use the --export-xliff option and then edit the XLIFF file to block segments that should not be translated (attribute translate="no" ) before sending them for localization in all your languages. This is probably worth doing only if the locators use an XLIFF-compatible CAT tool.

+2
source share

If the reason you donโ€™t want to localize some views is because you plan to set your values โ€‹โ€‹programmatically , then you can check out the BartyCrouch tool that I recently wrote to solve this problem (see the installation instructions in my answer in this topic).

BartyCrouch launches ibtool for you and performs additional processing on top of its resulting .strings file. It will exclude submissions from the translation if you enable #bc-ignore! in its meaning in its basic internationalized Storyboard / XIB file.

For more information, visit the README section on GitHub .

0
source share

All Articles