Skip to content

Commit

Permalink
[FIX] sign_oca: translate in owl templates
Browse files Browse the repository at this point in the history
Even if the po file exists, the request sign page was never translated because of the translatefn missing in owl mount function.
  • Loading branch information
Demacri committed Jun 21, 2024
1 parent cceb363 commit 0b8122a
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const {App, mount, useRef} = owl;
import SignOcaPdf from "../sign_oca_pdf/sign_oca_pdf.esm.js";

import env from "web.public_env";
import core from "web.core";
import {renderToString} from "@web/core/utils/render";
import session from "web.session";
import {templates} from "@web/core/assets";
Expand Down Expand Up @@ -72,12 +73,14 @@ export function initDocumentToSign(properties) {
return Promise.all([
session.load_translations(["web", "portal", "sign_oca"]),
]).then(async function () {
const translateFn = (str) => core._t(str);
var app = new App(null, {templates, test: true});
renderToString.app = app;
mount(SignOcaPdfPortal, document.body, {
env,
props: properties,
templates: templates,
translateFn,
});
});
});
Expand Down

0 comments on commit 0b8122a

Please sign in to comment.