-
Notifications
You must be signed in to change notification settings - Fork 51
18.0 sbc translation #2091
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
Merged
Merged
18.0 sbc translation #2091
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| ======================== | ||
| SBC Translation Platform | ||
| ======================== | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:0618759b92e4125f0843a051132da282dc211ff0aeae0368c4eac2cd73fecaae | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
| :target: https://odoo-community.org/page/development-status | ||
| :alt: Beta | ||
| .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
| :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
| :alt: License: AGPL-3 | ||
| .. |badge3| image:: https://img.shields.io/badge/github-CompassionCH%2Fcompassion--modules-lightgray.png?logo=github | ||
| :target: https://github.com/CompassionCH/compassion-modules/tree/18.0/sbc_translation | ||
| :alt: CompassionCH/compassion-modules | ||
|
|
||
| |badge1| |badge2| |badge3| | ||
|
|
||
| Compassion SBC Translation Platform | ||
| ----------------------------------- | ||
|
|
||
| This adds the backend management of SBC letters in the translation | ||
| stage. Once can manage all letters in translation and keep track of the | ||
| progress. It also serves as XMLRPC-API for the Translation Platform | ||
| written in OWL | ||
| (https://github.com/compassionch/translation-platform-web). | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Installation | ||
| ============ | ||
|
|
||
| To install this module, you need to: | ||
|
|
||
| 1. Clone the translation-platform project | ||
| (https://github.com/compassionch/translation-platform-web). | ||
| 2. Create a ``.env.production.local`` file and compile the web-app. | ||
| 3. Copy the compiled app created in the ``dist`` folder into the | ||
| ``/static/tp/`` folder of the module. | ||
| 4. This will make the front-end interface available from your Odoo | ||
| server with ``http://server_url/translation-platform`` route. | ||
|
|
||
| Configuration | ||
| ============= | ||
|
|
||
| To configure this module, you need to: | ||
|
|
||
| 1. Give access rights to users | ||
|
|
||
| - Front end translators need the User rights. | ||
| - Managers need the Manager rights for accessing the backend. | ||
|
|
||
| |image1| | ||
|
|
||
| .. |image1| image:: https://raw.githubusercontent.com/CompassionCH/compassion-modules/18.0/sbc_translation/static/description/user_rights.jpg | ||
|
|
||
| Usage | ||
| ===== | ||
|
|
||
| To use this module, you need to: | ||
|
|
||
| 1. Go to /Sponsorship/Correspondence/Translation Platform/ menu | ||
|
|
||
| - Translation Pool is the list of all letters currently in | ||
| translation | ||
| - Translators is the list of translators | ||
| - Competences is the available skills of translations. It is also an | ||
| entry point to the translation pool, filtered by language. | ||
|
|
||
| Changelog | ||
| ========= | ||
|
|
||
| 12.0.1.0.0 (2023-02-28) | ||
| ----------------------- | ||
|
|
||
| - First version | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/CompassionCH/compassion-modules/issues>`_. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
| `feedback <https://github.com/CompassionCH/compassion-modules/issues/new?body=module:%20sbc_translation%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Authors | ||
| ------- | ||
|
|
||
| * Compassion CH | ||
|
|
||
| Contributors | ||
| ------------ | ||
|
|
||
| - Emanuel Cino <ecino@compassion.ch> | ||
|
|
||
| Maintainers | ||
| ----------- | ||
|
|
||
| This module is part of the `CompassionCH/compassion-modules <https://github.com/CompassionCH/compassion-modules/tree/18.0/sbc_translation>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| from . import models | ||
| from . import controllers | ||
| from . import wizards | ||
| from .hooks.post_init_hook import post_init_hook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| ############################################################################## | ||
| # | ||
| # ______ Releasing children from poverty _ | ||
| # / ____/___ ____ ___ ____ ____ ___________(_)___ ____ | ||
| # / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \ | ||
| # / /___/ /_/ / / / / / / /_/ / /_/ (__ |__ ) / /_/ / / / / | ||
| # \____/\____/_/ /_/ /_/ .___/\__,_/____/____/_/\____/_/ /_/ | ||
| # /_/ | ||
| # in Jesus' name | ||
| # | ||
| # Copyright (C) 2022 Compassion CH (http://www.compassion.ch) | ||
| # @author: Emanuel Cino <ecino@compassion.ch> | ||
| # | ||
| # This program is free software: you can redistribute it and/or modify | ||
| # it under the terms of the GNU Affero General Public License as | ||
| # published by the Free Software Foundation, either version 3 of the | ||
| # License, or (at your option) any later version. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU Affero General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU Affero General Public License | ||
| # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| # | ||
| ############################################################################## | ||
| # pylint: disable=C8101 | ||
| { | ||
| "name": "SBC Translation Platform", | ||
| "version": "18.0.1.0.0", | ||
| "category": "Compassion", | ||
| "summary": "SBC - Translation Platform", | ||
| "sequence": 150, | ||
| "author": "Compassion CH", | ||
| "license": "AGPL-3", | ||
| "website": "https://github.com/CompassionCH/compassion-modules", | ||
| "depends": ["sbc_compassion", "partner_contact_birthdate", "website"], | ||
| "assets": { | ||
| "web.assets_backend": ["sbc_translation/js/translation_letter_counting_js.js"] | ||
| }, | ||
| "data": [ | ||
| "security/ir_groups.xml", | ||
| "security/ir.model.access.csv", | ||
| "security/access_rules.xml", | ||
| "wizards/reply_to_comments_view.xml", | ||
| "wizards/reply_to_issue_view.xml", | ||
| "wizards/translation_letter_counting_view.xml", | ||
| "data/mail_template.xml", | ||
| "data/update_translation_priority_cron.xml", | ||
| "data/website.xml", | ||
| "data/queue_job.xml", | ||
| "views/translation_user_view.xml", | ||
| "views/correspondence_view.xml", | ||
| "views/translation_pool_view.xml", | ||
| ], | ||
| "demo": [], | ||
| "installable": True, | ||
| "auto_install": False, | ||
| "post_init_hook": "post_init_hook", | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ############################################################################## | ||
| # | ||
| # Copyright (C) 2023 Compassion CH (http://www.compassion.ch) | ||
| # Releasing children from poverty in Jesus' name | ||
| # @author: Emanuel Cino <ecino@compassion.ch> | ||
| # | ||
| # The licence is in the file __manifest__.py | ||
| # | ||
| ############################################################################## | ||
| from . import main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| ############################################################################## | ||
| # | ||
| # Copyright (C) 2023 Compassion CH (http://www.compassion.ch) | ||
| # Releasing children from poverty in Jesus' name | ||
| # | ||
| # The licence is in the file __manifest__.py | ||
| # | ||
| ############################################################################## | ||
| import logging | ||
|
|
||
| from werkzeug.utils import redirect | ||
|
|
||
| from odoo import http | ||
| from odoo.tools import file_open | ||
|
|
||
| _logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class RestController(http.Controller): | ||
| @http.route( | ||
| ["/translation-platform", "/translation-platform/<path:page>"], | ||
| type="http", | ||
| auth="public", | ||
| ) | ||
| def translation_platform(self, page=""): | ||
| """ | ||
| Simple server for the translation platform which should be compiled into | ||
| /static/tp folder. | ||
| :param page: This the route requested | ||
| :return: index.html, or assets. | ||
| """ | ||
| if ( | ||
| "assets" in page or page.endswith(".png") or page.endswith(".jpg") | ||
| ): # Serving assets | ||
| return redirect(f"/sbc_translation/static/tp/{page}") | ||
| with file_open("sbc_translation/static/tp/index.html") as app: | ||
| return app.read() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| <odoo noupdate="1"> | ||
| <record id="translation_issue_notification" model="mail.template"> | ||
| <field name="name">Translation issue notification</field> | ||
| <field name="subject">A translation issue was raised</field> | ||
| <field name="model_id" ref="model_correspondence" /> | ||
| <field name="email_from"> | ||
| ${object.new_translator_id.partner_id.email} | ||
| </field> | ||
| <field name="email_to">${object.translation_supervisor_id.email}</field> | ||
| <field name="body_html" type="html"> | ||
| <ul> | ||
| <li>Issue type: ${object.translate("translation_issue")}</li> | ||
| </ul> | ||
| <span> | ||
| ${object.translation_issue_comments | safe} | ||
| </span> | ||
| </field> | ||
| </record> | ||
|
|
||
| <template id="translation_issue_log"> | ||
| <p> | ||
| <b>Issue type</b>: | ||
| <span t-field="record.translation_issue" /> | ||
| </p> | ||
| <span t-field="record.translation_issue_comments" /> | ||
| </template> | ||
|
|
||
| <template id="translation_comments_update"> | ||
| <p> | ||
| Comments updated | ||
| </p> | ||
| <ul> | ||
| <li t-foreach="comments" t-as="comment"> | ||
| Page | ||
| <t t-esc="comment['page_index']"/> | ||
| paragraph | ||
| <t t-esc="comment['paragraph_index']"/>: | ||
| <t t-esc="comment['old']" /> | ||
| <span | ||
| class="o_Message_trackingValueSeparator o_Message_trackingValueItem fa fa-long-arrow-right" | ||
| title="Changed" | ||
| role="img" | ||
| /> | ||
| <t t-esc="comment['new']" /> | ||
| </li> | ||
| </ul> | ||
| </template> | ||
|
|
||
| <template id="comments_reply"> | ||
| <p t-raw="reply" /> | ||
| <hr /> | ||
| <table> | ||
| <tr> | ||
| <th style="width: 40%">Paragraph</th> | ||
| <th style="width: 40%">Comments</th> | ||
| </tr> | ||
| <t | ||
| t-foreach="object.mapped('page_ids.paragraph_ids')" | ||
| t-as="paragraph" | ||
| > | ||
| <t t-if="paragraph.comments"> | ||
| <tr> | ||
| <td | ||
| t-esc="paragraph.translated_text" | ||
| style="width: 40%" | ||
| /> | ||
| <td | ||
| t-esc="paragraph.comments" | ||
| style="width: 40%; margin-left: 10px" | ||
| /> | ||
| </tr> | ||
| </t> | ||
| </t> | ||
| </table> | ||
| <hr /> | ||
| <p><a | ||
| t-att-href="object.translation_url" | ||
| >Open the letter in the translation platform</a></p> | ||
| </template> | ||
|
|
||
| <template id="issue_reply"> | ||
| <p>Dear <span t-field="object.new_translator_id.partner_id.name" />,</p> | ||
| <p>You have just received a response to a problem about a letter on the translation platform you reported:</p> | ||
| <p t-raw="reply" /> | ||
| </template> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <odoo> | ||
| <!-- Job functions --> | ||
| <record id="move_pool_job" model="queue.job.function"> | ||
| <field name="model_id" ref="model_correspondence"/> | ||
| <field name="method">move_pool</field> | ||
| <field name="channel_id" ref="sbc_compassion.channel_sbc_compassion"/> | ||
| </record> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <odoo> | ||
| <record id="update_translation_priority_cron" model="ir.cron"> | ||
| <field name="name">Update translation priority</field> | ||
| <field name="model_id" ref="model_correspondence"/> | ||
| <field name="type">ir.action.server</field> | ||
| <field name="state">code</field> | ||
| <field name="code">model.update_translation_priority_cron()</field> | ||
| <field name="interval_number">1</field> | ||
| <field name="interval_type">weeks</field> | ||
| <field name="nextcall" eval="datetime.now().strftime('%Y-%m-%d')"/> | ||
| </record> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <odoo> | ||
| <record id="translation_website" model="website"> | ||
| <field name="name">Translation Platform</field> | ||
| <field name="domain">translate.compassion.ch</field> | ||
| </record> | ||
| </odoo> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.