Dmitriy Pleshevskiy
133476e2cf
All checks were successful
continuous-integration/drone/push Build is passing
24 lines
443 B
TypeScript
24 lines
443 B
TypeScript
import { Translations } from "./translates/rus.ts";
|
|
|
|
export interface Context {
|
|
locPath: string;
|
|
lang: Lang;
|
|
tr: Translations;
|
|
}
|
|
|
|
export function getLangHref(lang: Lang, url: string): string {
|
|
return getLangUrlPrefix(lang) + url;
|
|
}
|
|
|
|
export function getLangUrlPrefix(lang: Lang): string {
|
|
return `/${lang}`;
|
|
}
|
|
|
|
export function iterLangs(): Lang[] {
|
|
return [Lang.Eng, Lang.Rus];
|
|
}
|
|
|
|
export enum Lang {
|
|
Rus = "rus",
|
|
Eng = "eng",
|
|
}
|