Skip to content

Commit

Permalink
Add missing translations for bonus stuff (#1071)
Browse files Browse the repository at this point in the history
* Add missing translations for bonus stuff

* 💬 Bonuses => Previous bonuses
  • Loading branch information
petterhh authored Dec 18, 2024
1 parent 76ecf78 commit 2760dfc
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 9 deletions.
8 changes: 7 additions & 1 deletion messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"visit_cv": "Visit mini-CV",
"read_more": "Read more"
},
"compensation_calculator": {
"compensation": {
"calculator": {
"formLabel": "Salary calculator",
"educationInput": "Education",
Expand All @@ -47,6 +47,12 @@
"degreeOptions": {
"bachelor": "Bachelor",
"master": "Master"
},
"bonus": {
"location": "Location",
"bonuses": "Previous bonuses",
"year": "Year",
"amount": "Amount"
}
},
"employee_card": {
Expand Down
9 changes: 7 additions & 2 deletions messages/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"contact_sale": "Kontakt salg!",
"contact_us": "Kontakt oss"
},
"compensation_calculator": {
"compensation": {
"calculator": {
"formLabel": "Lønnskalkulator",
"educationInput": "Utdanning",
Expand All @@ -44,7 +44,12 @@
"bachelor": "Bachelor",
"master": "Master"
},
"test": "test"
"bonus": {
"location": "Lokasjon",
"bonuses": "Tidligere bonuser",
"year": "År",
"amount": "Beløp"
}
},
"custom_link": {
"visit_cv": "Gå til mini-CV",
Expand Down
8 changes: 7 additions & 1 deletion messages/se.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"contact_sale": "Kontakta sälj!",
"contact_us": "Kontakt oss"
},
"compensation_calculator": {
"compensation": {
"calculator": {
"formLabel": "Lönskalkulator",
"educationInput": "Utbildning",
Expand All @@ -43,6 +43,12 @@
"degreeOptions": {
"bachelor": "Bachelor",
"master": "Master"
},
"bonus": {
"location": "Kontor",
"bonuses": "Tidigare bonusar",
"year": "År",
"amount": "Belopp"
}
},
"custom_link": {
Expand Down
5 changes: 4 additions & 1 deletion src/components/compensations/CompensationSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use client";
import { useTranslations } from "next-intl";
import { useState } from "react";

import {
Expand All @@ -24,6 +25,8 @@ export default function CompensationSelector({
locations,
locale,
}: CompensationsProps) {
const t = useTranslations("compensation");

const hasBenefits = (id: string) =>
compensations.benefitsByLocation.some((b) => b.location._ref === id);

Expand Down Expand Up @@ -51,7 +54,7 @@ export default function CompensationSelector({
<div className={styles.compensationWrapper}>
<RadioButtonGroup
id="location-group"
label="Velg lokasjon"
label={t("bonus.location")}
options={locationOptions}
selectedId={selectedLocation}
onValueChange={(option) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { useTranslations } from "next-intl";

import Text from "src/components/text/Text";
import { formatAsCurrency } from "src/utils/i18n";
import { BonusPage } from "studio/lib/interfaces/compensations";
Expand All @@ -11,17 +13,18 @@ interface YearlyBonusesProps {
}

const YearlyBonuses = ({ bonuses, locale }: YearlyBonusesProps) => {
const t = useTranslations("compensation");
return (
<div className={styles.wrapper}>
<Text type={"h3"}>Historisk bonus</Text>
<Text type={"h3"}>{t("bonus.bonuses")}</Text>
<table className={styles.table}>
<thead>
<tr>
<th>
<Text>År</Text>
<Text type="h5">{t("bonus.year")}</Text>
</th>
<th className={styles.bonusHeader}>
<Text>Beløp</Text>
<Text type="h5">{t("bonus.amount")}</Text>
</th>
</tr>
</thead>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function Calculator({
initialYear,
background,
}: CalculatorProps) {
const t = useTranslations("compensation_calculator");
const t = useTranslations("compensation");
const locale = use(localeRes);
const salaries = use(salariesRes);
const [year, setYear] = useState(
Expand Down

0 comments on commit 2760dfc

Please sign in to comment.