Skip to content

Instantly share code, notes, and snippets.

@steipete
Created August 27, 2013 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steipete/6357231 to your computer and use it in GitHub Desktop.
Save steipete/6357231 to your computer and use it in GitHub Desktop.
PSPDFSetLocalizationBlock(^NSString *(NSString *stringToLocalize) {
// This will look up strings in language/PSPDFKit.strings inside your resource folder.
return NSLocalizedStringFromTable(stringToLocalize, @"PSPDFKit", nil);
// You can also route translation through your default localization:
return NSLocalizedString(stringToLocalize, nil);
// Or use a custom variant, for example to test if everything is localized:
// Please keep in mind that several strings like "Edit" are provided by the system and automatically translated, provided that you have the correct localization resources set.
return [NSString stringWithFormat:@"_____%@_____", stringToLocalize];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment