Dmitriy Pleshevskiy
491f0cded5
All checks were successful
continuous-integration/drone/push Build is passing
Closes #7
25 lines
461 B
TypeScript
25 lines
461 B
TypeScript
import { Translations } from "./translates/rus.ts";
|
|
|
|
export interface Context {
|
|
title?: string;
|
|
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",
|
|
}
|