Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX]: translation in owl templates #47

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

Demacri
Copy link

@Demacri Demacri commented Jun 21, 2024

Load it.po terms in owl frontend templates too

@OCA-git-bot
Copy link

Hi @etobella,
some modules you are maintaining are being modified, check this out!

@pedrobaeza
Copy link
Member

If I don't remember bad, what you should do is:

from odoo import models
class IrHttp(models.AbstractModel):
    _inherit = "ir.http"

    @classmethod
    def _get_translation_frontend_modules_name(cls):
        mods = super(IrHttp, cls)._get_translation_frontend_modules_name()
        return mods + ["sign_oca"]

@pedrobaeza pedrobaeza added this to the 16.0 milestone Jun 21, 2024
@pedrobaeza
Copy link
Member

Even if the po file exists, the request sign page was never translated because of the translatefn missing in owl mount function.
@Demacri
Copy link
Author

Demacri commented Jun 21, 2024

If I don't remember bad, what you should do is:

from odoo import models
class IrHttp(models.AbstractModel):
    _inherit = "ir.http"

    @classmethod
    def _get_translation_frontend_modules_name(cls):
        mods = super(IrHttp, cls)._get_translation_frontend_modules_name()
        return mods + ["sign_oca"]

From what i understand, this avoid to call "session.load_translations" (is it right?), but I'm not able to find a useful documentation about how to handle this scenario in owl components.

PS: fixed commit guidelines, sorry for the inconvenience.

@etobella
Copy link
Member

According to Pedro, the change he is asking says:

Return a list of module name where web-translations and
dynamic resources may be used in frontend views

Actually, some Odoo modules use it, like payment, portal or im_livechat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants