From 6b6dab83d46e1e8a8a29b4b3941e8e02be11546f Mon Sep 17 00:00:00 2001 From: Alexandre Vicenzi Date: Thu, 4 Feb 2021 22:33:17 +0100 Subject: [PATCH] Translate license Fix #232 --- docs/pelicanconf.py | 3 ++- templates/partial/cc_license.html | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/pelicanconf.py b/docs/pelicanconf.py index d4c2210..c46487e 100644 --- a/docs/pelicanconf.py +++ b/docs/pelicanconf.py @@ -55,10 +55,11 @@ MENUITEMS = ( ) CC_LICENSE = { - "name": "Creative Commons Attribution-ShareAlike", + "name": "Creative Commons Attribution-ShareAlike 4.0 International License", "version": "4.0", "slug": "by-sa", "icon": True, + "language": "en_US", } COPYRIGHT_YEAR = datetime.now().year diff --git a/templates/partial/cc_license.html b/templates/partial/cc_license.html index d7d6ce9..756cc49 100644 --- a/templates/partial/cc_license.html +++ b/templates/partial/cc_license.html @@ -1,5 +1,11 @@

- © {{ COPYRIGHT_YEAR }} {{ COPYRIGHT_NAME }} - This work is licensed under a {{ CC_LICENSE['name'] }} {{ CC_LICENSE['version'] }} International License + {% set cc_slug = CC_LICENSE['slug'] %} + {% set cc_name = CC_LICENSE['name'] %} + {% set cc_version = CC_LICENSE['version'] %} + {% set cc_lang = CC_LICENSE['language'] or "en_US" %} + {% set cc_url = "http://creativecommons.org/licenses/{}/{}/deed.{}".format(cc_slug, cc_version, cc_lang) %} + © {{ COPYRIGHT_YEAR }} {{ COPYRIGHT_NAME }} - {{ _('This work is licensed under a %(cc)s', + cc='{}'.format(cc_url, cc_name)|safe) }}

{% include "partial/flex.html" %}