Contributors mailing list archives
contributors@odoo-community.org
Browse archives
RE: New Odoo17 translated fields
byBeautiful ! Thank you very much David -)
With kind regards,
Van Hirtum Johan
Van: David Vidal [mailto:notifications@odoo-community.org]
Verzonden: donderdag 1 februari 2024 13:08
Aan: Contributors
Onderwerp: Re: New Odoo17 translated fields
The ORM does it for you. Simply use the `lang` context:
```python
record.with_context(lang='es_ES`).field_name = translated_string
```
You can get your active languages with `self.env['res.lang'].get_installed()` and loop over them if you want to do it at once.
El jue, 1 feb 2024 a las 12:52, Johan Van Hirtum (<notifications@odoo-community.org>) escribió:
Dears,
Knows someone good developer documentation around the new translated fields in Odoo17 ? That there are stored in de database as jsonB field is clear. But I see nowhere how to set de translated terms for a field in a python method ( an on change or depends structure for ex. ). There must normally be a some variables where the translation are stored till the create method creates the model ? But I see nothing there.
I want to use a python translation package ( deepL, deep-translator ) to give a first translation automatically when the translatable field is typed in the ID. Users can adapt, if they want to, but mostly, these translation are simply good -)
Thanks for helping me out.
With kind regards,
Van Hirtum Johan
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
Reference
-
OCA/connector-telephony Mantainers/PSC
byNimarosaDev, Nicolas Rodriguez Sande-
Re: OCA/connector-telephony Mantainers/PSC
byClosingAp Open Source Integrators Europe, LDA, Daniel Reis -
Re: OCA/connector-telephony Mantainers/PSC
byNimarosaDev, Nicolas Rodriguez Sande -
Re: OCA/connector-telephony Mantainers/PSC
byDIXMIT Consulting SLU, Enric Tobella Alomar -
Re: OCA/connector-telephony Mantainers/PSC
byTecnativa. S. L., Pedro M. Baeza