콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4831 화면

Hello,

Is there a way to force a translation? 

E.g.:
I have a user with english as default language, but I want to force a french translation.

Is there a way to do this? _('fr', 'somethig to translate')

I could see that it's not possible to set the self.env.lang property from a method, so any help would be welcome..

Thank you in advance
Regards

아바타
취소

I wanted to make comment but site is not allowing me to make comment. Because this is not an answer please convert it as comment. May I know why do you want to translate to French for an English user?

베스트 답변

Language propagate with context, see - self.env.context or self._context, for example:

self.env.context = {'lang': 'en_US', 'default_state': 'open', 'uid': 1, 'active_model': 'res.partner'}

아바타
취소
관련 게시물 답글 화면 활동
4
7월 24
6003
2
7월 24
1589
4
6월 24
24127
3
4월 24
1566
1
2월 24
1950