Skip to content

Commit

Permalink
Merge pull request #17 from andresilvagomez/master
Browse files Browse the repository at this point in the history
v1.5.1
  • Loading branch information
andresilvagomez authored Aug 10, 2017
2 parents 43e8622 + 9402d23 commit 8782d37
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

---

## [1.5.1](https://github.com/kekiiwaa/Localize/releases/tag/1.5.1)
Released on 2017-08-10.

#### Added
- Fix with country code.
- By [Andres Silva](https://github.com/andresilvagomez) in Pull Request
[#14](https://github.com/Kekiiwaa/Localize/pull/17).

---

## [1.5.0](https://github.com/kekiiwaa/Localize/releases/tag/1.5.0)
Released on 2017-08-08.

Expand Down
4 changes: 2 additions & 2 deletions Localize.podspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Pod::Spec.new do |s|

s.name = "Localize"
s.version = "1.5.0"
s.version = "1.5.1"
s.license = 'MIT'
s.summary = "Localize is a framework writed in swift to localize your projects easier improves i18n, including storyboards and strings."
s.homepage = "https://github.com/Kekiiwaa/Localize"
s.author = { "Kekiiwaa" => "andresilvagomez@gmail.com" }
s.source = { :git => "https://github.com/Kekiiwaa/Localize.git", :tag => "1.5.0" }
s.source = { :git => "https://github.com/Kekiiwaa/Localize.git", :tag => "1.5.1" }

s.ios.deployment_target = '8.0'
s.source_files = "Source/*.swift"
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
pod 'Localize' , '~> 1.5.0'
pod 'Localize' , '~> 1.5.1'
end
```

Expand Down
9 changes: 8 additions & 1 deletion Source/LocalizeJson.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@ class LocalizeJson: LocalizeCommonProtocol, LocalizeProtocol {
/// As long as the default language is the same as the current one.
private func readJSON(tableName:String? = nil) -> NSDictionary? {
let tableName = tableName ?? self.fileName
let lang = self.currentLanguage
var lang = self.currentLanguage
var json = self.readJSON(named: "\(tableName)-\(lang)")

if json != nil {
return json
}

lang = lang.components(separatedBy: "-")[0]
json = self.readJSON(named: "\(tableName)-\(lang)")

if json == nil && lang != self.defaultLanguage {
json = self.readDefaultJSON()
}
Expand Down

0 comments on commit 8782d37

Please sign in to comment.