opening_hours 3.10.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/Makefile +7 -2
- package/README.md +14 -18
- package/build/opening_hours.esm.mjs +14896 -19393
- package/build/opening_hours.esm.mjs.map +1 -1
- package/build/opening_hours.js +14900 -19396
- package/package.json +2 -4
- package/site/js/countryToLanguageMapping.js +2 -3
- package/site/js/helpers.js +474 -313
- package/site/js/i18n-resources.js +554 -70
- package/site/js/main.js +379 -0
- package/site/js/opening_hours_table.js +233 -74
- package/site/js/theme.js +70 -0
- package/site/js/yohours_model.js +17 -15
- package/src/locales/i18n.js +62 -0
- package/src/locales/core.js +0 -20
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "commonjs",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"description": "Library to parse and process opening_hours tag from OpenStreetMap data",
|
|
6
|
-
"version": "3.
|
|
6
|
+
"version": "3.11.0",
|
|
7
7
|
"main": "./build/opening_hours.js",
|
|
8
8
|
"module": "./build/opening_hours.esm.mjs",
|
|
9
9
|
"sideEffects": false,
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"LICENSES/",
|
|
44
44
|
"REUSE.toml",
|
|
45
45
|
"site/js/",
|
|
46
|
-
"src/locales/
|
|
46
|
+
"src/locales/i18n.js",
|
|
47
47
|
"types/index.d.ts"
|
|
48
48
|
],
|
|
49
49
|
"directories": {
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
"test": "make check-full",
|
|
56
56
|
"lint": "eslint",
|
|
57
57
|
"lint:fix": "eslint --fix",
|
|
58
|
-
"osm-tag-data-check": "make osm-tag-data-check",
|
|
59
58
|
"benchmark": "make benchmark",
|
|
60
59
|
"interactive_testing": "make run-interactive_testing",
|
|
61
60
|
"regex_search": "make run-regex_search",
|
|
@@ -65,7 +64,6 @@
|
|
|
65
64
|
},
|
|
66
65
|
"dependencies": {
|
|
67
66
|
"i18next": "^25.3.2",
|
|
68
|
-
"i18next-browser-languagedetector": "^8.2.0",
|
|
69
67
|
"suncalc": "^1.9.0"
|
|
70
68
|
},
|
|
71
69
|
"devDependencies": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Upstream source: https://wiki.openstreetmap.org/wiki/Nominatim/Country_Codes
|
|
3
3
|
*/
|
|
4
|
-
const countryToLanguageMapping = {
|
|
4
|
+
export const countryToLanguageMapping = {
|
|
5
5
|
'ad': 'ca',
|
|
6
6
|
'ae': 'ar',
|
|
7
7
|
'af': 'fa,ps',
|
|
@@ -228,8 +228,7 @@ const countryToLanguageMapping = {
|
|
|
228
228
|
'zm': 'en',
|
|
229
229
|
'zw': 'en,sn,nd ',
|
|
230
230
|
};
|
|
231
|
-
|
|
232
|
-
function mapCountryToLanguage(country_code) {
|
|
231
|
+
export function mapCountryToLanguage(country_code) {
|
|
233
232
|
if (typeof countryToLanguageMapping[country_code] !== 'undefined') {
|
|
234
233
|
return countryToLanguageMapping[country_code];
|
|
235
234
|
} else {
|