0

is there a possibility to set cocoa app, so it will translate NSString (placed in code) after launching without need of using NSLocalizedString ?

Thanks for help !

2 Answers 2

1

The answer is no. And you probably wouldn't want this anyway, as not every string should be localizable. Some of your strings may contain display text and hence need to be localizable through NSLocalizedString, and on the other hand some other of your strings may affect your logic, such as strings that define the name of a resource (e.g. the string you pass to loadNibNamed or the name of an image or audio file to load). These are really meant to be hardcoded and translating them would break your application.

Sign up to request clarification or add additional context in comments.

Comments

0

Not automatically, but you could create a simple macro to cut down on typing:

#define TRANS(s)    NSLocalizedString(s, nil)

1 Comment

But if you do this you won't be able to use the genstrings utility (developer.apple.com/library/mac/#documentation/Darwin/Reference/…) to automatically create your base language .strings file, as this utility scans your source files looking for occurrences of NSLocalizedStrings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.