Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Dec 10, 2024
1 parent c3ff48d commit d77367f
Show file tree
Hide file tree
Showing 18 changed files with 286 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@
"version": "1.0.0",
"locale": {
"source": "en",
"targets": [
"es",
"fr",
"pt"
]
"targets": ["sv"]
},
"files": {
"ts": {
"include": [
"locales/[locale].ts"
]
"include": ["src/locales/[locale].ts"]
}
},
"openai": {
"model": "gpt-4"
}
}
}
11 changes: 0 additions & 11 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@
"@date-fns/tz": "^1.1.2",
"@fast-csv/format": "5.0.0",
"@hookform/resolvers": "^3.9.0",
"@midday/app-store": "workspace:*",
"@midday/events": "workspace:*",
"@midday/inbox": "workspace:*",
"@midday/invoice": "workspace:*",
"@midday/kv": "workspace:*",
"@midday/location": "workspace:*",
"@midday/notification": "workspace:*",
"@midday/supabase": "workspace:*",
"@midday/ui": "workspace:*",
"@midday/utils": "workspace:*",
"@novu/headless": "^2.0.3",
"@number-flow/react": "^0.4.1",
"@react-google-maps/api": "^2.20.3",
Expand Down Expand Up @@ -78,7 +68,6 @@
"zustand": "^4.5.5"
},
"devDependencies": {
"@midday/tsconfig": "workspace:*",
"@next/bundle-analyzer": "14.2.1",
"@t3-oss/env-nextjs": "^0.11.1",
"@todesktop/tailwind-variants": "^1.0.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ChangeLanguage } from "@/components/change-language";
import { ChangeTimezone } from "@/components/change-timezone";
import { DateFormatSettings } from "@/components/date-format-settings";
import { LocaleSettings } from "@/components/locale-settings";
Expand All @@ -19,6 +20,7 @@ export default async function Page() {
return (
<div className="space-y-12">
<LocaleSettings locale={userData?.locale} />
<ChangeLanguage />
<ChangeTimezone timezone={userData?.timezone} timezones={timezones} />
<TimeFormatSettings timeFormat={userData?.time_format} />
<DateFormatSettings dateFormat={userData?.date_format} />
Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/src/components/change-language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import {
import { useAction } from "next-safe-action/hooks";

export function ChangeLanguage() {
const action = useAction(updateUserAction);
// const action = useAction(updateUserAction);
const changeLocale = useChangeLocale();
const locale = useCurrentLocale();
const t = useI18n();

const handleOnChange = async (locale: string) => {
await action.execute({ locale });
const handleOnChange = (locale: string) => {
// await action.execute({ locale });
changeLocale(locale);
};

Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/locales/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { createI18nClient } from "next-international/client";

// NOTE: Also update middleware.ts to support locale
export const languages = ["en"];
export const languages = ["en", "sv"];

export const {
useScopedI18n,
Expand All @@ -13,5 +13,5 @@ export const {
useI18n,
} = createI18nClient({
en: () => import("./en"),
// sv: () => import("./sv"),
sv: () => import("./sv"),
});
2 changes: 1 addition & 1 deletion apps/dashboard/src/locales/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { createI18nServer } from "next-international/server";

export const { getI18n, getScopedI18n, getStaticParams } = createI18nServer({
en: () => import("./en"),
// sv: () => import("./sv"),
sv: () => import("./sv"),
});
187 changes: 164 additions & 23 deletions apps/dashboard/src/locales/sv.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export default {
transaction_methods: {
card_purchase: "Kortbetalning",
card_purchase: "Kortköp",
payment: "Betalning",
card_atm: "Kort bankomat",
card_atm: "Kort ATM",
transfer: "Överföring",
other: "Annan",
other: "Annat",
ach: "Ach",
deposit: "Deposition",
deposit: "Insättning",
wire: "Wire",
fee: "Avgift",
interest: "Ränta",
Expand All @@ -16,42 +16,57 @@ export default {
description: "Ändra språket som används i användargränssnittet.",
placeholder: "Välj språk",
},
locale: {
title: "Lokal",
searchPlaceholder: "Sök lokal",
description:
"Ställer in regionen och språkinställningarna för valuta, datum och andra lokal-specifika format.",
placeholder: "Välj lokal",
},
languages: {
en: "Engelska",
sv: "Svenska",
},
timezone: {
title: "Tidzon",
description: "Aktuell tidzoninställning.",
placeholder: "Välj tidzon",
},
inbox_filter: {
all: "Alla",
todo: "Att göra",
done: "Slutförda",
title: "Tidszon",
searchPlaceholder: "Sök tidszon",
description:
"Definierar den standard tidszon som används för att visa tider i appen.",
placeholder: "Välj tidszon",
},
spending_period: {
last_30d: "Senaste 30 dagarna",
this_month: "Den här månaden",
this_month: "Denna månad",
last_month: "Förra månaden",
this_year: "Det här året",
this_year: "Detta år",
last_year: "Förra året",
},
transactions_period: {
all: "All",
all: "Alla",
income: "Inkomst",
outcome: "Utgifter",
expense: "Utgifter",
},
transaction_frequency: {
weekly: "Veckovis återkommande",
monthly: "Månadsvis återkommande",
annually: "Årligen återkommande",
},
inbox_filter: {
all: "Alla",
todo: "Att göra",
done: "Klar",
},
chart_type: {
profit: "Vinst",
revenue: "Omsättning",
burn_rate: "Brännhastighet",
revenue: "Intäkter",
expense: "Utgifter",
burn_rate: "Burn rate",
},
folders: {
all: "Alla",
exports: "Exporteringar",
exports: "Export",
inbox: "Inkorg",
imports: "Importer",
imports: "Import",
transactions: "Transaktioner",
invoices: "Fakturor",
},
Expand All @@ -64,10 +79,136 @@ export default {
member: "Medlem",
},
tracker_status: {
in_progress: "Pågående",
completed: "Färdig",
in_progress: "Pågår",
completed: "Slutförd",
},
notifications: {
inbox: "Få notifikationer om nya objekt i din inkorg.",
match: "Få notifikationer om matchningar.",
transaction: "Få notifikationer om en ny transaktion.",
transactions: "Få notifikationer om nya transaktioner.",
"invoice.paid": "Få notifikationer om betalda fakturor.",
"invoice.overdue": "Få notifikationer om försenade fakturor.",
"inbox.match": "Få notifikationer om nya matchningar i din inkorg.",
},
widgets: {
insights: "Assistent",
inbox: "Inkorg",
spending: "Utgifter",
transactions: "Transaktioner",
tracker: "Tracker",
},
bottom_bar: {
"transactions#one": "1 Transaktion",
"transactions#other": "{count} Transaktioner",
multi_currency: "Multi valuta",
description: "Inkluderar transaktioner från alla sidor av resultat",
},
account_type: {
depository: "Depå",
credit: "Kredit",
other_asset: "Annan tillgång",
loan: "Lån",
other_liability: "Annan skuld",
},
tags: {
bylaws: "Stadgar",
shareholder_agreements: "Aktieägaravtal",
board_meeting: "Styrelsemöte",
corporate_policies: "Företagspolicyer",
annual_reports: "Årsredovisningar",
budget_reports: "Budgetrapporter",
audit_reports: "Revisionsrapporter",
tax_returns: "Skattedeklarationer",
invoices_and_receipts: "Fakturor & Kvittot",
employee_handbook: "Anställdas handbok",
payroll_records: "Löneuppgifter",
performance_reviews: "Prestationsbedömningar",
employee_training_materials: "Utbildningsmaterial för anställda",
benefits_documentation: "Förmånsdokumentation",
termination_letters: "Uppsägningsbrev",
patents: "Patent",
trademarks: "Varumärken",
copyrights: "Upphovsrätt",
client_contracts: "Kundkontrakt",
financial_records: "Finansiella uppgifter",
compliance_reports: "Efterlevnadsrapporter",
regulatory_filings: "Regulatoriska inlämningar",
advertising_copy: "Reklamkopia",
press_releases: "Pressmeddelanden",
branding_guidelines: "Varumärkesriktlinjer",
market_research_reports: "Marknadsundersökningsrapporter",
campaign_performance_reports: "Kampanjprestationsrapporter",
customer_surveys: "Kundenkäter",
quality_control_reports: "Kvalitetskontrollrapporter",
inventory_reports: "Lager rapporter",
maintenance_logs: "Underhållsloggar",
production_schedules: "Produktionsscheman",
vendor_agreements: "Leverantörsavtal",
supplier_agreements: "Leverantörsavtal",
sales_contracts: "Försäljningskontrakt",
sales_reports: "Försäljningsrapporter",
client_proposals: "Kundförslag",
customer_order_forms: "Kundorderformulär",
sales_presentations: "Försäljningspresentationer",
data_security_plans: "Datasäkerhetsplaner",
system_architecture_diagrams: "Systemarkitekturdiagram",
incident_response_plans: "Incidentresponsplaner",
user_manuals: "Användarmanualer",
software_licenses: "Programvarulicenser",
data_backup_logs: "Data backup-loggar",
project_plans: "Projektplaner",
task_lists: "Uppgiftslistor",
risk_management_plans: "Riskhanteringsplaner",
project_status_reports: "Projektstatusrapporter",
meeting_agendas: "Mötesagendor",
lab_notebooks: "Lab anteckningsböcker",
experiment_results: "Experimentresultat",
product_design_documents: "Produktdesign dokument",
prototypes_and_models: "Prototyper & Modeller",
testing_reports: "Testrapporter",
newsletters: "Nyhetsbrev",
email_correspondence: "E-postkorrespondens",
support_tickets: "Supportärenden",
faqs_and_knowledge: "FAQs & Kunskap",
user_guides: "Användarguider",
warranty_information: "Garantiinformation",
swot_analysis: "SWOT-analys",
strategic_objectives: "Strategiska mål",
roadmaps: "Roadmaps",
competitive_analysis: "Konkurrensanalys",
safety_data_sheets: "Säkerhetsdatablad",
compliance_certificates: "Efterlevnadscertifikat",
incident_reports: "Incidentrapporter",
emergency_response_plans: "Nödresponsplaner",
certification_records: "Certifieringsregister",
training_schedules: "Utbildningsscheman",
e_learning_materials: "E-lärningsmaterial",
competency_assessment_forms: "Kompetensbedömningsformulär",
},
invoice_status: {
draft: "Utkast",
overdue: "Försenad",
paid: "Betald",
unpaid: "Obetald",
canceled: "Avbruten",
},
payment_status: {
none: "Okänd",
good: "Bra",
average: "Medel",
bad: "Dålig",
},
payment_status_description: {
none: "Ingen betalningshistorik ännu.",
good: "Betalar konsekvent i tid.",
average: "För det mesta i tid.",
bad: "Rum för förbättring.",
},
"invoice_count#zero": "Inga fakturor",
"invoice_count#one": "1 faktura",
"invoice_count#other": "{count} fakturor",
account_balance: {
total_balance: "Total saldo",
total_balance: "Total balans",
},
} as const;
2 changes: 1 addition & 1 deletion apps/dashboard/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createI18nMiddleware } from "next-international/middleware";
import { type NextRequest, NextResponse } from "next/server";

const I18nMiddleware = createI18nMiddleware({
locales: ["en"],
locales: ["en", "sv"],
defaultLocale: "en",
urlMappingStrategy: "rewrite",
});
Expand Down
Binary file modified bun.lockb
Binary file not shown.
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"name": "midday",
"private": true,
"workspaces": [
"packages/*",
"apps/*",
"packages/email/*"
],
"workspaces": ["packages/*", "apps/*", "packages/email/*"],
"scripts": {
"build": "turbo build",
"clean": "git clean -xdf node_modules",
Expand Down
11 changes: 5 additions & 6 deletions packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
"version": "1.0.0",
"private": true,
"type": "module",
"bin": {
"languine": "./dist/index.js"
},
"bin": "dist/index.js",
"main": "dist/index.js",
"scripts": {
"clean": "rm -rf .turbo node_modules",
"lint": "biome check .",
"format": "biome format --write .",
"typecheck": "tsc --noEmit",
"test": "bun test src",
"build": "tsup src/cli.ts --format esm --dts --clean",
"dev": "tsup src/cli.ts --format esm --watch --clean",
"start": "node dist/cli.js"
"build": "tsup src/index.ts --format esm --dts --clean",
"dev": "tsup src/index.ts --format esm --watch --clean",
"start": "node dist/index.js"
},
"dependencies": {
"@ai-sdk/openai": "^1.0.7",
Expand Down
Loading

0 comments on commit d77367f

Please sign in to comment.