Skip to content

Commit e52f2e7

Browse files
committed
Merge pull request #23 from rakaramos/source
Add Autolayout and NSLocalizedString hint
2 parents 5a8f042 + 7cb65d1 commit e52f2e7

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
layout: post
3+
title: "Autolayout and NSLocalizedString"
4+
author: rafa
5+
date: 2015-09-02 20:00:52 +0200
6+
comments: false
7+
categories:
8+
---
9+
10+
A localized application is the one that has all of its texts, translated into the users device current language. And this, for us developers, means one thing, and one thing only. Nightmare.
11+
12+
Every time a new translation comes, it's necessary to run the application and check for broken layouts. Take this quite simple UI.
13+
14+
{% img center /images/autolayout-and-nslocalizedstrings/01.png 375 %}
15+
16+
Simple, huh?
17+
18+
All right, here's what you have to do to get covered with future translations, and avoid autolayout nightmares.
19+
20+
Add `-NSDoubleLocalizedStrings YES` to `Arguments Passed On Launch` to the `Run` section at your `Project Schemes`.
21+
22+
{% img center /images/autolayout-and-nslocalizedstrings/02.png %}
23+
24+
This argument will duplicate all strings loaded using `NSLocalizedString`.
25+
26+
{% img center /images/autolayout-and-nslocalizedstrings/03.png 375 %}
27+
28+
What's better then that? What about finding out unlocalized strings?
29+
30+
So, `-NSShowNonLocalizedStrings YES` comes to rescue!
31+
32+
Great! Now you go and get yourself a cup of coffee while the translation team does their job :)
Loading
Loading
Loading

0 commit comments

Comments
 (0)