Skip to content

Commit

Permalink
fix: country name translation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
commenthol committed Dec 27, 2018
1 parent 7265b68 commit bf27ab7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Data {
const o = {}
const countries = _.get(this.data, 'holidays', {})
Object.keys(countries).forEach((country) => {
o[country] = this._name(countries, country, lang)
o[country] = this._name(countries, country, lang, { country })
})
return o
}
Expand Down
6 changes: 6 additions & 0 deletions test/issue-translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,10 @@ describe('#issue-translate', function () {
assert.ok(res.includes('Dreikönigstag'))
assert.ok(res.includes('Stephanstag'))
})

it('should get country name by spoken language', function () {
const hd = new Holidays(fixtures.holidays)
const res = hd.getCountries()
assert.strictEqual(res.AE, 'دولة الإمارات العربية المتحدة')
})
})

0 comments on commit bf27ab7

Please sign in to comment.