create a strings file for a custom storyboard - ios

I am localizing my app, and I have a custom storyboard I created called Into.storyboard. When I added a language to the app, it gave me an option to create strings files for Main.storyboard and LaunchScreen.storyboard, but not for my custom storyboard. How do I create one so that it automatically fills in the object IDs like it did for the other two storyboards? Thank you

At the right side inspector you can find button localize. Press it and choose languages.
Example

Related

Do I really need to add the same element twice, one for each UIStoryboard language file?

I am working in an internationalized Xcode project with two UIStoryboard files en.lproj/Main.storyboard and nl.lproj/Main.storyboard.
Is the consequence of this, that if I want to add a new element, say a UIButton to the storyboard, I have to add it twice, one for each file (and thus set the constraints etc also twice)?
This is how it looks in the navigator:
But selecting the base file actually selects the en.lproj/Main.storyboard, and after adding a button there it looks like I have to follow the same process in the other file.
Is this just the way it works?
No. The usual way is that you only have one storyboard that contains all the UI elements, constraints etc. in your "Base" language (e.g. English). For every additional language (e.g. German) you have a strings file that contains translations for all the texts (buttons, labels etc.) in your storyboard.

Base Storyboard Changes Not Reflected in Localized Storyboard

I have a localized Storyboard (Base and Spanish), and I just realized that after making some changes to the storyboard it did not make the corresponding changes on the Spanish version. Some of the changes I made were button color, added a new label, etc.
Any ideas as to why this happened? I'm assuming there is a correct flow that I did not follow for making updates.
I just realized that on this particular storyboard I had a localized storyboard instead of a localized strings file for the storyboard. In this case you have to edit the two storyboards separately. What I actually wanted was a localized strings file for the storyboard instead of two storyboards.

Swift Build Dynamic Apps

I want to develop an app, which can be modified programmatically. In my config.swift file, I save the main settings for my app. For example: If I want to create 5 textfields, I set a variable for that (in config.swift) and this will create me five textfields. This works perfectly! But as I do everything programmatically (e.g. adding textfields), I don't have the advantages of the visual storyboard. Is there a way to create UIElements dynamically, without dispensing the advantages of a storyboard?
Everything you can create in the Storyboard can be created in code. When you create your Storyboard it is set with that structure, but when you create it programmatically it´s more dynamic and you can create elements "on the fly".
The main advantage with the Storyboard is that you get a visual overview of your layout. Up to you to choose what suits your needs best.

Is it possible to comment on storyboards?

So I've been using Xcode 7's new feature to reference storyboards within storyboards. To add clarity to my references, I want to add a comment of sorts that can explain exactly why I've split up my storyboards.
Does this feature exist? I know I can create some dummy views but I feel like this is lazy and a bit inefficient.
In you identity inspector there is a place you can write notes, that's basically your comment section.
Select your storyboard Object
Click show the identity inspector.
Then write your comment in the document note section.
This is a good way of commenting visually on a storyboard, but still isn't perfect and is still a dummy view. I find it is probably the cleanest way to do it right now.
Add a Storyboard Reference to your storyboard
Navigate to the Identity Inspector on the Storyboard Reference you added
Set the Label attribute to your desired comment
You can now move the your comment wherever you want inside the storyboard
You can place comments inside the source code of the storyboard. Since .storyboard files are XML-based, you can write standard XML comments in it:
<!-- This is a comment -->
To open a storyboard as source code, right-click on the file in the Project navigator (the first icon from the left on the right sidebar) and select Open As/Source Code:
To return to Interface Builder, select Open As/Interface Builder - Storyboard from the same contextual menu.
WARNING: Always place these comments after the first line of the file, since Xcode expects an XML declaration there.

Localizing the Storyboard

I'm trying to localize a storyboard where the work has been done solely in the storyboard view (ie nothing has been done programmatically).
There are numerous elements like this in the storyboard and as such they do not appear in my Localizable.strings file (which does properly translate all elements, these elements have been programmatically added to the storyboard in various view controllers), however a "MainStoryboard-iPhone.strings (french)" is generated and as shown below:
contains the elements which I wish to translate.
Below is the highlighted element in the storyboard:
My question is: "How do I translate the storyboard elements using this .strings file? (there are no changes even when the text is translated in the .strings file), or is there another way to localize these storyboard elements?"
Thank you for your time.
appendix
A.

Resources