How to disable localization warnings for some ui elements in Xcode?
Asked Answered
P

1

7

I develops multilingual iOS project that has translations for UI elements in %LANG%.lproj/%STORYBOARD_NAME%.strings:

/* Class = "UINavigationItem"; title = "User information"; ObjectID = "yXU-vS-01l"; */
"yXU-vS-01l.title" = "User information";

When UI element has no translation, Xcode writes warning in console:

Localizable string "yXU-vS-01l.title" not found in strings table "Main" of bundle CFBundle  (executable, loaded).

But some elements get its values at runtime only and doesn't need storyboard translations.

How can I disable warnings for such elements? Now I see two ways:

  1. Set localizable value as empty string
    It helps with navigation items or other elements with visible bounds, but elements as labels and buttons will be invisible in design-time and also can be resize to zero-width

  2. Add dummy translations to *.strings files
    Will be too timespently when number of supporting languages will increase

May be another way exists? Eg set some property for UI element?

Pratt answered 15/6, 2016 at 11:23 Comment(0)
N
0

It's Xcode 10.2 now and I think in order to get rid of those warnings You should disable "Localization Debugging" in "Edit Scheme" -> "Options" for this target.

Nympholepsy answered 30/5, 2019 at 15:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.