Added Polish language. Bug fixes.

This commit is contained in:
Mike Cao 2020-11-06 17:30:21 -08:00
parent f3b8e4654f
commit b97f582c90
5 changed files with 11 additions and 5 deletions

View File

@ -88,7 +88,7 @@ export default function RealtimeLog({ data, websites }) {
} }
function getWebsite({ website_id }) { 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({ function getDetail({
@ -111,7 +111,7 @@ export default function RealtimeLog({ data, websites }) {
); );
} }
if (view_id) { if (view_id) {
const domain = getWebsite({ website_id }); const domain = getWebsite({ website_id })?.domain;
return ( return (
<a <a
className={styles.link} className={styles.link}
@ -161,7 +161,7 @@ export default function RealtimeLog({ data, websites }) {
<Icon className={styles.icon} icon={getIcon(row)} /> <Icon className={styles.icon} icon={getIcon(row)} />
{getDetail(row)} {getDetail(row)}
</div> </div>
<div className={styles.website}>{getWebsite(row)}</div> {websites.length > 0 && <div className={styles.website}>{getWebsite(row)?.domain}</div>}
</div> </div>
); );
}; };

View File

@ -55,7 +55,7 @@ export default function RealtimeViews({ websiteId, data, websites }) {
pageviews pageviews
.reduce((arr, { url, website_id }) => { .reduce((arr, { url, website_id }) => {
if (url?.startsWith('/')) { if (url?.startsWith('/')) {
if (!websiteId) { if (!websiteId && websites.length > 0) {
url = `${getDomain(website_id)}${url}`; url = `${getDomain(website_id)}${url}`;
} }
const row = arr.find(({ x }) => x === url); const row = arr.find(({ x }) => x === url);

View File

@ -12,6 +12,7 @@ import {
ja, ja,
nb, nb,
nl, nl,
pl,
pt, pt,
ro, ro,
ru, ru,
@ -43,6 +44,7 @@ import idMessages from 'lang-compiled/id-ID.json';
import ukMessages from 'lang-compiled/uk-UA.json'; import ukMessages from 'lang-compiled/uk-UA.json';
import fiMessages from 'lang-compiled/fi-FI.json'; import fiMessages from 'lang-compiled/fi-FI.json';
import csMessages from 'lang-compiled/cs-CZ.json'; import csMessages from 'lang-compiled/cs-CZ.json';
import plMessages from 'lang-compiled/pl-PL.json';
export const messages = { export const messages = {
'en-US': enMessages, 'en-US': enMessages,
@ -67,6 +69,7 @@ export const messages = {
'uk-UA': ukMessages, 'uk-UA': ukMessages,
'fi-FI': fiMessages, 'fi-FI': fiMessages,
'cs-CZ': csMessages, 'cs-CZ': csMessages,
'pl-PL': plMessages,
}; };
export const dateLocales = { export const dateLocales = {
@ -92,6 +95,7 @@ export const dateLocales = {
'uk-UA': uk, 'uk-UA': uk,
'fi-FI': fi, 'fi-FI': fi,
'cs-CZ': cs, 'cs-CZ': cs,
'pl-PL': pl,
}; };
export const menuOptions = [ export const menuOptions = [
@ -110,6 +114,7 @@ export const menuOptions = [
{ label: 'Монгол', value: 'mn-MN', display: 'mn' }, { label: 'Монгол', value: 'mn-MN', display: 'mn' },
{ label: 'Nederlands', value: 'nl-NL', display: 'nl' }, { label: 'Nederlands', value: 'nl-NL', display: 'nl' },
{ label: 'Norsk Bokmål', value: 'nb-NO', display: 'nb' }, { 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: 'Português', value: 'pt-PT', display: 'pt' },
{ label: 'Русский', value: 'ru-RU', display: 'ru' }, { label: 'Русский', value: 'ru-RU', display: 'ru' },
{ label: 'Română', value: 'ro-RO', display: 'ro' }, { label: 'Română', value: 'ro-RO', display: 'ro' },

View File

@ -1,6 +1,6 @@
{ {
"name": "umami", "name": "umami",
"version": "1.4.0", "version": "1.5.0",
"description": "A simple, fast, website analytics alternative to Google Analytics. ", "description": "A simple, fast, website analytics alternative to Google Analytics. ",
"author": "Mike Cao <mike@mikecao.com>", "author": "Mike Cao <mike@mikecao.com>",
"license": "MIT", "license": "MIT",

View File

@ -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"}