Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode - exclude certain strings from localization

When localizing my storyboard, I get entries in my strings file that look like:

/* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "vHF-LZ-23i"; */ "vHF-LZ-23i.title" = "Text Cell";

Is there anyway to exclude dummy text or other strings from going into the storyboard localization strings files?

like image 318
davis Avatar asked Aug 05 '15 23:08

davis


1 Answers

As Jenszcz mentioned in his comment that you can solve this problem by using BartyCrouch open-source project, I was curios to give it a try And worked excellently :) Here are the steps I followed to get it work within 5 minutes.

1- Install BartyCrouch. See the installation procedure from url.

2- Created a sample project, which you can access here. In that project created 2 labels ("Text Included" & "Text Excluded #bc-ignore!").

3- Add RunScript (instructions on how to add a build script here)

if which bartycrouch > /dev/null; then
    bartycrouch update -x
    bartycrouch lint -x
else
    echo "warning: BartyCrouch not installed, download it from https://github.com/Flinesoft/BartyCrouch"
fi

enter image description here

4- After building the project the Main.strings file excluded one label.Here are the screenshots showing the storyboard file & .strings file. enter image description hereenter image description here

like image 148
iMemon Avatar answered Nov 01 '22 07:11

iMemon