Skip to content

Commit

Permalink
more locales
Browse files Browse the repository at this point in the history
  • Loading branch information
potts99 committed Nov 28, 2023
1 parent 3a04b77 commit c4ebdf1
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 22 deletions.
9 changes: 6 additions & 3 deletions apps/client/layouts/settings.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { useState } from "react";

import useTranslation from "next-translate/useTranslation";
import Link from "next/link";
import { useRouter } from "next/router";

export default function Settings({ children }) {
const router = useRouter();

const { t } = useTranslation("peppermint");

const linkStyles = {
active:
"w-full bg-teal-50 border-teal-500 text-teal-700 hover:bg-teal-50 hover:text-teal-700 group border-l-4 px-3 py-2 flex items-center text-sm font-medium",
Expand Down Expand Up @@ -46,7 +49,7 @@ export default function Settings({ children }) {
d="M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
<span className="truncate">Profile</span>
<span className="truncate">{t("profile")}</span>
</Link>

<Link
Expand All @@ -72,7 +75,7 @@ export default function Settings({ children }) {
d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
/>
</svg>
<span className="truncate">Notifications</span>
<span className="truncate">{t("notifications")}</span>
</Link>

<Link
Expand All @@ -98,7 +101,7 @@ export default function Settings({ children }) {
d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"
/>
</svg>
<span className="truncate">Password</span>
<span className="truncate">{t("reset_password")}</span>
</Link>
</nav>
</aside>
Expand Down
6 changes: 5 additions & 1 deletion apps/client/locales/da/peppermint.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@
"admin_settings": "Administratorindstillinger",
"profile": "Profil",
"logout": "Log ud",
"unassigned_tickets": "Ikke tildelte billetter"
"unassigned_tickets": "Ikke tildelte billetter",
"profile_desc": "Disse oplysninger vil blive vist offentligt, så vær forsigtig med, hvad du deler.",
"language": "Sprog",
"notifications": "Notifikationer",
"save_and_reload": "Gem og genindlæs"

}

6 changes: 5 additions & 1 deletion apps/client/locales/de/peppermint.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,9 @@
"admin_settings": "Admin-Einstellungen",
"profile": "Profil",
"logout": "Abmelden",
"unassigned_tickets": "Nicht zugewiesene Tickets"
"unassigned_tickets": "Nicht zugewiesene Tickets",
"profile_desc": "Diese Informationen werden öffentlich angezeigt, also achten Sie darauf, was Sie teilen.",
"language": "Sprache",
"notifications": "Benachrichtigungen",
"save_and_reload": "Speichern und neu laden"
}
6 changes: 5 additions & 1 deletion apps/client/locales/en/peppermint.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,9 @@
"admin_settings": "Admin Settings",
"profile": "Profile",
"logout": "Logout",
"unassigned_tickets": "Unassigned Tickets"
"unassigned_tickets": "Unassigned Tickets",
"profile_desc": "This information will be displayed publicly so be careful what you share.",
"language": "Language",
"notifications": "Notifications",
"save_and_reload": "Save and Reload"
}
6 changes: 5 additions & 1 deletion apps/client/locales/es/peppermint.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
"admin_settings": "Configuración de Administrador",
"profile": "Perfil",
"logout": "Cerrar sesión",
"unassigned_tickets": "Tickets no asignados"
"unassigned_tickets": "Tickets no asignados",
"profile_desc": "Esta información se mostrará públicamente, así que ten cuidado con lo que compartes.",
"language": "Idioma",
"notifications": "Notificaciones",
"save_and_reload": "Guardar y recargar"
}

7 changes: 6 additions & 1 deletion apps/client/locales/fr/peppermint.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
"admin_settings": "Paramètres administrateur",
"profile": "Profil",
"logout": "Déconnexion",
"unassigned_tickets": "Tickets non attribués"
"unassigned_tickets": "Tickets non attribués",
"profile_desc": "Ces informations seront affichées publiquement, alors faites attention à ce que vous partagez.",
"language": "Langue",
"notifications": "Notifications",
"save_and_reload": "Enregistrer et recharger"

}

6 changes: 5 additions & 1 deletion apps/client/locales/no/peppermint.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
"admin_settings": "Admininnstillinger",
"profile": "Profil",
"logout": "Logg ut",
"unassigned_tickets": "Ikke tildelte billetter"
"unassigned_tickets": "Ikke tildelte billetter",
"profile_desc": "Denne informasjonen vil bli vist offentlig, så vær forsiktig med hva du deler.",
"language": "Språk",
"notifications": "Varsler",
"save_and_reload": "Lagre og last inn på nytt"
}

