Questions tagged [genstrings]
29 questions
16
votes
6 answers
Is there an easy way to merge Localizable.strings files?
Problem: Using genstrings to create Localizable.strings files from a project. A few weeks later, some things changed and I run genstrings again. 75% of the new file is already in the old file. How could I merge the new file with the old file, so…

dontWatchMyProfile
- 45,440
- 50
- 177
- 260
14
votes
2 answers
iPhone: Update Localizable.strings files using genstrings?
I have generated my strings file correctly using genstrings. I have changed the localized strings for my different languages. Now, I have added a few more NSLocalizedString() occurrences and I want to generate those into all of my localized…

Nic Hubbard
- 41,587
- 63
- 251
- 412
14
votes
2 answers
genstrings chokes when using the value parameter in Swift
I have a basic Swift file Test.swift which contains
import Foundation
import UIKit
class Test: NSObject {
let a: String
let b: String
override init() {
a = NSLocalizedString("key 1", tableName: nil,
bundle:…

hennes
- 9,147
- 4
- 43
- 63
11
votes
3 answers
iOS - genstrings: couldn't connect to output directory en.lproj
I searched for this error online and here. Online it shows me results in a different language then english nice Google. Here it has one post and a guy that never really answered the guys question.
I have my xcode project folder on my desktop. Inside…

I00I
- 413
- 1
- 4
- 18
8
votes
2 answers
Force genstrings to build the Localizable.strings file in order of appearance rather than alphabetically
I'm new to internationalization and localization for iOS. I'm running genstrings:
find . -name \*.m | xargs genstrings -o en.lproj to generate my Localizable.strings files. It builds the file in alphabetical order (by key).
For ease of translation…

MattyG
- 8,449
- 6
- 44
- 48
7
votes
1 answer
Swift Localization: Genstrings
I'm trying to prepare my app to be passed off to translators for localization, but I'm running into some issues. I added the file "Localizable.strings" to my project, and I have "Use Base Internationalization" checked.
Looking at my app in Xcode,…

Randoms
- 2,110
- 2
- 20
- 31
7
votes
1 answer
Can genstrings work on custom #defines?
The macros iOS has for creating localized strings are pretty awesome when used with genstrings. However, I'd like to create my own #define on top of one of the macros like so:
#define MyLocalizedStringWithDefaultValue(key, tbl, val, comment)…

Mike
- 1,112
- 1
- 13
- 20
6
votes
0 answers
genstrings -s still matches with NSLocalizedString*
I think this is either a genstrings bug or "feature", but wanted to see if anyone has come across this or knows the answer. I was planning on opening a Radar for this.
We use our own localization macro. Let's call it CustomLocalizedString. In our…

Mobile Ben
- 7,121
- 1
- 27
- 43
5
votes
1 answer
Character encoding of Localizable.strings, generated by genstrings
In my "ViewController.swift", I have a localized string:
TheOutLabel.text = NSLocalizedString("hello", comment: "The \"hello\" word")
In the Terminal, to generate the "Localizable.strings" file, I typed:
cd Base.lproj/; genstrings ../*.swift; cat…

duthen
- 848
- 6
- 14
3
votes
1 answer
Is there a way to make `genstrings` work with `LocalizedStringKey`?
Is there a way get Apple's genstrings command line tool to recognize localizable string keys defined from SwiftUI's LocalizedStringKey initializer?
For this input file (testing-genstrings.swift): ...
import UIKit
import SwiftUI
enum L10n {
…

sizzle beam
- 555
- 4
- 10
3
votes
7 answers
genstrings tool throwing exception, aborting when parsing XCode project
I've been using genstrings to build strings files to internationalize my iPhone app. However, some changes I made recently have caused the genstrings tool to start throwing errors like this:
s1075-88:Directory jason$ genstrings -o en.lproj…

Jason
- 14,517
- 25
- 92
- 153
3
votes
1 answer
Change genstrings generated key (Object ID) extracted from Storyboard for localization?
I pressed the Localize... button on my storyboard to generate a strings file so that the storyboard may be localized into other languages.
In one the strings file that corresponds to a storyboard, I see something like this:
"orz-58-mzb.text" = "We…

ninjaneer
- 6,951
- 8
- 60
- 104
3
votes
0 answers
How to run genstrings on only files of Xcode project's active target?
I've been using a Build Phase Run Script to execute a shell script that finds all the *.m files in my project directory, and passes them to genstrings, as a way of creating my localizable strings file.
find ${SOURCE_ROOT} -name "*.m" -print0 | xargs…

mahboudz
- 39,196
- 16
- 97
- 124
2
votes
4 answers
genstrings does not work with macro for NSLocalizedString
I would like to shorten "NSLocalizedString" to "_" so I'm using macro
_(x) NSLocalizedString(@x, @__FILE__)
.
But now, when I want to generate strings for localization with
find . -name \*.m | xargs genstrings
it generates nothing.
Any help?

user500
- 4,519
- 6
- 43
- 56
2
votes
0 answers
Has anyone got String type enums to work with genstrings?
I'm trying to use genstrings in my project to output a localized strings file. It works fine and dandy when, say, you have a string represented like this:
NSLocalizedString("My String", comment: "My String")
However, I've decided to use String-type…

John Rogers
- 2,192
- 19
- 29