From bf27ab7f0adab638adee914ffa07e4ccc3d209f6 Mon Sep 17 00:00:00 2001 From: commenthol Date: Thu, 27 Dec 2018 09:28:04 +0100 Subject: [PATCH] fix: country name translation issue --- src/Data.js | 2 +- test/issue-translate.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Data.js b/src/Data.js index f7f26497..b9c2651a 100644 --- a/src/Data.js +++ b/src/Data.js @@ -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 } diff --git a/test/issue-translate.js b/test/issue-translate.js index 4840d407..e33de82c 100644 --- a/test/issue-translate.js +++ b/test/issue-translate.js @@ -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, 'دولة الإمارات العربية المتحدة') + }) })