2022-06-08 23:24:19 +03:00
|
|
|
import { Translations } from "./translates/rus.ts";
|
|
|
|
|
|
|
|
export interface Context {
|
2023-02-03 03:09:57 +03:00
|
|
|
title?: string;
|
2022-06-08 23:24:19 +03:00
|
|
|
locPath: string;
|
|
|
|
lang: Lang;
|
|
|
|
tr: Translations;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getLangHref(lang: Lang, url: string): string {
|
|
|
|
return getLangUrlPrefix(lang) + url;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getLangUrlPrefix(lang: Lang): string {
|
2022-06-18 15:22:35 +03:00
|
|
|
return `/${lang}`;
|
2022-06-08 23:24:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export function iterLangs(): Lang[] {
|
|
|
|
return [Lang.Eng, Lang.Rus];
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum Lang {
|
|
|
|
Rus = "rus",
|
|
|
|
Eng = "eng",
|
|
|
|
}
|