Implemented language selection by query param

ref #5
This commit is contained in:
2021-02-05 21:27:14 +01:00
parent a596188c00
commit 6f81566cb8
3 changed files with 7 additions and 6 deletions

View File

@@ -34,7 +34,8 @@ export class PdfCreator {
});
}
public async generateSponsoringContract(runner: Runner): Promise<any> {
public async generateSponsoringContract(runner: Runner, locale: string = "en"): Promise<any> {
i18next.changeLanguage(locale);
const template_source = fs.readFileSync(`${this.templateDir}/sponsoring_contract.html`, 'utf8');
const template = Handlebars.compile(template_source);
const result = template({ runner: runner })