9 changes: 8 additions & 1 deletion apps/client/locales/pt/peppermint.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@
"closed_issue": "Problema Fechado",
"recent_tickets": "Tickets Recentes",
"notebook_title": "Título do Caderno",
"admin_settings": "Configurações de Admin"
"admin_settings": "Configurações de Admin",
"profile": "Perfil",
"logout": "Sair",
"unassigned_tickets": "Tickets não atribuídos",
"profile_desc": "Estas informações serão exibidas publicamente, então tenha cuidado com o que compartilha.",
"language": "Idioma",
"notifications": "Notificações",
"save_and_reload": "Salvar e Recarregar"
}

6 changes: 5 additions & 1 deletion apps/client/locales/se/peppermint.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,9 @@
"admin_settings": "Admininställningar",
"profile": "Profil",
"logout": "Logga ut",
"unassigned_tickets": "Oattribuerade biljetter"
"unassigned_tickets": "Oattribuerade biljetter",
"profile_desc": "Denna information kommer att visas offentligt, så var försiktig med vad du delar.",
"language": "Språk",
"notifications": "Notifieringar",
"save_and_reload": "Spara och ladda om"
}
6 changes: 5 additions & 1 deletion apps/client/locales/tl/peppermint.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@
"admin_settings": "Mga Setting ng Admin",
"profile": "Profile",
"logout": "Mag-log out",
"unassigned_tickets": "Hindi itinalagang mga Tiket"
"unassigned_tickets": "Hindi itinalagang mga Tiket",
"profile_desc": "Ang impormasyong ito ay ipapakita sa publiko kaya mag-ingat sa iyong ibabahagi.",
"language": "Wika",
"notifications": "Mga Abiso",
"save_and_reload": "I-save at I-reload"

}

20 changes: 10 additions & 10 deletions apps/client/pages/settings/profile.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getCookie } from "cookies-next";
import useTranslation from "next-translate/useTranslation";
import { useRouter } from "next/router";
import { useState } from "react";
import { useUser } from "../../store/session";
Expand All @@ -7,6 +8,8 @@ export default function UserProfile() {
const { user } = useUser();
const token = getCookie("session");

const { t } = useTranslation("peppermint");

const router = useRouter();

const [name, setName] = useState(user.name);
Expand Down Expand Up @@ -41,19 +44,16 @@ export default function UserProfile() {
<div className="py-6 px-4 sm:p-6 lg:pb-8">
<div>
<h2 className="text-lg leading-6 font-medium text-gray-900">
Profile
{t("profile")}
</h2>
<p className="mt-1 text-sm text-gray-500">
This information will be displayed publicly so be careful what you
share.
</p>
<p className="mt-1 text-sm text-gray-500">{t("profile_desc")}</p>
</div>

<div className="mt-6 flex flex-col lg:flex-row">
<div className="flex-grow space-y-6">
<div>
<label className="block text-sm font-medium text-gray-700">
Name
{t("name")}
</label>
<div className="mt-1 rounded-md shadow-sm flex">
<input
Expand All @@ -70,7 +70,7 @@ export default function UserProfile() {

<div>
<label className="block text-sm font-medium text-gray-700">
Email
{t("email")}
</label>
<div className="mt-1 rounded-md shadow-sm flex">
<input
Expand All @@ -85,7 +85,7 @@ export default function UserProfile() {
</div>
<div>
<label className="block text-sm font-medium text-gray-700">
Language
{t("language")}
</label>
<div className="mt-1 rounded-md shadow-sm flex">
<select
Expand All @@ -100,7 +100,7 @@ export default function UserProfile() {
<option value="se">Swedish</option>
<option value="es">Spanish</option>
<option value="no">Norwegian</option>
<option value="se">French</option>
<option value="fr">French</option>
<option value="pt">Tagalong</option>
<option value="da">Danish</option>
<option value="pt">Portuguese</option>
Expand All @@ -120,7 +120,7 @@ export default function UserProfile() {
type="submit"
className="inline-flex items-center px-4 py-2 border font-semibold border-gray-300 shadow-sm text-xs rounded text-gray-700 bg-white hover:bg-gray-50 "
>
Save & Reload
{t("save_and_reload")}
</button>
</div>
</>
Expand Down

0 comments on commit c4ebdf1

Please sign in to comment.