Skip to content

Commit

Permalink
Merge pull request #1931 from SUNET/eunju-correct-lanuguage-links
Browse files Browse the repository at this point in the history
Add variable for locale-specific link
  • Loading branch information
cartja authored Dec 10, 2024
2 parents 32f8a84 + ac2ec2c commit 9f9a9ad
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/components/Help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,21 @@ export function Help(): JSX.Element {
const dispatch = useAppDispatch();
const is_configured = useAppSelector((state) => state.config.is_configured);
const signup_link = useAppSelector((state) => state.config.signup_link);
const locale = useAppSelector((state) => state.intl.locale);

const [approvedSecurityKeys, setApprovedSecurityKeys] = useState<ApprovedSecurityKeysTypes>();

const FrejaAppURL =
locale === "en" ? "https://frejaeid.com/en/get-freja-eid/" : "https://frejaeid.com/skaffa-freja-eid/";
const BankIdURL =
locale === "en" ? "https://www.bankid.com/en/privat/skaffa-bankid" : "https://www.bankid.com/privat/skaffa-bankid";
const FrejaeIdURL =
locale === "en"
? "https://org.frejaeid.com/en/an-e-id-for-foreign-citizens/"
: "https://org.frejaeid.com/en-e-legitimation-for-utlandska-medborgare/";
const UniversityAdmissionURL =
locale === "en" ? "https://www.universityadmissions.se/intl/start" : "https://www.antagning.se";

useEffect(() => {
document.title = intl.formatMessage({
id: "document title Help",
Expand Down Expand Up @@ -132,7 +144,7 @@ export function Help(): JSX.Element {
account.`}
values={{
link: (
<a className="text-link" href="https://www.universityadmissions.se" target="_blank">
<a className="text-link" href={UniversityAdmissionURL} target="_blank">
universityadmissions.se
</a>
),
Expand Down Expand Up @@ -545,7 +557,7 @@ export function Help(): JSX.Element {
Freja+ account according to the instructions,`}
values={{
Freja: (
<a className="text-link" href="https://frejaeid.com/en/get-freja-eid/" target="_blank">
<a className="text-link" href={FrejaAppURL} target="_blank">
Freja app
</a>
),
Expand Down Expand Up @@ -633,11 +645,7 @@ export function Help(): JSX.Element {
defaultMessage={`the BankID is obtained from your personal bank and installed on your device as an app or file. The process varies, so visit your bank's website and follow the instructions. You can read more about obtaining a BankID on {bankid}`}
values={{
bankid: (
<a
className="text-link"
href="https://www.bankid.com/en/privat/skaffa-bankid"
target="_blank"
>
<a className="text-link" href={BankIdURL} target="_blank">
the BankID website
</a>
),
Expand Down Expand Up @@ -730,11 +738,7 @@ export function Help(): JSX.Element {
defaultMessage={`Current information on included nationalities can be found at: {FrejaList}`}
values={{
FrejaList: (
<a
className="text-link"
href="https://org.frejaeid.com/en/an-e-id-for-foreign-citizens/"
target="_blank"
>
<a className="text-link" href={FrejaeIdURL} target="_blank">
Freja eID
</a>
),
Expand All @@ -756,7 +760,7 @@ export function Help(): JSX.Element {
profile supported by your passport, by installing the {FrejaApp} on your mobile device (iOS or Android) and following the instructions,`}
values={{
FrejaApp: (
<a className="text-link" href="https://frejaeid.com/en/get-freja-eid/" target="_blank">
<a className="text-link" href={FrejaAppURL} target="_blank">
Freja app
</a>
),
Expand Down

0 comments on commit 9f9a9ad

Please sign in to comment.