Compare commits

..

4 Commits

Author SHA1 Message Date
Ben Phelps
0075429e08 add greeting and datetime info widgets 2022-09-16 10:53:12 +03:00
Ben Phelps
43f7ccd166 update readme attributions 2022-09-16 10:49:20 +03:00
Ángel Fernández Sánchez
8c64e0f288 Translated using Weblate (Spanish)
Currently translated at 100.0% (100 of 100 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-16 09:10:38 +02:00
Juan Manuel Bennàssar Carretero
c91a387833 Translated using Weblate (Spanish)
Currently translated at 100.0% (100 of 100 strings)

Translation: Homepage/Homepage
Translate-URL: https://hosted.weblate.org/projects/homepage/homepage/es/
2022-09-16 09:10:38 +02:00
6 changed files with 97 additions and 34 deletions

View File

@@ -9,7 +9,7 @@
- Images built for AMD64 (x86_64), ARM64, ARMv7 and ARMv6 - Images built for AMD64 (x86_64), ARM64, ARMv7 and ARMv6
- Supports all Raspberry Pi's, most SBCs & Apple Silicon - Supports all Raspberry Pi's, most SBCs & Apple Silicon
- Full i18n support with automatic language detection - Full i18n support with automatic language detection
- Translations for Chinese, Dutch, French, German, Norwegian Bokmål, Portuguese, Russian and Spanish - Translations for Chinese, Dutch, French, German, Norwegian Bokmål, Polish, Portuguese, Russian and Spanish
- Want to help translate? [Join the Weblate project](https://hosted.weblate.org/engage/homepage/) - Want to help translate? [Join the Weblate project](https://hosted.weblate.org/engage/homepage/)
- Service & Web Bookmarks - Service & Web Bookmarks
- Docker Integration - Docker Integration
@@ -132,6 +132,7 @@ Huge thanks to the all the contributors who have helped make this project what i
- [modem7](https://github.com/benphelps/homepage/commits?author=modem7) - Impvoed Docker Image - [modem7](https://github.com/benphelps/homepage/commits?author=modem7) - Impvoed Docker Image
- [nicedc](https://github.com/benphelps/homepage/commits?author=nicedc) - Chinese Translation - [nicedc](https://github.com/benphelps/homepage/commits?author=nicedc) - Chinese Translation
- [Nonoss117](https://github.com/benphelps/homepage/commits?author=Nonoss117) - French Translation - [Nonoss117](https://github.com/benphelps/homepage/commits?author=Nonoss117) - French Translation
- [psychodracon](https://github.com/benphelps/homepage/commits?author=psychodracon) - Polish Translation
- [quod](https://github.com/benphelps/homepage/commits?author=quod) - Fixed Typos - [quod](https://github.com/benphelps/homepage/commits?author=quod) - Fixed Typos
- [schklom](https://github.com/benphelps/homepage/commits?author=schklom) - ARM64, ARMv7 and ARMv6 - [schklom](https://github.com/benphelps/homepage/commits?author=schklom) - ARM64, ARMv7 and ARMv6
- [xicopitz](https://github.com/benphelps/homepage/commits?author=xicopitz) - Gotify & Prowlarr Integration - [xicopitz](https://github.com/benphelps/homepage/commits?author=xicopitz) - Gotify & Prowlarr Integration

View File

@@ -14,37 +14,37 @@
"load": "Carga" "load": "Carga"
}, },
"docker": { "docker": {
"rx": "Recibido", "rx": "RX",
"tx": "Transmitido", "tx": "TX",
"mem": "Memoria", "mem": "MEM",
"cpu": "Procesador", "cpu": "CPU",
"offline": "Desconectado" "offline": "Desconectado"
}, },
"emby": { "emby": {
"playing": "En ejecución", "playing": "Reproduciendo",
"transcoding": "Transcodificando", "transcoding": "Transcodificando",
"bitrate": "Tasa de Bits", "bitrate": "Tasa de bits",
"no_active": "No hay streams activos" "no_active": "Sin transmisiones activas"
}, },
"tautulli": { "tautulli": {
"playing": "En ejecución", "playing": "Reproduciendo",
"transcoding": "Transcodificación", "transcoding": "Transcodificando",
"bitrate": "Tasa de bits", "bitrate": "Tasa de bits",
"no_active": "No hay streams activos" "no_active": "Sin transmisiones activas"
}, },
"rutorrent": { "rutorrent": {
"active": "Activo", "active": "Activo",
"upload": "Subida", "upload": "Carga",
"download": "Descarga" "download": "Descarga"
}, },
"sonarr": { "sonarr": {
"wanted": "Más deseado", "wanted": "Querido",
"queued": "Puesto en cola", "queued": "En cola",
"series": "Series" "series": "Series"
}, },
"radarr": { "radarr": {
"wanted": "Más deseado", "wanted": "Querido",
"queued": "Puesto en cola", "queued": "En cola",
"movies": "Películas" "movies": "Películas"
}, },
"readarr": { "readarr": {
@@ -88,7 +88,7 @@
"total": "Total" "total": "Total"
}, },
"weather": { "weather": {
"current": "Ubicación Actual", "current": "Ubicación actual",
"allow": "Haga clic para permitir", "allow": "Haga clic para permitir",
"updating": "Actualizando", "updating": "Actualizando",
"wait": "Espere, por favor" "wait": "Espere, por favor"
@@ -99,12 +99,12 @@
"available": "Disponible" "available": "Disponible"
}, },
"sabnzbd": { "sabnzbd": {
"rate": "Tasa de descarga", "rate": "Tasa",
"queue": "Puesto en cola", "queue": "Cola",
"timeleft": "Tiempo Restante" "timeleft": "Tiempo restante"
}, },
"nzbget": { "nzbget": {
"rate": "Tasa de descarga", "rate": "Tasa",
"remaining": "Restante", "remaining": "Restante",
"downloaded": "Descargado" "downloaded": "Descargado"
}, },
@@ -129,21 +129,21 @@
}, },
"transmission": { "transmission": {
"download": "Descarga", "download": "Descarga",
"upload": "Subida", "upload": "Carga",
"leech": "Egoístas (Leech)", "leech": "Compañeros",
"seed": "Semillas" "seed": "Semillas"
}, },
"jackett": { "jackett": {
"configured": "Configured", "configured": "Configurado",
"errored": "Errored" "errored": "Errores"
}, },
"bazarr": { "bazarr": {
"missingEpisodes": "Missing Episodes", "missingEpisodes": "Episodios perdidos",
"missingMovies": "Missing Movies" "missingMovies": "Películas perdidas"
}, },
"lidarr": { "lidarr": {
"queued": "Queued", "queued": "Puesto en cola",
"wanted": "Wanted", "wanted": "Más deseado",
"albums": "Albums" "albums": "Álbumes"
} }
} }

View File

@@ -2,6 +2,8 @@ import WeatherApi from "components/widgets/weather/weather";
import OpenWeatherMap from "components/widgets/openweathermap/weather"; import OpenWeatherMap from "components/widgets/openweathermap/weather";
import Resources from "components/widgets/resources/resources"; import Resources from "components/widgets/resources/resources";
import Search from "components/widgets/search/search"; import Search from "components/widgets/search/search";
import Greeting from "components/widgets/greeting/greeting";
import DateTime from "components/widgets/datetime/datetime";
const widgetMappings = { const widgetMappings = {
weather: WeatherApi, // This key will be deprecated in the future weather: WeatherApi, // This key will be deprecated in the future
@@ -9,13 +11,15 @@ const widgetMappings = {
openweathermap: OpenWeatherMap, openweathermap: OpenWeatherMap,
resources: Resources, resources: Resources,
search: Search, search: Search,
greeting: Greeting,
datetime: DateTime,
}; };
export default function Widget({ widget }) { export default function Widget({ widget }) {
const ServiceWidget = widgetMappings[widget.type]; const InfoWidget = widgetMappings[widget.type];
if (ServiceWidget) { if (InfoWidget) {
return <ServiceWidget options={widget.options} />; return <InfoWidget options={widget.options} />;
} }
return ( return (

View File

@@ -0,0 +1,36 @@
import { useState, useEffect } from "react";
import { useTranslation } from "react-i18next";
const textSizes = {
"4xl": "text-4xl",
"3xl": "text-3xl",
"2xl": "text-2xl",
xl: "text-xl",
lg: "text-lg",
md: "text-md",
sm: "text-sm",
xs: "text-xs",
};
export default function DateTime({ options }) {
const { text_size: textSize, format } = options;
const { i18n } = useTranslation();
const [date, setDate] = useState(new Date());
useEffect(() => {
const interval = setInterval(() => {
setDate(new Date());
}, 1000);
return () => clearInterval(interval);
}, [setDate]);
const dateFormat = new Intl.DateTimeFormat(i18n.language, { ...format });
return (
<div className="flex flex-row items-center grow justify-end">
<span className={`text-theme-800 dark:text-theme-200 ${textSizes[textSize || "lg"]}`}>
{dateFormat.format(date)}
</span>
</div>
);
}

View File

@@ -0,0 +1,22 @@
const textSizes = {
"4xl": "text-4xl",
"3xl": "text-3xl",
"2xl": "text-2xl",
xl: "text-xl",
lg: "text-lg",
md: "text-md",
sm: "text-sm",
xs: "text-xs",
};
export default function Greeting({ options }) {
if (options.text) {
return (
<div className="flex flex-row items-center justify-start">
<span className={`text-theme-800 dark:text-theme-200 ${textSizes[options.text_size || "xl"]}`}>
{options.text}
</span>
</div>
);
}
}

View File

@@ -21,7 +21,7 @@ const ColorToggle = dynamic(() => import("components/color-toggle"), {
ssr: false, ssr: false,
}); });
const rightAlignedWidgets = ["weatherapi", "openweathermap", "weather", "search"]; const rightAlignedWidgets = ["weatherapi", "openweathermap", "weather", "search", "datetime"];
export async function getStaticProps() { export async function getStaticProps() {
const settings = await getSettings(); const settings = await getSettings();