[FIX] legal: fix some broken links (pdfs, translations)
1) PDF files are generated and stored at the root of the CURRENT_BRANCH
directory. The links to those files are generated at different levels of
the doctree, which makes it impossible to use a relative path.
For example the same "Enterprise Agreement" doc in EN is published on:
- /16.0/legal/terms/enterprise.html
- /16.0/fr/legal/terms/enterprise.html
As a workaround, use absolute links for the PDFs. They won't work
locally for now. Can be improved later, as long as we don't break
those links located in various depths of the troctree.
2) The legal constracts aren't translated in all availables languages
(yet), so those links are 404s now. Introduced a conf.py variable
`legal_translations` with the list of languages where translated
contracts are indeed available, and falling back to the EN version
otherwise. Some languages don't have *all* the contracts translated, so
some 404 may remain temporarily.
Forward-port of f69dba70be
This commit is contained in:
parent
e6e609be76
commit
f4d032ecbc
10
conf.py
10
conf.py
@ -317,6 +317,12 @@ latex_documents = [
|
||||
'odoo_partnership_agreement_es.tex', 'Odoo Partnership Agreement (ES)', '', 'howto'),
|
||||
]
|
||||
|
||||
# List of languages that have legal translations (excluding EN). The keys must be in
|
||||
# `languages_names`. These translations will have a link to their versions of the legal
|
||||
# contracts, instead of the default EN one. The main legal documents are not part of the
|
||||
# translations since they have legal meaning.
|
||||
legal_translations = ['de', 'es', 'fr', 'nl']
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of the title page.
|
||||
latex_logo = 'static/img/odoo_logo.png'
|
||||
|
||||
@ -445,6 +451,10 @@ def _generate_alternate_urls(app, pagename, templatename, context, doctree):
|
||||
)
|
||||
)
|
||||
|
||||
# Dynamic generation of localized legal doc links
|
||||
context['legal_translations'] = legal_translations
|
||||
|
||||
|
||||
def _build_url(_version=None, _lang=None):
|
||||
if app.config.is_remote_build:
|
||||
# Project root like https://www.odoo.com/documentation
|
||||
|
@ -6,7 +6,7 @@ Odoo Enterprise Subscription Agreement
|
||||
|
||||
.. only:: html
|
||||
|
||||
`Download PDF <../../odoo_enterprise_agreement.pdf>`_
|
||||
`Download PDF <https://www.odoo.com/documentation/{CURRENT_BRANCH}/odoo_enterprise_agreement.pdf>`_
|
||||
|
||||
.. note:: Version 10a - 2022-10-27
|
||||
|
||||
|
@ -7,7 +7,7 @@ Odoo Enterprise Abonnementsvertrag
|
||||
|
||||
.. only:: html
|
||||
|
||||
`Download PDF <odoo_enterprise_agreement_de.pdf>`_
|
||||
`Download PDF <https://www.odoo.com/documentation/{CURRENT_BRANCH}/odoo_enterprise_agreement_de.pdf>`_
|
||||
.. warning::
|
||||
Dies ist eine deutsche Übersetzung des "Odoo Enterprise Subscription Agreement". Diese
|
||||
Übersetzung soll das Verständnis erleichtern, hat aber keinen rechtlichen Wert. Der einzige
|
||||
|
@ -7,7 +7,7 @@ Acuerdo de suscripción de Odoo Enterprise
|
||||
|
||||
.. only:: html
|
||||
|
||||
`Download PDF <odoo_enterprise_agreement_es.pdf>`_
|
||||
`Download PDF <https://www.odoo.com/documentation/{CURRENT_BRANCH}/odoo_enterprise_agreement_es.pdf>`_
|
||||
.. warning::
|
||||
Esta es una traducción al español del "Odoo Enterprise Subscription Agreement".
|
||||
Esta traducción se proporciona con la esperanza de que facilite la comprensión, pero no tiene
|
||||
|
@ -6,7 +6,7 @@ Odoo Enterprise Subscription Agreement (FR)
|
||||
|
||||
.. only:: html
|
||||
|
||||
`Download PDF <odoo_enterprise_agreement_fr.pdf>`_
|
||||
`Download PDF <https://www.odoo.com/documentation/{CURRENT_BRANCH}/odoo_enterprise_agreement_fr.pdf>`_
|
||||
.. warning::
|
||||
Ceci est une traduction en français du contrat “Odoo Enterprise Subscription Agreement”.
|
||||
Cette traduction est fournie dans l’espoir qu’elle facilitera sa compréhension, mais elle
|
||||
|
@ -7,7 +7,7 @@ Odoo Enterprise Subscription Agreement (NL)
|
||||
|
||||
.. only:: html
|
||||
|
||||
`Download PDF <odoo_enterprise_agreement_nl.pdf>`_
|
||||
`Download PDF <https://www.odoo.com/documentation/{CURRENT_BRANCH}/odoo_enterprise_agreement_nl.pdf>`_
|
||||
.. warning::
|
||||
Dit is een Nederlandse vertaling van de "Odoo Enterprise Subscription Agreement".
|
||||
Deze vertaling wordt verstrekt in de hoop dat deze het begrip zal vergemakkelijken,
|
||||
|
@ -6,7 +6,7 @@ Odoo Partnership Agreement (ES)
|
||||
|
||||
.. only:: html
|
||||
|
||||
`Download PDF <odoo_partnership_agreement_es.pdf>`_
|
||||
`Download PDF <https://www.odoo.com/documentation/{CURRENT_BRANCH}/odoo_partnership_agreement_es.pdf>`_
|
||||
.. warning::
|
||||
Esta es una traducción al español del "Odoo Partnership Agreement".
|
||||
Esta traducción se proporciona con la esperanza de que facilitará la comprensión,
|
||||
|
@ -6,7 +6,7 @@ Odoo Partnership Agreement (FR)
|
||||
|
||||
.. only:: html
|
||||
|
||||
`Download PDF <odoo_partnership_agreement_fr.pdf>`_
|
||||
`Download PDF <https://www.odoo.com/documentation/{CURRENT_BRANCH}/odoo_partnership_agreement_fr.pdf>`_
|
||||
.. warning::
|
||||
Ceci est une traduction en français du contrat “Odoo Partnership Agreement”.
|
||||
Cette traduction est fournie dans l’espoir qu’elle facilitera sa compréhension, mais elle
|
||||
|
@ -36,7 +36,7 @@
|
||||
<p>{{ _("Applies to self-hosting, Odoo.SH and Odoo Cloud.") }}</p>
|
||||
<div>
|
||||
{%- set enterprise_agreement_path_en = 'legal/terms/enterprise.html' %}
|
||||
{%- if language_code == 'en' %}
|
||||
{%- if language_code not in legal_translations %}
|
||||
<a class="btn btn-primary" href="{{ enterprise_agreement_path_en }}" role="button">{{ _("Read") }}</a>
|
||||
{%- else %}
|
||||
<a class="btn btn-primary" href="{{ 'legal/terms/i18n/enterprise_%s.html' % language_code }}" role="button">{{ _("Read") }}</a>
|
||||
@ -55,7 +55,7 @@
|
||||
</div>
|
||||
<div>
|
||||
{%- set partnership_agreement_path_en = 'legal/terms/partnership.html' %}
|
||||
{%- if language_code == 'en' %}
|
||||
{%- if language_code not in legal_translations %}
|
||||
<a class="btn btn-primary" href="{{ partnership_agreement_path_en }}" role="button">{{ _("Read") }}</a>
|
||||
{%- else %}
|
||||
<a class="btn btn-primary" href="{{ 'legal/terms/i18n/partnership_%s.html' % language_code }}" role="button">{{ _("Read") }}</a>
|
||||
@ -74,7 +74,7 @@
|
||||
</div>
|
||||
<div>
|
||||
{%- set terms_of_sale_agreement_path_en = 'legal/terms/terms_of_sale.html' %}
|
||||
{%- if language_code == 'en' %}
|
||||
{%- if language_code not in legal_translations %}
|
||||
<a class="btn btn-primary" href="{{ terms_of_sale_agreement_path_en }}" role="button">{{ _("Read") }}</a>
|
||||
{%- else %}
|
||||
<a class="btn btn-primary" href="{{ 'legal/terms/i18n/terms_of_sale_%s.html' % language_code }}" role="button">{{ _("Read") }}</a>
|
||||
|
Loading…
Reference in New Issue
Block a user