mirror of https://github.com/OCA/web.git
commit
7da54ba98d
|
@ -0,0 +1,4 @@
|
||||||
|
# Copyright 2012 Guewen Baconnier (Camptocamp SA)
|
||||||
|
# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
from . import models
|
|
@ -0,0 +1,27 @@
|
||||||
|
# Copyright 2012 Guewen Baconnier (Camptocamp SA)
|
||||||
|
# Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "Web Translate Dialog",
|
||||||
|
"summary": "Easy-to-use pop-up to translate fields in several languages",
|
||||||
|
"version": "12.0.1.0.0",
|
||||||
|
"category": "Web",
|
||||||
|
"website": "https://github.com/OCA/web",
|
||||||
|
"author": "Camptocamp, "
|
||||||
|
"Tecnativa, "
|
||||||
|
"Odoo Community Association (OCA)",
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"application": False,
|
||||||
|
'installable': True,
|
||||||
|
"depends": [
|
||||||
|
"web",
|
||||||
|
],
|
||||||
|
"data": [
|
||||||
|
"views/res_lang.xml",
|
||||||
|
"views/web_translate.xml",
|
||||||
|
],
|
||||||
|
"qweb": [
|
||||||
|
"static/src/xml/base.xml",
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||||
|
"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n"
|
||||||
|
"Language: ar\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
|
||||||
|
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "إلغاء"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr "الحقل"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "حفظ"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr "ترجم"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr "الترجمات"
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||||
|
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
|
||||||
|
"Language: de\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Abbrechen"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr "Feld"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Speichern"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr "Übersetze"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr "Übersetzungen"
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||||
|
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
|
||||||
|
"Language: es\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Cancelar"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr "Campo"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Guardar"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr "Traducir"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr "Traducciones"
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||||
|
"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n"
|
||||||
|
"Language: fi\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Peru"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr "Kenttä"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Tallenna"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr "Käännä"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr "Käännökset"
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||||
|
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
|
||||||
|
"Language: fr\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Annuler"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr "Champ"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Enregistrer"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr "Traduire"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr "Traductions"
|
|
@ -0,0 +1,56 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
# Bole <bole@dajmi5.com>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"Last-Translator: Bole <bole@dajmi5.com>, 2017\n"
|
||||||
|
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
|
||||||
|
"Language: hr\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
||||||
|
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Otkaži"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr "Polje"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Snimi"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr "Prevedi"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr "Prevodi"
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||||
|
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n"
|
||||||
|
"Language: it\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Annulla"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr "Campo"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Salva"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr "Traduci"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr "Traduzioni"
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||||
|
"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n"
|
||||||
|
"Language: nl\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr "Veld"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr "Vertalen"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr "Vertalingen"
|
|
@ -0,0 +1,55 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# Peter Hageman <hageman.p@gmail.com>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-07-01 03:35+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-07-01 03:35+0000\n"
|
||||||
|
"Last-Translator: Peter Hageman <hageman.p@gmail.com>, 2017\n"
|
||||||
|
"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/"
|
||||||
|
"teams/23907/nl_NL/)\n"
|
||||||
|
"Language: nl_NL\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Annuleer"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr ""
|
|
@ -0,0 +1,55 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||||
|
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/"
|
||||||
|
"teams/23907/pt_BR/)\n"
|
||||||
|
"Language: pt_BR\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Cancelar"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr "Campo"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Salvar"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr "Traduzir"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr "Traduções"
|
|
@ -0,0 +1,55 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||||
|
"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n"
|
||||||
|
"Language: sl\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
|
||||||
|
"%100==4 ? 2 : 3);\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "Preklic"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr "Polje"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Shrani"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr "Prevod"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr "Prevodi"
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-04-28 18:03+0000\n"
|
||||||
|
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||||
|
"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n"
|
||||||
|
"Language: tr\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr "İptal"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr "Alan"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr "Kaydet"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr "Çeviri"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr "daha çevrilmedi"
|
|
@ -0,0 +1,50 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * web_translate_dialog
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"Last-Translator: <>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: \n"
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:47
|
||||||
|
#, python-format
|
||||||
|
msgid "Cancel"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:14
|
||||||
|
#, python-format
|
||||||
|
msgid "Field"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/xml/base.xml:44
|
||||||
|
#, python-format
|
||||||
|
msgid "Save"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:192
|
||||||
|
#, python-format
|
||||||
|
msgid "Translate"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: web_translate_dialog
|
||||||
|
#. openerp-web
|
||||||
|
#: code:addons/web_translate_dialog/static/src/js/web_translate_dialog.js:23
|
||||||
|
#, python-format
|
||||||
|
msgid "Translations"
|
||||||
|
msgstr ""
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
from . import base
|
||||||
|
from . import res_lang
|
|
@ -0,0 +1,36 @@
|
||||||
|
# Copyright 2019 Camptocamp SA
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
|
||||||
|
from odoo import models, api
|
||||||
|
|
||||||
|
|
||||||
|
class BaseModel(models.BaseModel):
|
||||||
|
|
||||||
|
_inherit = 'base'
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def get_field_translations(self, field_names):
|
||||||
|
"""Get only the existing translations for specified field
|
||||||
|
|
||||||
|
:param field_name: Name of the field
|
||||||
|
:return: dict of
|
||||||
|
{self.id: {'lang_code': {'field_name':ir.translation,value}}
|
||||||
|
"""
|
||||||
|
read_res = self.with_context(lang='en_US').read(fields=field_names)
|
||||||
|
res = {}
|
||||||
|
for rec in read_res:
|
||||||
|
rec_id = rec.get('id')
|
||||||
|
del rec['id']
|
||||||
|
res[rec_id] = {'en_US': rec}
|
||||||
|
for rec_id, values in res.items():
|
||||||
|
for name in field_names:
|
||||||
|
|
||||||
|
tr_read_res = self.env['ir.translation'].search_read([
|
||||||
|
('name', 'like', '%s,%s' % (self._name, field_names)),
|
||||||
|
('res_id', '=', rec_id),
|
||||||
|
('lang', '!=', 'en_US')
|
||||||
|
])
|
||||||
|
for tr_res in tr_read_res:
|
||||||
|
if not tr_res.get('lang') in values:
|
||||||
|
values[tr_res.get('lang')] = {}
|
||||||
|
values[tr_res.get('lang')][name] = tr_res.get('value')
|
||||||
|
return res
|
|
@ -0,0 +1,14 @@
|
||||||
|
# Copyright 2019 Camptocamp SA
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
|
||||||
|
from odoo import models, fields
|
||||||
|
|
||||||
|
|
||||||
|
class ResLang(models.Model):
|
||||||
|
|
||||||
|
_inherit = 'res.lang'
|
||||||
|
|
||||||
|
tr_sequence = fields.Integer(
|
||||||
|
string='Translation sequence',
|
||||||
|
help='Defines the order of language to appear in translation dialog',
|
||||||
|
default=10,
|
||||||
|
)
|
|
@ -0,0 +1,5 @@
|
||||||
|
* Guewen Baconnier (Camptocamp)
|
||||||
|
* Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
||||||
|
* Serpent Consulting Services Pvt. Ltd. <jay.vora@serpentcs.com>
|
||||||
|
* Timon Tschanz <timon.tschanz@camptocamp.ch>
|
||||||
|
* Akim Juillerat <akim.juillerat@camptocamp.com>
|
|
@ -0,0 +1,10 @@
|
||||||
|
This module replaces the standard translation view by an easy-to-use pop-up
|
||||||
|
view where you can translate all the fields of the object in all the installed
|
||||||
|
languages (for long-time users, it may remind them the translation pop-up of
|
||||||
|
OpenERP 6.1).
|
||||||
|
|
||||||
|
This module also features:
|
||||||
|
|
||||||
|
* A *Translate* button item in the *More* menu
|
||||||
|
* Support for HTML fields
|
||||||
|
* Autosize the textareas to the size of the content
|
|
@ -0,0 +1,8 @@
|
||||||
|
Go to an object that has translatable fields (*Products* for example) and
|
||||||
|
select *Actions > Translate* (or click on *Edit* and then click on the flag at
|
||||||
|
the top-right of one of the translatable fields): the translation view will
|
||||||
|
pop-up on your screen. This translation view contains all the translatable
|
||||||
|
fields of the object.
|
||||||
|
|
||||||
|
If you click in the standard translate icon then the translation view will
|
||||||
|
pop-up with this field only.
|
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
|
@ -0,0 +1,18 @@
|
||||||
|
/* Copyright 2012 Guewen Baconnier (Camptocamp SA)
|
||||||
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
||||||
|
|
||||||
|
.oe_translation_field {
|
||||||
|
width: 95%;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
.oe_translation_field.touched {
|
||||||
|
border: 1px solid green !important;
|
||||||
|
}
|
||||||
|
.modal-xl {
|
||||||
|
max-width: 90%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oe_form_frame_cell.field_name {
|
||||||
|
padding-top: 5px;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
|
@ -0,0 +1,272 @@
|
||||||
|
/* Copyright 2012 Guewen Baconnier (Camptocamp SA)
|
||||||
|
Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
||||||
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
||||||
|
|
||||||
|
odoo.define('web_translate_dialog.translate_dialog', function(require){
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var core = require('web.core');
|
||||||
|
var BasicController = require('web.BasicController');
|
||||||
|
var data = require('web.data');
|
||||||
|
var Context = require('web.Context');
|
||||||
|
var concurrency = require('web.concurrency');
|
||||||
|
var Dialog = require('web.Dialog');
|
||||||
|
var FormView = require('web.FormView');
|
||||||
|
var View = require('web.AbstractView');
|
||||||
|
var session = require('web.session');
|
||||||
|
var rpc = require('web.rpc');
|
||||||
|
var FormController = require('web.FormController');
|
||||||
|
var _t = core._t;
|
||||||
|
var QWeb = core.qweb;
|
||||||
|
var Mutex = concurrency.Mutex;
|
||||||
|
|
||||||
|
var TranslateDialog = Dialog.extend({
|
||||||
|
template: "TranslateDialog",
|
||||||
|
init: function(parent, options) {
|
||||||
|
var title_string = _t("Translate fields: /");
|
||||||
|
var field_names;
|
||||||
|
var single_field = false;
|
||||||
|
if (options.field){
|
||||||
|
field_names = [options.field.fieldName];
|
||||||
|
single_field = true;
|
||||||
|
title_string = title_string.replace('/', field_names);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
field_names = this.get_translatable_fields(parent);
|
||||||
|
}
|
||||||
|
this._super(parent,
|
||||||
|
{title: title_string , size: 'x-large'});
|
||||||
|
this.view_language = session.user_context.lang;
|
||||||
|
this.view = parent;
|
||||||
|
this.view_type = parent.viewType || '';
|
||||||
|
this.translatable_fields = field_names;
|
||||||
|
this.res_id = options.res_id;
|
||||||
|
this.single_field = single_field;
|
||||||
|
this.languages = null;
|
||||||
|
this.languages_loaded = $.Deferred();
|
||||||
|
this.lang_data = new data.DataSetSearch(
|
||||||
|
this, 'res.lang', parent.searchView.dataset.get_context(),
|
||||||
|
[['translatable', '=', '1']]
|
||||||
|
);
|
||||||
|
this.lang_data.set_sort(['tr_sequence asc','id asc']);
|
||||||
|
this.lang_data.read_slice(['code', 'name']).then(this.on_languages_loaded);
|
||||||
|
},
|
||||||
|
willStart: function () {
|
||||||
|
var self = this;
|
||||||
|
return this._super.apply(this, arguments).then(function () {
|
||||||
|
if (self.size == 'x-large') {
|
||||||
|
self.$modal.find('.modal-dialog').addClass('modal-xl');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
get_translatable_fields: function(parent) {
|
||||||
|
var field_list = [];
|
||||||
|
_.each(parent.renderer.state.fields, function(field, name){
|
||||||
|
if (field.translate == true){
|
||||||
|
field_list.push(name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return field_list;
|
||||||
|
},
|
||||||
|
on_languages_loaded: function(langs) {
|
||||||
|
this.languages = langs;
|
||||||
|
this.languages_loaded.resolve();
|
||||||
|
},
|
||||||
|
open: function() {
|
||||||
|
// the template needs the languages
|
||||||
|
return $.when(this.languages_loaded).then($.proxy(this._super, this));
|
||||||
|
},
|
||||||
|
start: function() {
|
||||||
|
var self = this;
|
||||||
|
this.$('.oe_translation_field').change(function() {
|
||||||
|
$(this).toggleClass('touched', $(this).val() !== $(this).attr('data-value'));
|
||||||
|
});
|
||||||
|
this.$footer.html(QWeb.render("TranslateDialog.buttons"));
|
||||||
|
this.$footer.find(".oe_form_translate_dialog_save_button").click(function(){
|
||||||
|
self.on_button_save();
|
||||||
|
self.on_button_close();
|
||||||
|
});
|
||||||
|
this.$footer.find(".oe_form_translate_dialog_cancel_button").click(function(){
|
||||||
|
self.on_button_close();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.do_load_fields_values();
|
||||||
|
},
|
||||||
|
resize_textareas: function(){
|
||||||
|
var textareas = this.$('textarea.oe_translation_field');
|
||||||
|
var max_height = 100;
|
||||||
|
// Resize textarea either to the max height of its content if it stays
|
||||||
|
// in the modal or to the max height available in the modal
|
||||||
|
if (textareas.length) {
|
||||||
|
_.each(textareas, function(textarea) {
|
||||||
|
if (textarea.scrollHeight > max_height) {
|
||||||
|
max_height = textarea.scrollHeight;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var max_client_height = $(window).height() - $('.modal-content').height()
|
||||||
|
var new_height = Math.min(max_height, max_client_height)
|
||||||
|
textareas.css({'minHeight': new_height});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
set_maxlength: function(){
|
||||||
|
// set maxlength if initial field has size attr
|
||||||
|
_.each(this.translatable_fields, function(field_name){
|
||||||
|
var size = $('[name='+field_name+']')[0].maxLength;
|
||||||
|
if (size > 0){
|
||||||
|
this.$('input.oe_translation_field[name$="'+field_name+'"], textarea.oe_translation_field[name$="'+field_name+'"]').attr('maxlength', size);
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
},
|
||||||
|
initialize_html_fields: function(lang) {
|
||||||
|
// Initialize summernote if HTML field
|
||||||
|
this.$('.oe_form_field_html .oe_translation_field[name^="' + lang + '-"]').each(function() {
|
||||||
|
var $parent = $(this).summernote({
|
||||||
|
'focus': false,
|
||||||
|
'toolbar': [
|
||||||
|
['style', ['style']],
|
||||||
|
['font', ['bold', 'italic', 'underline', 'clear']],
|
||||||
|
['fontsize', ['fontsize']],
|
||||||
|
['color', ['color']],
|
||||||
|
['para', ['ul', 'ol', 'paragraph']],
|
||||||
|
['table', ['table']],
|
||||||
|
['insert', ['link', 'picture']],
|
||||||
|
['misc', ['codeview']],
|
||||||
|
['history', ['undo', 'redo']]
|
||||||
|
],
|
||||||
|
'prettifyHtml': false,
|
||||||
|
'styleWithSpan': false,
|
||||||
|
'inlinemedia': ['p'],
|
||||||
|
'lang': "odoo",
|
||||||
|
'onChange': function (value) {
|
||||||
|
$(this).toggleClass('touched', value !== $(this).attr('data-value'));
|
||||||
|
}
|
||||||
|
}).parent();
|
||||||
|
// Triggers a mouseup to refresh the editor toolbar
|
||||||
|
$parent.find('.note-editable').trigger('mouseup');
|
||||||
|
$parent.find('.note-editing-area').css({
|
||||||
|
minHeight:'100px',
|
||||||
|
minWidth:'260px',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
set_fields_values: function(lang, tr_value) {
|
||||||
|
_.each(tr_value, function(translation, field){
|
||||||
|
this.$('.oe_translation_field[name="' + lang +
|
||||||
|
'-' + field + '"]').val(translation || '').attr(
|
||||||
|
'data-value', translation || '');
|
||||||
|
}, this);
|
||||||
|
this.initialize_html_fields(lang);
|
||||||
|
},
|
||||||
|
do_load_fields_values: function() {
|
||||||
|
var self = this,
|
||||||
|
deferred = [];
|
||||||
|
|
||||||
|
this.$('.oe_translation_field').val('').removeClass('touched');
|
||||||
|
|
||||||
|
var def = $.Deferred();
|
||||||
|
deferred.push(def);
|
||||||
|
rpc.query({
|
||||||
|
model: this.view.modelName,
|
||||||
|
method: 'get_field_translations',
|
||||||
|
args: [
|
||||||
|
[this.res_id],
|
||||||
|
],
|
||||||
|
kwargs: {
|
||||||
|
field_names: this.translatable_fields,
|
||||||
|
},
|
||||||
|
}).done(
|
||||||
|
function (res) {
|
||||||
|
if (res[self.res_id]){
|
||||||
|
_.each(res[self.res_id], function(translation, lang) {
|
||||||
|
self.set_fields_values(lang, translation);
|
||||||
|
});
|
||||||
|
self.resize_textareas();
|
||||||
|
self.set_maxlength();
|
||||||
|
def.resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return deferred;
|
||||||
|
},
|
||||||
|
on_button_save: function() {
|
||||||
|
var translations = {},
|
||||||
|
self = this,
|
||||||
|
save_mutex = new Mutex();
|
||||||
|
this.$('.oe_translation_field.touched').each(function() {
|
||||||
|
var field = $(this).attr('name').split('-');
|
||||||
|
if (!translations[field[0]]) {
|
||||||
|
translations[field[0]] = {};
|
||||||
|
}
|
||||||
|
translations[field[0]][field[1]] = $(this).val();
|
||||||
|
});
|
||||||
|
_.each(translations, function(text, code) {
|
||||||
|
save_mutex.exec(function() {
|
||||||
|
var done = new $.Deferred(); // holds the mutex
|
||||||
|
|
||||||
|
var context = new Context(session.user_context, {lang: code});
|
||||||
|
rpc.query({
|
||||||
|
model: self.view.modelName,
|
||||||
|
method: 'write',
|
||||||
|
args: [self.res_id, text],
|
||||||
|
kwargs: {context: context.eval()}
|
||||||
|
}).then(function() {
|
||||||
|
done.resolve();
|
||||||
|
});
|
||||||
|
if (code === self.view_language) {
|
||||||
|
_.each(text, function(value, key) {
|
||||||
|
var view_elem = self.view.$('input[name="'+ key + '"]');
|
||||||
|
view_elem.val(value).trigger('change');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return done;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.close();
|
||||||
|
},
|
||||||
|
on_button_close: function() {
|
||||||
|
this.close();
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
FormController.include({
|
||||||
|
renderSidebar: function($node) {
|
||||||
|
this._super($node);
|
||||||
|
if (this.sidebar) {
|
||||||
|
var item = this.is_action_enabled('edit') && {
|
||||||
|
label: _t('Translate'),
|
||||||
|
callback: this.on_button_translate
|
||||||
|
};
|
||||||
|
if (item){
|
||||||
|
this.sidebar.items.other.push(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
on_button_translate: function() {
|
||||||
|
var self = this;
|
||||||
|
$.when(this.has_been_loaded).then(function() {
|
||||||
|
self.open_translate_dialog(null, self.initialState.res_id);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
BasicController.include({
|
||||||
|
open_translate_dialog: function(field, res_id) {
|
||||||
|
new TranslateDialog(this, {'field': field, 'res_id': res_id}).open();
|
||||||
|
},
|
||||||
|
|
||||||
|
_onTranslate: function(event) {
|
||||||
|
// the image next to the fields opens the translate dialog
|
||||||
|
var res_id = event.target.res_id ? event.target.res_id : event.target.state.res_id;
|
||||||
|
this.open_translate_dialog(event.data, res_id);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
TranslateDialog: TranslateDialog,
|
||||||
|
};
|
||||||
|
|
||||||
|
});
|
|
@ -0,0 +1,53 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Copyright 2012 Guewen Baconnier (Camptocamp SA)
|
||||||
|
Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||||
|
<template>
|
||||||
|
|
||||||
|
<t t-name="TranslateDialog">
|
||||||
|
<div class="modal-body">
|
||||||
|
<table t-if="widget.translatable_fields"
|
||||||
|
class="oe_frame oe_forms oe_translation_form"
|
||||||
|
border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||||
|
<tr>
|
||||||
|
<th t-if="!widget.single_field" class="oe_form_separator" width="1%" nowrap="nowrap">
|
||||||
|
<div class="separator horizontal">Field</div>
|
||||||
|
</th>
|
||||||
|
<th t-foreach="widget.languages" align="left">
|
||||||
|
<div class="separator horizontal"><t t-esc="name"/></div>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<t t-foreach="widget.translatable_fields" t-as="field_name">
|
||||||
|
<t t-set="field" t-value="widget.view.searchView.fields[field_name]" />
|
||||||
|
<tr t-att-data-field="field_name">
|
||||||
|
<td t-if="!widget.single_field" class="oe_form_frame_cell field_name" width="1%" nowrap="nowrap">
|
||||||
|
<label class="oe_label"><t t-esc="field.string"/>:</label>
|
||||||
|
</td>
|
||||||
|
<td t-foreach="widget.languages" t-as="lg" class="oe_form_frame_cell">
|
||||||
|
<input t-if="['char','url'].indexOf(field.type) !== -1"
|
||||||
|
type="text" t-attf-name="#{lg.code}-#{field_name}"
|
||||||
|
value="" data-value="" class="oe_translation_field"/>
|
||||||
|
<textarea t-elif="field.type == 'text'"
|
||||||
|
t-attf-name="#{lg.code}-#{field_name}" data-value=""
|
||||||
|
class="oe_translation_field" />
|
||||||
|
<div t-elif="field.type == 'html'" class="oe_form_field_html">
|
||||||
|
<textarea class="oe_translation_field oe_form_field"
|
||||||
|
t-attf-name="#{lg.code}-#{field_name}" data-value=""/>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</t>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</t>
|
||||||
|
|
||||||
|
<t t-name="TranslateDialog.buttons">
|
||||||
|
<button class="btn btn-sm oe_button btn-primary oe_form_translate_dialog_save_button">
|
||||||
|
<span>Save</span>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-sm oe_button btn-default oe_form_translate_dialog_cancel_button">
|
||||||
|
<span>Cancel</span>
|
||||||
|
</button>
|
||||||
|
</t>
|
||||||
|
|
||||||
|
</template>
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record id="res_lang_form" model="ir.ui.view">
|
||||||
|
<field name="name">res.lang.form.inherit</field>
|
||||||
|
<field name="inherit_id" ref="base.res_lang_form" />
|
||||||
|
<field name="model">res.lang</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="translatable" position="after">
|
||||||
|
<field name="tr_sequence" attrs="{'invisible': [('translatable', '!=', True)]}" />
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright 2012 Guewen Baconnier (Camptocamp SA)
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
<template id="assets_backend" name="web_translate_dialog assets"
|
||||||
|
inherit_id="web.assets_backend">
|
||||||
|
<xpath expr="." position="inside">
|
||||||
|
<script type="text/javascript"
|
||||||
|
src="/web_translate_dialog/static/src/js/web_translate_dialog.js"/>
|
||||||
|
<link rel="stylesheet" id="translate-dialog-stylesheet"
|
||||||
|
href="/web_translate_dialog/static/src/css/base.css"/>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
</odoo>
|
Loading…
Reference in New Issue