Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add comment to storyboard localization

Is it possible to add comment to a localized string in storyboard?

/* Class = "IBUILabel"; text = "Some text"; comment = "This is the comment to help translator" ObjectID = "0N3-up-Ts6"; */
"0N3-up-Ts6.text" = "Some text";
like image 449
JastinBall Avatar asked Jul 03 '14 09:07

JastinBall


2 Answers

It appears you can:

enter image description here

This produces:

/* Class = "UILabel"; text = "Title"; ObjectID = "KjJ-0v-J2z"; Note = "Comment for Localizer"; */
"KjJ-0v-J2z.text" = "Title";
like image 194
jjrscott Avatar answered Oct 24 '22 03:10

jjrscott


You can add a user-defined attribute:

User-defined attribute in Xcode

It will appear thus in the XIB:

<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="s1b-V9-EN7">
  <rect key="frame" x="20" y="45" width="728" height="959"/>
  <subviews>
     <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" v
       <rect key="frame" x="215" y="688" width="92" height="21"/>
       // . . . . etc . . . . 
       <userDefinedRuntimeAttributes>
          <userDefinedRuntimeAttribute type="string" keyPath="localization_comment" value="&quot;Some text to help the translator">
       </userDefinedRuntimeAttributes>
     </label>
  </subviews>
</view>
like image 23
tooluser Avatar answered Oct 24 '22 01:10

tooluser