i18n: minor fixes
This commit is contained in:
@@ -11,11 +11,11 @@ export interface AddLocationButtonProps {
|
|||||||
|
|
||||||
export const AddLocationButton:React.FC<AddLocationButtonProps> = ({yearMonth}) => {
|
export const AddLocationButton:React.FC<AddLocationButtonProps> = ({yearMonth}) => {
|
||||||
|
|
||||||
const t = useTranslations("home-page");
|
const t = useTranslations("home-page.add-location-button");
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div className="card card-compact card-bordered bg-base-100 shadow-s my-1">
|
<div className="card card-compact card-bordered bg-base-100 shadow-s my-1">
|
||||||
<Link href={`/location/${ formatYearMonth(yearMonth) }/add`} className="card-body tooltip self-center" data-tip={t("add-location-button.tooltip")}>
|
<Link href={`/location/${ formatYearMonth(yearMonth) }/add`} className="card-body tooltip self-center" data-tip={t("tooltip")}>
|
||||||
<span className='flex self-center mr-[-3em]'>
|
<span className='flex self-center mr-[-3em]'>
|
||||||
<HomeIcon className="h-[1em] w-[1em] cursor-pointer text-4xl" />
|
<HomeIcon className="h-[1em] w-[1em] cursor-pointer text-4xl" />
|
||||||
<PlusCircleIcon className="h-[1em] w-[1em] cursor-pointer text-xl text-green-500 ml-[-.6em] mt-[-.4em]" />
|
<PlusCircleIcon className="h-[1em] w-[1em] cursor-pointer text-xl text-green-500 ml-[-.6em] mt-[-.4em]" />
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
import { PlusCircleIcon, CalendarDaysIcon } from "@heroicons/react/24/outline";
|
import { PlusCircleIcon, CalendarDaysIcon } from "@heroicons/react/24/outline";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { formatYearMonth } from "../lib/format";
|
import { formatYearMonth } from "../lib/format";
|
||||||
@@ -11,12 +13,12 @@ export interface AddMonthButtonProps {
|
|||||||
|
|
||||||
export const AddMonthButton:React.FC<AddMonthButtonProps> = ({ yearMonth }) => {
|
export const AddMonthButton:React.FC<AddMonthButtonProps> = ({ yearMonth }) => {
|
||||||
|
|
||||||
const t = useTranslations("home-page");
|
const t = useTranslations("home-page.add-month-button");
|
||||||
const locale = useLocale();
|
const locale = useLocale();
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div className="card card-compact shadow-s mb-4">
|
<div className="card card-compact shadow-s mb-4">
|
||||||
<Link href={`/${locale}/year-month/${formatYearMonth(yearMonth)}/add`} className='grid self-center tooltip' data-tip={t("add-month-button.tooltip")}>
|
<Link href={`/${locale}/year-month/${formatYearMonth(yearMonth)}/add`} className='grid self-center tooltip' data-tip={t("tooltip")}>
|
||||||
<span className='flex self-center mr-[-3em]'>
|
<span className='flex self-center mr-[-3em]'>
|
||||||
<CalendarDaysIcon className="h-[1em] w-[1em] cursor-pointer text-4xl" />
|
<CalendarDaysIcon className="h-[1em] w-[1em] cursor-pointer text-4xl" />
|
||||||
<PlusCircleIcon className="h-[1em] w-[1em] cursor-pointer text-xl text-green-500 ml-[-.4em] mt-[-.4em]" />
|
<PlusCircleIcon className="h-[1em] w-[1em] cursor-pointer text-xl text-green-500 ml-[-.4em] mt-[-.4em]" />
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export const BillDeleteForm:FC<BillDeleteFormProps> = ({ bill, location }) => {
|
|||||||
t.rich("text", {
|
t.rich("text", {
|
||||||
bill_name:bill.name,
|
bill_name:bill.name,
|
||||||
location_name:location.name,
|
location_name:location.name,
|
||||||
strong: (chunks:ReactNode) => <strong>${chunks}</strong>,
|
strong: (chunks:ReactNode) => <strong>{chunks}</strong>,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'client only';
|
'use client';
|
||||||
|
|
||||||
import { Cog8ToothIcon, PlusCircleIcon } from "@heroicons/react/24/outline";
|
import { Cog8ToothIcon, PlusCircleIcon } from "@heroicons/react/24/outline";
|
||||||
import { FC, ReactNode } from "react";
|
import { FC } from "react";
|
||||||
import { BillBadge } from "./BillBadge";
|
import { BillBadge } from "./BillBadge";
|
||||||
import { BillingLocation } from "../lib/db-types";
|
import { BillingLocation } from "../lib/db-types";
|
||||||
import { formatYearMonth } from "../lib/format";
|
import { formatYearMonth } from "../lib/format";
|
||||||
@@ -38,7 +38,7 @@ export const LocationCard:FC<LocationCardProps> = ({location: { _id, name, yearM
|
|||||||
{
|
{
|
||||||
monthlyExpense > 0 ?
|
monthlyExpense > 0 ?
|
||||||
<p>
|
<p>
|
||||||
{ t("payed-total") } <strong>${monthlyExpense}</strong>
|
{ t("payed-total") } <strong>${formatCurrency(monthlyExpense)}</strong>
|
||||||
</p>
|
</p>
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export const LocationDeleteForm:FC<LocationDeleteFormProps> = ({ location }) =>
|
|||||||
{
|
{
|
||||||
t.rich("text", {
|
t.rich("text", {
|
||||||
name:location.name,
|
name:location.name,
|
||||||
strong: (chunks:ReactNode) => `<strong>${chunks}</strong>`,
|
strong: (chunks:ReactNode) => <strong>{chunks}</strong>,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -12,5 +12,5 @@ export const SelectLanguage: React.FC = () => {
|
|||||||
const secondLocale = locales.find((l) => l !== currentLocale) as string;
|
const secondLocale = locales.find((l) => l !== currentLocale) as string;
|
||||||
const secondLocalePathname = defaultLocale === currentLocale ? `/${secondLocale}${currentPathname}` : currentPathname.replace(`/${currentLocale}`, `/${secondLocale}`);
|
const secondLocalePathname = defaultLocale === currentLocale ? `/${secondLocale}${currentPathname}` : currentPathname.replace(`/${currentLocale}`, `/${secondLocale}`);
|
||||||
|
|
||||||
return (<Link className="btn btn-ghost text-xl self-end" href={secondLocalePathname}>{localeNames[secondLocale]}</Link>);
|
return (<a className="btn btn-ghost text-xl self-end" href={secondLocalePathname}>{localeNames[secondLocale]}</a>);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user