From b97f582c90d73161ca7c20326815e3ea1f20e820 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Fri, 6 Nov 2020 17:30:21 -0800 Subject: [PATCH] Added Polish language. Bug fixes. --- components/metrics/RealtimeLog.js | 6 +++--- components/metrics/RealtimeViews.js | 2 +- lib/lang.js | 5 +++++ package.json | 2 +- public/country/pl-PL.json | 1 + 5 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 public/country/pl-PL.json diff --git a/components/metrics/RealtimeLog.js b/components/metrics/RealtimeLog.js index 6c39dd87..9d6c8e63 100644 --- a/components/metrics/RealtimeLog.js +++ b/components/metrics/RealtimeLog.js @@ -88,7 +88,7 @@ export default function RealtimeLog({ data, websites }) { } function getWebsite({ website_id }) { - return websites.find(n => n.website_id === website_id)?.name; + return websites.find(n => n.website_id === website_id); } function getDetail({ @@ -111,7 +111,7 @@ export default function RealtimeLog({ data, websites }) { ); } if (view_id) { - const domain = getWebsite({ website_id }); + const domain = getWebsite({ website_id })?.domain; return ( {getDetail(row)} -
{getWebsite(row)}
+ {websites.length > 0 &&
{getWebsite(row)?.domain}
} ); }; diff --git a/components/metrics/RealtimeViews.js b/components/metrics/RealtimeViews.js index f07facef..60d2b257 100644 --- a/components/metrics/RealtimeViews.js +++ b/components/metrics/RealtimeViews.js @@ -55,7 +55,7 @@ export default function RealtimeViews({ websiteId, data, websites }) { pageviews .reduce((arr, { url, website_id }) => { if (url?.startsWith('/')) { - if (!websiteId) { + if (!websiteId && websites.length > 0) { url = `${getDomain(website_id)}${url}`; } const row = arr.find(({ x }) => x === url); diff --git a/lib/lang.js b/lib/lang.js index 07df1837..68ff4a28 100644 --- a/lib/lang.js +++ b/lib/lang.js @@ -12,6 +12,7 @@ import { ja, nb, nl, + pl, pt, ro, ru, @@ -43,6 +44,7 @@ import idMessages from 'lang-compiled/id-ID.json'; import ukMessages from 'lang-compiled/uk-UA.json'; import fiMessages from 'lang-compiled/fi-FI.json'; import csMessages from 'lang-compiled/cs-CZ.json'; +import plMessages from 'lang-compiled/pl-PL.json'; export const messages = { 'en-US': enMessages, @@ -67,6 +69,7 @@ export const messages = { 'uk-UA': ukMessages, 'fi-FI': fiMessages, 'cs-CZ': csMessages, + 'pl-PL': plMessages, }; export const dateLocales = { @@ -92,6 +95,7 @@ export const dateLocales = { 'uk-UA': uk, 'fi-FI': fi, 'cs-CZ': cs, + 'pl-PL': pl, }; export const menuOptions = [ @@ -110,6 +114,7 @@ export const menuOptions = [ { label: 'Монгол', value: 'mn-MN', display: 'mn' }, { label: 'Nederlands', value: 'nl-NL', display: 'nl' }, { label: 'Norsk Bokmål', value: 'nb-NO', display: 'nb' }, + { label: 'Polski', value: 'pl-PL', display: 'pl' }, { label: 'Português', value: 'pt-PT', display: 'pt' }, { label: 'Русский', value: 'ru-RU', display: 'ru' }, { label: 'Română', value: 'ro-RO', display: 'ro' }, diff --git a/package.json b/package.json index cfab3adf..904a2d7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "umami", - "version": "1.4.0", + "version": "1.5.0", "description": "A simple, fast, website analytics alternative to Google Analytics. ", "author": "Mike Cao ", "license": "MIT", diff --git a/public/country/pl-PL.json b/public/country/pl-PL.json new file mode 100644 index 00000000..121fef86 --- /dev/null +++ b/public/country/pl-PL.json @@ -0,0 +1 @@ +{"AF":"Afganistan","AL":"Albania","DZ":"Algieria","AD":"Andora","AO":"Angola","AI":"Anguilla","AQ":"Antarktyda","AG":"Antigua i Barbuda","SA":"Arabia Saudyjska","AR":"Argentyna","AM":"Armenia","AW":"Aruba","AU":"Australia","AT":"Austria","AZ":"Azerbejd\u017can","BS":"Bahamy","BH":"Bahrajn","BD":"Bangladesz","BB":"Barbados","BE":"Belgia","BZ":"Belize","BJ":"Benin","BM":"Bermudy","BT":"Bhutan","BY":"Bia\u0142oru\u015b","BO":"Boliwia","BA":"Bo\u015bnia i Hercegowina","BW":"Botswana","BR":"Brazylia","BN":"Brunei","IO":"Brytyjskie Terytorium Oceanu Indyjskiego","VG":"Brytyjskie Wyspy Dziewicze","BG":"Bu\u0142garia","BF":"Burkina Faso","BI":"Burundi","CL":"Chile","CN":"Chiny","HR":"Chorwacja","CI":"C\u00f4te d\u2019Ivoire","CW":"Cura\u00e7ao","CY":"Cypr","TD":"Czad","ME":"Czarnog\u00f3ra","CZ":"Czechy","UM":"Dalekie Wyspy Mniejsze Stan\u00f3w Zjednoczonych","DK":"Dania","CD":"Demokratyczna Republika Konga","DM":"Dominika","DO":"Dominikana","DJ":"D\u017cibuti","EG":"Egipt","EC":"Ekwador","ER":"Erytrea","EE":"Estonia","SZ":"Eswatini","ET":"Etiopia","FK":"Falklandy","FJ":"Fid\u017ci","PH":"Filipiny","FI":"Finlandia","FR":"Francja","TF":"Francuskie Terytoria Po\u0142udniowe i Antarktyczne","GA":"Gabon","GM":"Gambia","GS":"Georgia Po\u0142udniowa i Sandwich Po\u0142udniowy","GH":"Ghana","GI":"Gibraltar","GR":"Grecja","GD":"Grenada","GL":"Grenlandia","GE":"Gruzja","GU":"Guam","GG":"Guernsey","GY":"Gujana","GF":"Gujana Francuska","GP":"Gwadelupa","GT":"Gwatemala","GN":"Gwinea","GW":"Gwinea Bissau","GQ":"Gwinea R\u00f3wnikowa","HT":"Haiti","ES":"Hiszpania","NL":"Holandia","HN":"Honduras","IN":"Indie","ID":"Indonezja","IQ":"Irak","IR":"Iran","IE":"Irlandia","IS":"Islandia","IL":"Izrael","JM":"Jamajka","JP":"Japonia","YE":"Jemen","JE":"Jersey","JO":"Jordania","KY":"Kajmany","KH":"Kambod\u017ca","CM":"Kamerun","CA":"Kanada","QA":"Katar","KZ":"Kazachstan","KE":"Kenia","KG":"Kirgistan","KI":"Kiribati","CO":"Kolumbia","KM":"Komory","CG":"Kongo","KR":"Korea Po\u0142udniowa","KP":"Korea P\u00f3\u0142nocna","CR":"Kostaryka","CU":"Kuba","KW":"Kuwejt","LA":"Laos","LS":"Lesotho","LB":"Liban","LR":"Liberia","LY":"Libia","LI":"Liechtenstein","LT":"Litwa","LU":"Luksemburg","LV":"\u0141otwa","MK":"Macedonia P\u00f3\u0142nocna","MG":"Madagaskar","YT":"Majotta","MW":"Malawi","MV":"Malediwy","MY":"Malezja","ML":"Mali","MT":"Malta","MP":"Mariany P\u00f3\u0142nocne","MA":"Maroko","MQ":"Martynika","MR":"Mauretania","MU":"Mauritius","MX":"Meksyk","FM":"Mikronezja","MM":"Mjanma (Birma)","MD":"Mo\u0142dawia","MC":"Monako","MN":"Mongolia","MS":"Montserrat","MZ":"Mozambik","NA":"Namibia","NR":"Nauru","NP":"Nepal","BQ":"Niderlandy Karaibskie","DE":"Niemcy","NE":"Niger","NG":"Nigeria","NI":"Nikaragua","NU":"Niue","NF":"Norfolk","NO":"Norwegia","NC":"Nowa Kaledonia","NZ":"Nowa Zelandia","OM":"Oman","PK":"Pakistan","PW":"Palau","PA":"Panama","PG":"Papua-Nowa Gwinea","PY":"Paragwaj","PE":"Peru","PN":"Pitcairn","PF":"Polinezja Francuska","PL":"Polska","PR":"Portoryko","PT":"Portugalia","ZA":"Republika Po\u0142udniowej Afryki","CF":"Republika \u015arodkowoafryka\u0144ska","CV":"Republika Zielonego Przyl\u0105dka","RE":"Reunion","RU":"Rosja","RO":"Rumunia","RW":"Rwanda","EH":"Sahara Zachodnia","KN":"Saint Kitts i Nevis","LC":"Saint Lucia","VC":"Saint Vincent i Grenadyny","BL":"Saint-Barth\u00e9lemy","MF":"Saint-Martin","PM":"Saint-Pierre i Miquelon","SV":"Salwador","WS":"Samoa","AS":"Samoa Ameryka\u0144skie","SM":"San Marino","SN":"Senegal","RS":"Serbia","SC":"Seszele","SL":"Sierra Leone","SG":"Singapur","SX":"Sint Maarten","SK":"S\u0142owacja","SI":"S\u0142owenia","SO":"Somalia","HK":"SRA Hongkong (Chiny)","MO":"SRA Makau (Chiny)","LK":"Sri Lanka","US":"Stany Zjednoczone","SD":"Sudan","SS":"Sudan Po\u0142udniowy","SR":"Surinam","SJ":"Svalbard i Jan Mayen","SY":"Syria","CH":"Szwajcaria","SE":"Szwecja","TJ":"Tad\u017cykistan","TH":"Tajlandia","TW":"Tajwan","TZ":"Tanzania","PS":"Terytoria Palesty\u0144skie","TL":"Timor Wschodni","TG":"Togo","TK":"Tokelau","TO":"Tonga","TT":"Trynidad i Tobago","TN":"Tunezja","TR":"Turcja","TM":"Turkmenistan","TC":"Turks i Caicos","TV":"Tuvalu","UG":"Uganda","UA":"Ukraina","UY":"Urugwaj","UZ":"Uzbekistan","VU":"Vanuatu","WF":"Wallis i Futuna","VA":"Watykan","VE":"Wenezuela","HU":"W\u0119gry","GB":"Wielka Brytania","VN":"Wietnam","IT":"W\u0142ochy","BV":"Wyspa Bouveta","CX":"Wyspa Bo\u017cego Narodzenia","IM":"Wyspa Man","SH":"Wyspa \u015awi\u0119tej Heleny","AX":"Wyspy Alandzkie","CK":"Wyspy Cooka","VI":"Wyspy Dziewicze Stan\u00f3w Zjednoczonych","HM":"Wyspy Heard i McDonalda","CC":"Wyspy Kokosowe","MH":"Wyspy Marshalla","FO":"Wyspy Owcze","SB":"Wyspy Salomona","ST":"Wyspy \u015awi\u0119tego Tomasza i Ksi\u0105\u017c\u0119ca","ZM":"Zambia","ZW":"Zimbabwe","AE":"Zjednoczone Emiraty Arabskie"} \ No newline at end of file