refactor: consolidate English translations (#6640)
This commit is contained in:
1 parent
81aa704537
commit
9e14a07e64
449 files changed
+3515
-3922
No files matched your search
@@ -15,7 +15,7 @@ import {
|
||||
} from "@mantine/core";
|
||||
import { IconDroplets, IconMapPin, IconSunHigh, IconSunrise, IconSunset, IconWind } from "@tabler/icons-react";
|
||||
|
||||
import { useCurrentIntlLocale, useScopedI18n } from "@homarr/translation/client";
|
||||
import { useCurrentIntlLocale, useI18n } from "@homarr/translation/client";
|
||||
|
||||
import type { WidgetProps } from "../definition";
|
||||
import { AnimatedWeatherIcon } from "./animated-icon";
|
||||
@@ -97,8 +97,8 @@ export const AdvancedWeather = ({ height, options, weather, width }: AdvancedWea
|
||||
const headingId = useId();
|
||||
const chartId = useId();
|
||||
const locale = useCurrentIntlLocale();
|
||||
const t = useScopedI18n("widget.weather");
|
||||
const tCommon = useScopedI18n("common");
|
||||
const t = useI18n("widget.weather");
|
||||
const tCommon = useI18n("common");
|
||||
const layout = getAdvancedWeatherLayout(width, height);
|
||||
const today = weather.daily[0];
|
||||
const observedAt = Date.parse(weather.current.observedAt);
|
||||
@@ -402,7 +402,7 @@ const HourlyWeatherTable = ({
|
||||
timeZone,
|
||||
useImperialSpeed,
|
||||
}: HourlyDetailProps & { hourly: HourlyChartRow[] }) => {
|
||||
const t = useScopedI18n("widget.weather");
|
||||
const t = useI18n("widget.weather");
|
||||
return (
|
||||
<table>
|
||||
<caption>{t("advanced.hourlyForecast")}</caption>
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useMemo } from "react";
|
||||
import { Group, Popover, Stack, Text, UnstyledButton } from "@mantine/core";
|
||||
import { IconArrowDownRight, IconArrowUpRight, IconDroplets, IconMapPin, IconWind } from "@tabler/icons-react";
|
||||
|
||||
import { useCurrentIntlLocale, useScopedI18n } from "@homarr/translation/client";
|
||||
import { useCurrentIntlLocale, useI18n } from "@homarr/translation/client";
|
||||
|
||||
import type { WidgetProps } from "../definition";
|
||||
import { AnimatedWeatherIcon } from "./animated-icon";
|
||||
@@ -23,8 +23,8 @@ interface CompactWeatherProps {
|
||||
|
||||
export const CompactWeather = ({ height, isEditMode, options, weather, width }: CompactWeatherProps) => {
|
||||
const locale = useCurrentIntlLocale();
|
||||
const t = useScopedI18n("widget.weather");
|
||||
const tCommon = useScopedI18n("common");
|
||||
const t = useI18n("widget.weather");
|
||||
const tCommon = useI18n("common");
|
||||
const layout = useMemo(
|
||||
() => getCompactWeatherLayout(width, height, options.hasForecast, options.forecastDayCount),
|
||||
[height, options.forecastDayCount, options.hasForecast, width],
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { Box } from "@mantine/core";
|
||||
|
||||
import { clientApi } from "@homarr/api/client";
|
||||
import { useScopedI18n } from "@homarr/translation/client";
|
||||
import { useI18n } from "@homarr/translation/client";
|
||||
|
||||
import { WidgetEmptyState } from "../common/empty-state";
|
||||
import { getUsableWidgetQueryData, isInitialWidgetQueryPending } from "../common/query-state";
|
||||
@@ -20,7 +20,7 @@ export default function WeatherWidget({
|
||||
height,
|
||||
displayMode,
|
||||
}: WidgetComponentProps<"weather">) {
|
||||
const t = useScopedI18n("widget.weather");
|
||||
const t = useI18n("widget.weather");
|
||||
const input = {
|
||||
latitude: options.location.latitude,
|
||||
longitude: options.location.longitude,
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
IconWind,
|
||||
} from "@tabler/icons-react";
|
||||
|
||||
import { useCurrentIntlLocale, useScopedI18n } from "@homarr/translation/client";
|
||||
import { useCurrentIntlLocale, useI18n } from "@homarr/translation/client";
|
||||
|
||||
import type { WidgetProps } from "../definition";
|
||||
import { AnimatedWeatherIcon } from "./animated-icon";
|
||||
@@ -79,8 +79,8 @@ export const DailyWeatherDetails = ({
|
||||
useImperialSpeed,
|
||||
}: DailyWeatherDetailsProps) => {
|
||||
const locale = useCurrentIntlLocale();
|
||||
const t = useScopedI18n("widget.weather");
|
||||
const tCommon = useScopedI18n("common");
|
||||
const t = useI18n("widget.weather");
|
||||
const tCommon = useI18n("common");
|
||||
const speedUnit = useImperialSpeed ? tCommon("unit.speed.milesPerHour") : tCommon("unit.speed.kilometersPerHour");
|
||||
|
||||
return (
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
} from "@tabler/icons-react";
|
||||
import { metricToImperial } from "@homarr/common";
|
||||
import type { TranslationObject } from "@homarr/translation";
|
||||
import { useCurrentIntlLocale, useScopedI18n } from "@homarr/translation/client";
|
||||
import { useCurrentIntlLocale, useI18n } from "@homarr/translation/client";
|
||||
import type { TablerIcon } from "@homarr/ui";
|
||||
|
||||
import type { WidgetProps } from "../definition";
|
||||
@@ -85,8 +85,8 @@ export const WeatherDescription = ({
|
||||
maxWindGusts,
|
||||
humidity,
|
||||
}: WeatherDescriptionProps) => {
|
||||
const t = useScopedI18n("widget.weather");
|
||||
const tCommon = useScopedI18n("common");
|
||||
const t = useI18n("widget.weather");
|
||||
const tCommon = useI18n("common");
|
||||
const locale = useCurrentIntlLocale();
|
||||
|
||||
const name = getWeatherKind(weatherCode);
|
||||
|
||||
Reference in new issue
Block a user