Skip to content

Commit

Permalink
yankodimitrov#48: Take localized string from default bundle if user's…
Browse files Browse the repository at this point in the history
… bundle misses it
  • Loading branch information
Roman Petrenko authored and ziogaschr committed Jun 10, 2016
1 parent f654ef9 commit cce3651
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PasscodeLock/Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import Foundation
func localizedStringFor(key: String, comment: String) -> String {

let name = "PasscodeLock"
let bundle = bundleForResource(name, ofType: "strings")
let defaultString = NSLocalizedString(key, tableName: name, bundle: NSBundle(forClass: PasscodeLock.self), comment: comment)

return NSLocalizedString(key, tableName: name, bundle: bundle, comment: comment)
return NSLocalizedString(key, value: defaultString, tableName: name, bundle: NSBundle.mainBundle(), comment: comment)
}

func bundleForResource(name: String, ofType type: String) -> NSBundle {
Expand Down

0 comments on commit cce3651

Please sign in to comment.