From 9ad63e43b6eb770641d229cac60a365009a93f74 Mon Sep 17 00:00:00 2001 From: jdcaballerov Date: Mon, 9 Aug 2021 11:46:10 -0500 Subject: [PATCH 001/108] Start --- runserver.py | 12 +++++++++++- scholia/app/templates/base.html | 3 ++- scholia/app/views.py | 33 +++++++++++++++++++++++++++++++-- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/runserver.py b/runserver.py index dc798cdc9..4514794ec 100644 --- a/runserver.py +++ b/runserver.py @@ -1,10 +1,20 @@ from scholia.app import create_app - +from flask import redirect, request app = create_app( text_to_topic_q_text_enabled=False, third_parties_enabled=True) app.config['APPLICATION_ROOT'] = '/' +app.config['SUPPORTED_LANGUAGES'] = {'en': 'English'} +app.secret_key='p9uyg7yuwriwjigjergkrgrrrr' + +# @app.route('/') +# def redir(): +# lang = request.cookies.get('lang_code',None) +# if lang: +# return redirect('/'+ lang + '/') +# else: +# return redirect('/en/') if __name__ == '__main__': app.run(debug=True, port=8100) diff --git a/scholia/app/templates/base.html b/scholia/app/templates/base.html index 03e4a501c..ef8f210e4 100644 --- a/scholia/app/templates/base.html +++ b/scholia/app/templates/base.html @@ -86,7 +86,8 @@ + + + + + + + + -

BibTeX

+

BibTeX


 
-

CITATION.cff

+

CITATION.cff

CITATION.cff files are files that can be added to source code repository and distributions to indicate what literature can be cited when using that software. See diff --git a/scholia/app/templates/works.html b/scholia/app/templates/works.html index 261a4d465..1a2f49b59 100644 --- a/scholia/app/templates/works.html +++ b/scholia/app/templates/works.html @@ -25,26 +25,26 @@

Works

-

Authors

+

Authors

-

Topics

+

Topics

-

Citations

+

Citations

-

Citing works

+

Citing works

-

Citations per year

+

Citations per year

From 71969f24ba8af89aa09fef2db7f8e88d215e9de9 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 01:10:19 -0500 Subject: [PATCH 065/108] Add i18n data attribute to html for venue(s) aspect --- scholia/app/templates/venue.html | 34 +++++++++++------------ scholia/app/templates/venue_cito.html | 8 +++--- scholia/app/templates/venue_curation.html | 4 +-- scholia/app/templates/venue_empty.html | 6 ++-- scholia/app/templates/venues.html | 6 ++-- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/scholia/app/templates/venue.html b/scholia/app/templates/venue.html index 0812e791c..d57479468 100644 --- a/scholia/app/templates/venue.html +++ b/scholia/app/templates/venue.html @@ -51,27 +51,27 @@

Venue

-

Recently published works RSS icon

+

Recently published works RSS icon

-

Topics

+

Topics

-

Authors

+

Authors

-

Author images

+

Author images

-

Authors

+

Authors

@@ -81,7 +81,7 @@

Authors

page to resolve the author names. -

Co-author graph

+

Co-author graph

@@ -89,56 +89,56 @@

Co-author graph

-

Citations

+

Citations

Most cited articles

+ title="Most cited articles published in the venue, where the citations may come from any venue" data-i18n="venue-most-cited-articles">Most cited articles

Most cited authors

+ title="Most cited authors based on articles published in the venue and where citations may come from any venue" data-i18n="venue-most-cited-authors">Most cited authors
-

Citation distribution

+

Citation distribution

-

Cited venues

+

Cited venues

-

Citing venues

+

Citing venues

-

Articles citing retracted articles

+

Articles citing retracted articles

-

Gender distribution

+

Gender distribution

-

Authors

+

Authors

-

Authorships

+

Authorships

-

Author awards

+

Author awards

diff --git a/scholia/app/templates/venue_cito.html b/scholia/app/templates/venue_cito.html index fd691a468..342a3f00f 100644 --- a/scholia/app/templates/venue_cito.html +++ b/scholia/app/templates/venue_cito.html @@ -36,13 +36,13 @@

Venue

the intentions why articles in this venue are cited (incoming) and the intentions why articles in this venue are citing other articles (outgoing). -

Number of articles using a particular intention type

+

Number of articles using a particular intention type

-

Incoming citations

+

Incoming citations

@@ -50,7 +50,7 @@

Incoming citations

-

Outgoing citations

+

Outgoing citations

@@ -58,7 +58,7 @@

Outgoing citations

-

Most reused articles

+

Most reused articles

This list shows articles most cited because of 'uses method in', 'cites as data source', 'uses data from'. This number is there always equals or lower than the total number of diff --git a/scholia/app/templates/venue_curation.html b/scholia/app/templates/venue_curation.html index bddd0a12c..04a6c6b74 100644 --- a/scholia/app/templates/venue_curation.html +++ b/scholia/app/templates/venue_curation.html @@ -18,7 +18,7 @@ {% block page_content %}

Venue

-

Missing author item

+

Missing author item

If there are any author names listed below, it means that these name strings have not been matched to Wikidata items for at least some of the works published in the venue. @@ -26,7 +26,7 @@

Missing author item

-

Missing topics

+

Missing topics

The following highly cited articles have few or no "main subject" statements. diff --git a/scholia/app/templates/venue_empty.html b/scholia/app/templates/venue_empty.html index 9e9a6b04e..3b97edccc 100644 --- a/scholia/app/templates/venue_empty.html +++ b/scholia/app/templates/venue_empty.html @@ -4,11 +4,11 @@ {% block page_content %} -

Venues

+

Venues

Scientific journals, proceedings, ... -

Examples

+

Examples

-

Multiple venues

+

Multiple venues

  • Annals of Tourism Research, Journal of Sustainable Tourism, and Tourism Management
  • diff --git a/scholia/app/templates/venues.html b/scholia/app/templates/venues.html index 92bbce941..075ce6d3f 100644 --- a/scholia/app/templates/venues.html +++ b/scholia/app/templates/venues.html @@ -24,21 +24,21 @@

    Venues

    -

    Published works per year

    +

    Published works per year

    -

    Citations per year

    +

    Citations per year

    -

    Citations to work ratio

    +

    Citations to work ratio

    From 28883c4a5fa2c742e41261a6c804b7822edd18a8 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 01:13:00 -0500 Subject: [PATCH 066/108] Add i18n data attribute to html for use aspect --- scholia/app/templates/use.html | 10 +++++----- scholia/app/templates/use_empty.html | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scholia/app/templates/use.html b/scholia/app/templates/use.html index 924cafd20..abde3c74f 100644 --- a/scholia/app/templates/use.html +++ b/scholia/app/templates/use.html @@ -29,33 +29,33 @@

    Use

    -

    Recent work using the resource

    +

    Recent work using the resource

    -

    Co-usage

    +

    Co-usage

    Resources used together.
    -

    Topics of works using the resource

    +

    Topics of works using the resource

    -

    Authors of works using the resource

    +

    Authors of works using the resource

    -

    Usage over time

    +

    Usage over time

    Works using the resource over time. diff --git a/scholia/app/templates/use_empty.html b/scholia/app/templates/use_empty.html index 8ceb44ee1..5b9bb091c 100644 --- a/scholia/app/templates/use_empty.html +++ b/scholia/app/templates/use_empty.html @@ -11,10 +11,10 @@ {% block page_content %} -

    Use

    +

    Use

    -

    Examples

    +

    Examples

    Software:
      @@ -32,9 +32,9 @@

      Examples

    -

    Overview

    +

    Overview

    -

    Most used

    +

    Most used

    From 40555b69b11b47fbafe98ebf1cf9e1e432c87928 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 13:47:38 -0500 Subject: [PATCH 067/108] Add i18n data attribute to html for topic(s) aspect --- scholia/app/templates/topic.html | 38 +++++++++++------------ scholia/app/templates/topic_curation.html | 8 ++--- scholia/app/templates/topic_empty.html | 10 +++--- scholia/app/templates/topics.html | 4 +-- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/scholia/app/templates/topic.html b/scholia/app/templates/topic.html index 3f32c4088..2fa8c0432 100644 --- a/scholia/app/templates/topic.html +++ b/scholia/app/templates/topic.html @@ -73,37 +73,37 @@

    Topic

    -

    The topic in context

    +

    The topic in context

    -

    Recently published works on the topic RSS icon

    +

    Recently published works on the topic RSS icon

    -

    Publications per year

    +

    Publications per year

    -

    Earliest published works on the topic

    +

    Earliest published works on the topic

    -

    Authors

    +

    Authors

    -

    Authors publishing about the topic

    +

    Authors publishing about the topic

    -

    Author score

    +

    Author score

    Authors scored according to field of work, publications within the topic and citing works within the topic. @@ -119,7 +119,7 @@

    Author score

    curation page to resolve the author names. -

    Co-author graph

    +

    Co-author graph

    The 25 most prolific authors and some of their key co-authors. @@ -127,18 +127,18 @@

    Co-author graph

    -

    Awards received by authors who published on the topic

    +

    Awards received by authors who published on the topic

    -

    Topics

    +

    Topics

    -

    Co-occurring topics

    +

    Co-occurring topics

    -

    Co-occurring topics graph

    +

    Co-occurring topics graph

    Only a maximum of the 400 most often occuring links are shown. @@ -146,28 +146,28 @@

    Co-occurring topics graph

-

Co-occurring topics map

+

Co-occurring topics map

-

Venues and series publishing works about the topic

+

Venues and series publishing works about the topic

-

Citations

+

Citations

-

Works cited from works on the topic

+

Works cited from works on the topic

-

Authors cited from works on the topic

+

Authors cited from works on the topic

-

Map of organizations associated with works about the topic

+

Map of organizations associated with works about the topic

The colours indicate how many publications on the topic are associated with organizations in the given location, as detailed in the legend (top right). @@ -177,7 +177,7 @@

Map of organizations associated with works abou

-

Citation graph of works about the topic, aggregated by country

+

Citation graph of works about the topic, aggregated by country

The graph indicates the countries associated with organizations whose authors have published works on the topic, and indicates the most cited countries (arrowheads) as well as the countries they are most frequently cited from. diff --git a/scholia/app/templates/topic_curation.html b/scholia/app/templates/topic_curation.html index 83307127e..1bf369ddc 100644 --- a/scholia/app/templates/topic_curation.html +++ b/scholia/app/templates/topic_curation.html @@ -31,7 +31,7 @@

Topic

Missing information with respect to the topic {{ q }}. -

Missing author items

+

Missing author items

The authors listed below may only be represented as strings in Wikidata with no link to Wikidata items. @@ -40,19 +40,19 @@

Missing author items

-

Missing publication date

+

Missing publication date

For the listed publications, Wikidata does not have publication dates.
-

Missing publication venue

+

Missing publication venue

For the listed publications, Wikidata does not have a statement as to where they were published.
-

Works on the topic with missing additional topics

+

Works on the topic with missing additional topics

The following works have only been tagged with this one topic.
diff --git a/scholia/app/templates/topic_empty.html b/scholia/app/templates/topic_empty.html index fa4d944a6..f9081829f 100644 --- a/scholia/app/templates/topic_empty.html +++ b/scholia/app/templates/topic_empty.html @@ -4,18 +4,18 @@ {% block page_content %} -

Topic

+

Topic

-

Examples

+

Examples

-

Topic profiles

+

Topic profiles

@@ -104,7 +104,7 @@

Topic profiles

-

Comparisons

+

Comparisons

Scholia can show multiple topics together.

@@ -140,7 +140,7 @@

Comparisons

-

Specialized topics

+

Specialized topics

diff --git a/scholia/app/templates/topics.html b/scholia/app/templates/topics.html index 1614a3783..dc0bd2703 100644 --- a/scholia/app/templates/topics.html +++ b/scholia/app/templates/topics.html @@ -38,12 +38,12 @@

Topics

-

List of works on any combination of these topics

+

List of works on any combination of these topics

-

Authors

+

Authors

From fb483c0549fa701603cdf611c48be9f904517591 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 13:54:54 -0500 Subject: [PATCH 068/108] Add i18n data attribute to html for text_to_topics aspect --- scholia/app/templates/text_to_topics.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scholia/app/templates/text_to_topics.html b/scholia/app/templates/text_to_topics.html index 12552c7d8..996f2f3c4 100644 --- a/scholia/app/templates/text_to_topics.html +++ b/scholia/app/templates/text_to_topics.html @@ -3,7 +3,7 @@ {% block page_content %} -

Text

+

Text

{% if enabled %} From c2e20d0d8cdc4234e6c285cd9a9e986a3b8590da Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 17:10:22 -0500 Subject: [PATCH 069/108] Add i18n data attribute to html for taxon aspect --- scholia/app/templates/taxon.html | 10 +++++----- scholia/app/templates/taxon_empty.html | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scholia/app/templates/taxon.html b/scholia/app/templates/taxon.html index de57ee46a..7c457895e 100644 --- a/scholia/app/templates/taxon.html +++ b/scholia/app/templates/taxon.html @@ -22,11 +22,11 @@

Taxon

-

Identifiers

+

Identifiers

-

Parent Taxa

+

Parent Taxa

@@ -34,17 +34,17 @@

Parent Taxa

-

Genome

+

Genome

-

Proteome

+

Proteome

-

Metabolome

+

Metabolome

diff --git a/scholia/app/templates/taxon_empty.html b/scholia/app/templates/taxon_empty.html index abde872d2..8403eccb4 100644 --- a/scholia/app/templates/taxon_empty.html +++ b/scholia/app/templates/taxon_empty.html @@ -4,17 +4,17 @@ {% block page_content %} -

Taxa

+

Taxa

-

Examples

+

Examples

-

Single items

+

Single items

@@ -44,7 +44,7 @@

Single items

-

Redirecting

+

Redirecting

If you know the identifier then Scholia can make a lookup based on the identifier:

From 2253c785d8e965852e52a6c0ac1a9cf089628d28 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 17:13:58 -0500 Subject: [PATCH 070/108] Add i18n data attribute to html for sponsor aspect --- scholia/app/templates/sponsor.html | 10 +++++----- scholia/app/templates/sponsor_empty.html | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scholia/app/templates/sponsor.html b/scholia/app/templates/sponsor.html index e5d2121d9..c2b5cd30e 100644 --- a/scholia/app/templates/sponsor.html +++ b/scholia/app/templates/sponsor.html @@ -47,17 +47,17 @@

Sponsor

-

Recently published sponsored works RSS icon

+

Recently published sponsored works RSS icon

-

Authors on sponsored works

+

Authors on sponsored works

-

Topics of sponsored works

+

Topics of sponsored works

@@ -65,12 +65,12 @@

Topics of sponsored works

-

Co-sponsors

+

Co-sponsors

-

Project budgets

+

Project budgets

diff --git a/scholia/app/templates/sponsor_empty.html b/scholia/app/templates/sponsor_empty.html index 473f13904..934ce8cd3 100644 --- a/scholia/app/templates/sponsor_empty.html +++ b/scholia/app/templates/sponsor_empty.html @@ -4,11 +4,11 @@ {% block page_content %} -

Sponsor

+

Sponsor

Funding. -

Examples

+

Examples

  • Lundbeck Foundation
  • From 54fe2d1e84513acc40a2904cfc50a9da88b6f4d5 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 17:17:35 -0500 Subject: [PATCH 071/108] Add i18n data attribute to html for series aspect --- scholia/app/templates/series.html | 10 +++++----- scholia/app/templates/series_empty.html | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scholia/app/templates/series.html b/scholia/app/templates/series.html index eccb9784d..a5bd67c00 100644 --- a/scholia/app/templates/series.html +++ b/scholia/app/templates/series.html @@ -23,28 +23,28 @@

    Series

    -

    In series

    +

    In series

    -

    Published works

    +

    Published works

    -

    Topics

    +

    Topics

    -

    Authors

    +

    Authors

    -

    Organizations

    +

    Organizations

    Employment relationships per year. diff --git a/scholia/app/templates/series_empty.html b/scholia/app/templates/series_empty.html index 1d12c9ef0..df9daa3c7 100644 --- a/scholia/app/templates/series_empty.html +++ b/scholia/app/templates/series_empty.html @@ -4,11 +4,11 @@ {% block page_content %} -

    Series

    +

    Series

    Proceedings series, ... -

    Examples

    +

    Examples

    • Lecture Notes in Computer Science (LNCS)
    • From 32c37d9c2ca63f1089cd6034402cc02641dd4a07 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 18:06:04 -0500 Subject: [PATCH 072/108] Add i18n data attribute to html for search aspect --- scholia/app/templates/search.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scholia/app/templates/search.html b/scholia/app/templates/search.html index e9459ae71..df463b051 100644 --- a/scholia/app/templates/search.html +++ b/scholia/app/templates/search.html @@ -5,7 +5,7 @@ {% block page_content %} -

      Search

      +

      Search

      @@ -17,9 +17,9 @@

      Search


      {% if search_results %} -
      Results
      +
      Results
      {% else %} -
      No results for "{{ query }}"
      +
      No results for "{{ query }}"
      {% endif %}
      From 837a88a5f977dbf2635305bf0840382c9d237546 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 18:16:16 -0500 Subject: [PATCH 073/108] Add i18n data attribute to h4 html for protein_emptyt --- scholia/app/templates/protein_empty.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scholia/app/templates/protein_empty.html b/scholia/app/templates/protein_empty.html index 011208b1c..ea4f77209 100644 --- a/scholia/app/templates/protein_empty.html +++ b/scholia/app/templates/protein_empty.html @@ -16,7 +16,7 @@

      Examples

      -

      Single items

      +

      Single items

      @@ -37,7 +37,7 @@

      Single items

      -

      Redirecting

      +

      Redirecting

      If you know the identifier then Scholia can make a lookup based on the identifier:

      From a7db724d0884b1b69ee17fabeba11912369ce3cc Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 19:22:29 -0500 Subject: [PATCH 074/108] Add i18n data attribute to html for property aspect --- scholia/app/templates/property.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scholia/app/templates/property.html b/scholia/app/templates/property.html index 44387950f..dd9cd4e24 100644 --- a/scholia/app/templates/property.html +++ b/scholia/app/templates/property.html @@ -18,21 +18,21 @@ {% block page_content %} -

      Property: {{ p }}

      +

      Property: {{ p }}

      -

      Use

      +

      Use

      -

      Item counts

      +

      Item counts

      -

      Property value counts

      +

      Property value counts

      From b840d25714f1a693d6dbfcff746a029885e04bf8 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 23:03:50 -0500 Subject: [PATCH 075/108] Add i18n data attribute to h4 html for project_empty --- scholia/app/templates/project_empty.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scholia/app/templates/project_empty.html b/scholia/app/templates/project_empty.html index e30c01078..4511b5a28 100644 --- a/scholia/app/templates/project_empty.html +++ b/scholia/app/templates/project_empty.html @@ -29,7 +29,7 @@

      Examples

      -

      Individual Projects

      +

      Individual Projects

      @@ -66,7 +66,7 @@

      Individual Projects

      -

      Clusters

      +

      Clusters

      @@ -80,7 +80,7 @@

      Clusters

      -

      Redirecting

      +

      Redirecting

      If you know the identifier then Scholia can make a lookup based on the identifier:

      From 198eb9e67d0b44d38894bd3446a503e4910a915a Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Wed, 1 Sep 2021 23:31:35 -0500 Subject: [PATCH 076/108] Add i18n data attribute to html for pathway aspect --- scholia/app/templates/pathway.html | 10 +++++----- scholia/app/templates/pathway_empty.html | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scholia/app/templates/pathway.html b/scholia/app/templates/pathway.html index 646c83004..8869d0af3 100644 --- a/scholia/app/templates/pathway.html +++ b/scholia/app/templates/pathway.html @@ -24,22 +24,22 @@

      Pathway

      -

      Organism

      +

      Organism

      -

      Participants

      +

      Participants

      -

      Published works related to the pathway

      +

      Published works related to the pathway

      -

      Works citing this pathway

      +

      Works citing this pathway

      -

      Publications per year

      +

      Publications per year

      diff --git a/scholia/app/templates/pathway_empty.html b/scholia/app/templates/pathway_empty.html index 5cbd294dd..5bf03fb61 100644 --- a/scholia/app/templates/pathway_empty.html +++ b/scholia/app/templates/pathway_empty.html @@ -12,17 +12,17 @@ {% block page_content %} -

      Biological pathways

      +

      Biological pathways

      -

      Examples

      +

      Examples

      -

      Single items

      +

      Single items

      @@ -48,7 +48,7 @@

      Single items

      -

      Redirecting

      +

      Redirecting

      If you know the identifier then Scholia can make a lookup based on the identifier:

      @@ -63,7 +63,7 @@

      Redirecting

      -

      Statistics

      +

      Statistics

      From 4dc41adbef653d731b44ecc5e709c9b79682c2c6 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Thu, 2 Sep 2021 00:05:01 -0500 Subject: [PATCH 077/108] Add i18n data attribute to html for index aspect --- scholia/app/templates/index-statistics.html | 2 +- scholia/app/templates/index.html | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scholia/app/templates/index-statistics.html b/scholia/app/templates/index-statistics.html index 48144894e..1a7ddec8e 100644 --- a/scholia/app/templates/index-statistics.html +++ b/scholia/app/templates/index-statistics.html @@ -13,7 +13,7 @@
      -

      Statistics

      +

      Statistics

      Scholia uses Wikidata for all its data. What is the size of our data corpus? diff --git a/scholia/app/templates/index.html b/scholia/app/templates/index.html index ac1467021..12d8adb04 100644 --- a/scholia/app/templates/index.html +++ b/scholia/app/templates/index.html @@ -34,7 +34,7 @@
      -

      Search

      +

      Search

      Search
      -

      Examples

      +

      Examples

      -

      Profiles

      +

      Profiles

      @@ -110,7 +110,7 @@

      Profiles

      -

      Combinations

      +

      Combinations

      Scholia can show multiple items together.

      @@ -149,7 +149,7 @@

      Combinations

      -

      Redirects

      +

      Redirects

      If you know the external identifier of a concept, then Scholia can make a lookup based on it:

      From 594b679c388ee6d72b38fb496f204a44a321c8c3 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Thu, 2 Sep 2021 00:07:43 -0500 Subject: [PATCH 078/108] Add i18n data attribute to h4 html for gene_empty --- scholia/app/templates/gene_empty.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scholia/app/templates/gene_empty.html b/scholia/app/templates/gene_empty.html index e8f375f53..3f26743f2 100644 --- a/scholia/app/templates/gene_empty.html +++ b/scholia/app/templates/gene_empty.html @@ -16,7 +16,7 @@

      Examples

      -

      Single items

      +

      Single items

      @@ -41,7 +41,7 @@

      Single items

      -

      Redirecting

      +

      Redirecting

      If you know the identifier then Scholia can make a lookup based on the identifier:

      From c6b02ece00b848fea386e1e7597891b7f05b2f48 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Thu, 2 Sep 2021 00:26:24 -0500 Subject: [PATCH 079/108] Add i18n data attribute to html for disease aspect --- scholia/app/templates/disease.html | 6 +++--- scholia/app/templates/disease_empty.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scholia/app/templates/disease.html b/scholia/app/templates/disease.html index e9dea69dd..766e16ea4 100644 --- a/scholia/app/templates/disease.html +++ b/scholia/app/templates/disease.html @@ -19,12 +19,12 @@

      Disease

      -

      Clinical trials

      +

      Clinical trials

      - + Other diseases with reported genetic association via genes or symptom overlap, ordered according to number of co-associated genes and symptoms. @@ -32,7 +32,7 @@ -

      Publications per year

      +

      Publications per year

      diff --git a/scholia/app/templates/disease_empty.html b/scholia/app/templates/disease_empty.html index cfac23eab..b4158b2a9 100644 --- a/scholia/app/templates/disease_empty.html +++ b/scholia/app/templates/disease_empty.html @@ -4,11 +4,11 @@ {% block page_content %} -

      Disease

      +

      Disease

      Diseases. -

      Examples

      +

      Examples

      • Schizophrenia
      • From 4a02d40b392ba6ab264516cc5820861dcd616d16 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Thu, 2 Sep 2021 00:28:51 -0500 Subject: [PATCH 080/108] Add i18n data attribute to html for dataset aspect --- scholia/app/templates/dataset-index.html | 6 +++--- scholia/app/templates/dataset.html | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scholia/app/templates/dataset-index.html b/scholia/app/templates/dataset-index.html index 6bac628c8..f25cf62a0 100644 --- a/scholia/app/templates/dataset-index.html +++ b/scholia/app/templates/dataset-index.html @@ -4,17 +4,17 @@ {% block page_content %} -

        Dataset

        +

        Dataset

        -

        Examples

        +

        Examples

        -

        Single items

        +

        Single items

        diff --git a/scholia/app/templates/dataset.html b/scholia/app/templates/dataset.html index f6e4ae95e..54b261881 100644 --- a/scholia/app/templates/dataset.html +++ b/scholia/app/templates/dataset.html @@ -21,7 +21,7 @@

        Taxon

        -

        Identifiers

        +

        Identifiers

        @@ -29,11 +29,11 @@

        Identifiers

        -

        List of authors

        +

        List of authors

        -

        Topic scores

        +

        Topic scores

        Topics based on a weighting between main subject of work, cited and citing works. @@ -41,7 +41,7 @@

        Topic scores

        -

        Citations to the work

        +

        Citations to the work

        Recent citations to the work From fcfa07253de0d5d7d407de85bd3e45cba6ab607d Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Thu, 2 Sep 2021 00:33:03 -0500 Subject: [PATCH 081/108] Add i18n data attribute to h4 html for complex_empty --- scholia/app/templates/complex_empty.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scholia/app/templates/complex_empty.html b/scholia/app/templates/complex_empty.html index fb38c9a72..14e4a6fe5 100644 --- a/scholia/app/templates/complex_empty.html +++ b/scholia/app/templates/complex_empty.html @@ -22,7 +22,7 @@

        Examples

        -

        Single items

        +

        Single items

        @@ -49,7 +49,7 @@

        Single items

        -

        Redirecting

        +

        Redirecting

        Nothing yet

        From a0f54453cedf71de1fe799dbae72a5f3a7456931 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Thu, 2 Sep 2021 00:36:24 -0500 Subject: [PATCH 082/108] Add i18n data attribute to h4 html for chemical aspect --- scholia/app/templates/chemical-index.html | 6 +++--- scholia/app/templates/chemical_class_empty.html | 4 ++-- scholia/app/templates/chemical_element_empty.html | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scholia/app/templates/chemical-index.html b/scholia/app/templates/chemical-index.html index 7969c65df..dac123b13 100644 --- a/scholia/app/templates/chemical-index.html +++ b/scholia/app/templates/chemical-index.html @@ -24,7 +24,7 @@

        Examples

        -

        Single items

        +

        Single items

        @@ -59,7 +59,7 @@

        Single items

        -

        Redirecting

        +

        Redirecting

        If you know the identifier, then Scholia can make a lookup based on the identifier:

        @@ -84,7 +84,7 @@

        Redirecting

        -

        ChemCuration

        +

        ChemCuration

        There is always more information about chemicals that can be added. This section diff --git a/scholia/app/templates/chemical_class_empty.html b/scholia/app/templates/chemical_class_empty.html index 64c30a4f3..a9b2fcf27 100644 --- a/scholia/app/templates/chemical_class_empty.html +++ b/scholia/app/templates/chemical_class_empty.html @@ -16,7 +16,7 @@

        Examples

        -

        Single items

        +

        Single items

        @@ -40,7 +40,7 @@

        Single items

        -

        Redirecting

        +

        Redirecting

        If you know the identifier then Scholia can make a lookup based on the identifier:

        diff --git a/scholia/app/templates/chemical_element_empty.html b/scholia/app/templates/chemical_element_empty.html index b4696528e..5df17eab6 100644 --- a/scholia/app/templates/chemical_element_empty.html +++ b/scholia/app/templates/chemical_element_empty.html @@ -16,7 +16,7 @@

        Examples

        -

        Single items

        +

        Single items

        @@ -36,7 +36,7 @@

        Single items

        -

        Redirecting

        +

        Redirecting

        Scholia supports redirecting with two chemical element properties:

        From db86b4aa215b75606cff689c5e8915bef59ad9e7 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Thu, 2 Sep 2021 00:37:43 -0500 Subject: [PATCH 083/108] Add i18n data attribute to html for catalogue aspect --- scholia/app/templates/catalogue.html | 4 ++-- scholia/app/templates/catalogue_empty.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scholia/app/templates/catalogue.html b/scholia/app/templates/catalogue.html index cf7010950..dc158c062 100644 --- a/scholia/app/templates/catalogue.html +++ b/scholia/app/templates/catalogue.html @@ -17,12 +17,12 @@

        Catalogue

        -

        Items in catalogue

        +

        Items in catalogue

        -

        Images

        +

        Images

        diff --git a/scholia/app/templates/catalogue_empty.html b/scholia/app/templates/catalogue_empty.html index 23c70074d..cb1e3830b 100644 --- a/scholia/app/templates/catalogue_empty.html +++ b/scholia/app/templates/catalogue_empty.html @@ -4,10 +4,10 @@ {% block page_content %} -

        Catalogue

        +

        Catalogue

        -

        Examples

        +

        Examples

        Dansk Guldalder Maleri
        From 49210005c85de4d436c35a22ae762386df8370f8 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Thu, 2 Sep 2021 00:42:15 -0500 Subject: [PATCH 084/108] Add i18n data attribute to h4 html for author aspect Also fix two attributes collisions adding w# prefix --- scholia/app/templates/author-index.html | 6 +++--- scholia/app/templates/author.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scholia/app/templates/author-index.html b/scholia/app/templates/author-index.html index 00da80141..772277bb9 100644 --- a/scholia/app/templates/author-index.html +++ b/scholia/app/templates/author-index.html @@ -24,7 +24,7 @@

        Author

        -

        Example profiles

        +

        Example profiles

        @@ -70,7 +70,7 @@

        Example profiles

        -

        Comparisons

        +

        Comparisons

        Scholia can show multiple authors together.

        @@ -99,7 +99,7 @@

        Comparisons

        -

        Redirects

        +

        Redirects

        If you know the author by social account or identifier, you can look them up with:

        diff --git a/scholia/app/templates/author.html b/scholia/app/templates/author.html index 8481788db..b990856e0 100644 --- a/scholia/app/templates/author.html +++ b/scholia/app/templates/author.html @@ -82,7 +82,7 @@

        Number of pages

        -

        Topics

        +

        Topics

        Topic scores

        @@ -95,7 +95,7 @@

        Topic scores

        -

        Topics of authored works

        +

        Topics of authored works

        From 7dae80b436270894690cfb29ac1afb64b138d8e8 Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Thu, 2 Sep 2021 00:44:17 -0500 Subject: [PATCH 085/108] Add i18n data attribute to html for arxiv aspect --- scholia/app/templates/arxiv_to_quickstatements.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scholia/app/templates/arxiv_to_quickstatements.html b/scholia/app/templates/arxiv_to_quickstatements.html index 8ac1f2e1c..499aa7c99 100644 --- a/scholia/app/templates/arxiv_to_quickstatements.html +++ b/scholia/app/templates/arxiv_to_quickstatements.html @@ -3,10 +3,10 @@ {% block page_content %} -

        arXiv to QuickStatements

        +

        arXiv to QuickStatements

        -

        Input

        +

        Input

        @@ -30,7 +30,7 @@

        Input

        ID is found in Wikidata. However, note that new items may not be immediately found because of caching. -

        Result

        +

        Result

        {% if q %} From 59356a1ff2222ad7ce1f211f975264a80c786ebc Mon Sep 17 00:00:00 2001 From: Cesar Uribe Date: Thu, 2 Sep 2021 00:45:55 -0500 Subject: [PATCH 086/108] Add i18n data attribute to html for about aspect --- scholia/app/templates/about.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scholia/app/templates/about.html b/scholia/app/templates/about.html index ad8a63dac..c3e595fd2 100644 --- a/scholia/app/templates/about.html +++ b/scholia/app/templates/about.html @@ -3,7 +3,7 @@ {% block page_content %}

        About

        -

        Background reading

        +

        Background reading

        -

        FAQ

        +

        FAQ

        -

        Presentations

        +

        Presentations

        • Scholia. @@ -30,7 +30,7 @@

          Presentations

        -

        Acknowledgment

        +

        Acknowledgment

        • Scholia has received funding from:
          @@ -47,7 +47,7 @@

          Acknowledgment

        -

        Technical acknowledgement

        +

        Technical acknowledgement

        -

        Citation

        +

        Citation

         @InProceedings{NielsenF2017Scholia,
        
        From 3609793b070d6a594727552c82f2a05cf7fd3869 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Thu, 2 Sep 2021 00:46:45 -0500
        Subject: [PATCH 087/108] Add i18n data attribute to html for 404_doi aspect
        
        ---
         scholia/app/templates/404_doi.html | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/scholia/app/templates/404_doi.html b/scholia/app/templates/404_doi.html
        index 0305cdb34..ba8d37f96 100644
        --- a/scholia/app/templates/404_doi.html
        +++ b/scholia/app/templates/404_doi.html
        @@ -32,7 +32,7 @@
         
         We found no work in Wikidata with the DOI {{ doi }}. If you would like to create the item for this work, you can use the QuickStatements tool by clicking the "Submit to QuickStatements" button (this requires authentication via OAuth 2.0). Thank you for helping to curate this information.
         
        -

        QuickStatements

        +

        QuickStatements

        
         
        
        From 0f010a3d0fa22d62070e491f6be8da5cf94fb21c Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Thu, 2 Sep 2021 18:27:56 -0500
        Subject: [PATCH 088/108] add lang-cookie in filter-lang to sparql author(s)
         aspect
        
        ---
         scholia/app/templates/author_events.sparql             |  2 +-
         .../app/templates/author_list-of-publications.sparql   |  4 ++--
         scholia/app/templates/author_other-locations.sparql    |  2 +-
         scholia/app/templates/author_pages-per-year.sparql     |  2 +-
         scholia/app/templates/author_review-statistics.sparql  |  2 +-
         scholia/app/templates/author_timeline.sparql           | 10 +++++-----
         .../app/templates/author_venue-statistics-chart.sparql |  2 +-
         scholia/app/templates/author_venue-statistics.sparql   |  2 +-
         .../authors_citations-per-publication-year.sparql      |  2 +-
         .../authors_list-of-jointly-authored-works.sparql      |  2 +-
         .../authors_works-per-publication-year.sparql          |  2 +-
         11 files changed, 16 insertions(+), 16 deletions(-)
        
        diff --git a/scholia/app/templates/author_events.sparql b/scholia/app/templates/author_events.sparql
        index 91a60b1b2..ce01be866 100644
        --- a/scholia/app/templates/author_events.sparql
        +++ b/scholia/app/templates/author_events.sparql
        @@ -25,7 +25,7 @@ WHERE {
               ?event wdt:P5804 ?person .
               BIND("program committee member" AS ?role)
             }
        -    OPTIONAL { ?event wdt:P276 ?location . ?location rdfs:label ?location_label . FILTER (LANG(?location_label) = 'en')}
        +    OPTIONAL { ?event wdt:P276 ?location . ?location rdfs:label ?location_label . FILTER (LANG(?location_label) = '{{ g.lang_code }}')}
             OPTIONAL { ?event wdt:P580 | wdt:P585 ?start }
          
             SERVICE wikibase:label { bd:serviceParam wikibase:language "{{ g.lang_code }},[AUTO_LANGUAGE],en,da,de,es,fr,jp,no,ru,sv,zh". }
        diff --git a/scholia/app/templates/author_list-of-publications.sparql b/scholia/app/templates/author_list-of-publications.sparql
        index c4b54e550..a5f8463ef 100644
        --- a/scholia/app/templates/author_list-of-publications.sparql
        +++ b/scholia/app/templates/author_list-of-publications.sparql
        @@ -11,10 +11,10 @@ WHERE {
           ?work wdt:P50 wd:{{ q }} .
           ?work wdt:P50 ?author .
           OPTIONAL {
        -    ?author rdfs:label ?author_label_ . FILTER (LANG(?author_label_) = 'en')
        +    ?author rdfs:label ?author_label_ . FILTER (LANG(?author_label_) = '{{ g.lang_code }}')
           }
           BIND(COALESCE(?author_label_, SUBSTR(STR(?author), 32)) AS ?author_label)
        -  OPTIONAL { ?work wdt:P31 ?type_ . ?type_ rdfs:label ?type_label . FILTER (LANG(?type_label) = 'en') }
        +  OPTIONAL { ?work wdt:P31 ?type_ . ?type_ rdfs:label ?type_label . FILTER (LANG(?type_label) = '{{ g.lang_code }}') }
           ?work wdt:P577 ?datetimes .
           BIND(xsd:date(?datetimes) AS ?dates)
           OPTIONAL { ?work wdt:P1104 ?pages_ }
        diff --git a/scholia/app/templates/author_other-locations.sparql b/scholia/app/templates/author_other-locations.sparql
        index 876837a7c..b527671b0 100644
        --- a/scholia/app/templates/author_other-locations.sparql
        +++ b/scholia/app/templates/author_other-locations.sparql
        @@ -8,5 +8,5 @@ WHERE {
           SERVICE wikibase:label { bd:serviceParam wikibase:language "{{ g.lang_code }},[AUTO_LANGUAGE],en,da,de,es,fr,jp,nl,no,ru,sv,zh". }
           
           # No automatic labeling on the property, - for some reason.
        -  ?property_item rdfs:label ?property_item_label . FILTER(LANG(?property_item_label) = 'en')
        +  ?property_item rdfs:label ?property_item_label . FILTER(LANG(?property_item_label) = '{{ g.lang_code }}')
         }
        diff --git a/scholia/app/templates/author_pages-per-year.sparql b/scholia/app/templates/author_pages-per-year.sparql
        index f3d567551..35b3175e6 100644
        --- a/scholia/app/templates/author_pages-per-year.sparql
        +++ b/scholia/app/templates/author_pages-per-year.sparql
        @@ -21,7 +21,7 @@ select ?year ?number_of_pages ?work_label where {
                 ?work wdt:P50 wd:{{ q }} .
                 ?work wdt:P1104 ?pages .
                 ?work wdt:P577 ?date . 
        -        ?work rdfs:label ?long_work_label . filter(lang(?long_work_label) = 'en')
        +        ?work rdfs:label ?long_work_label . filter(lang(?long_work_label) = '{{ g.lang_code }}')
                 bind(substr(?long_work_label, 1, 20) as ?work_label)
                 bind(str(year(?date)) as ?year) 
               }
        diff --git a/scholia/app/templates/author_review-statistics.sparql b/scholia/app/templates/author_review-statistics.sparql
        index 852e25b79..5c4122bd3 100644
        --- a/scholia/app/templates/author_review-statistics.sparql
        +++ b/scholia/app/templates/author_review-statistics.sparql
        @@ -14,7 +14,7 @@ WITH {
             ?work wdt:P1433 ?venue .
             OPTIONAL {
               ?venue wdt:P921 ?topic .
        -      ?topic rdfs:label ?topic_label . FILTER(LANG(?topic_label) = 'en') }
        +      ?topic rdfs:label ?topic_label . FILTER(LANG(?topic_label) = '{{ g.lang_code }}') }
           }
           GROUP BY ?venue
         } AS %result
        diff --git a/scholia/app/templates/author_timeline.sparql b/scholia/app/templates/author_timeline.sparql
        index e605529e2..532abbc71 100644
        --- a/scholia/app/templates/author_timeline.sparql
        +++ b/scholia/app/templates/author_timeline.sparql
        @@ -56,14 +56,14 @@ WHERE {
             wd:{{ q }} p:P69 ?education_statement .
             ?education_statement ps:P69 ?education .
             ?education rdfs:label ?education_label . 
        -    FILTER (lang(?education_label) = 'en')
        +    FILTER (lang(?education_label) = '{{ g.lang_code }}')
             BIND(CONCAT("🦉 ", ?education_label) AS ?label)
             OPTIONAL { ?education_statement pq:P580 ?beginning . }
             OPTIONAL { ?education_statement pq:P582 ?ending . }
             OPTIONAL {
               ?education_statement pq:P512 ?education_degree . 
               ?education_degree rdfs:label ?education_degree_label .
        -      FILTER (lang(?education_degree_label) = 'en')
        +      FILTER (lang(?education_degree_label) = '{{ g.lang_code }}')
             }
           }
           UNION
        @@ -72,7 +72,7 @@ WHERE {
             wd:{{ q }} p:P1416 | p:P108 ?affiliation_statement .
             ?affiliation_statement ps:P1416 | ps:P108 ?affiliation .
             ?affiliation rdfs:label ?affiliation_label .
        -    FILTER (lang(?affiliation_label) = 'en')
        +    FILTER (lang(?affiliation_label) = '{{ g.lang_code }}')
             BIND(CONCAT("🏠 ",?affiliation_label) AS ?label)
             # OPTIONAL { ?affiliation wdt:P18 ?image }
             OPTIONAL { ?affiliation_statement pq:P580 ?beginning . }
        @@ -80,7 +80,7 @@ WHERE {
             OPTIONAL {
               ?affiliation_statement pq:P512 ?affiliation_degree . 
               ?affiliation_degree rdfs:label ?affiliation_degree_label .
        -      FILTER (lang(?affiliation_degree_label) = 'en')
        +      FILTER (lang(?affiliation_degree_label) = '{{ g.lang_code }}')
             }
           }
           UNION
        @@ -88,7 +88,7 @@ WHERE {
             wd:{{ q }} p:P166 ?award_statement . 
             ?award_statement ps:P166 ?award .
             ?award rdfs:label ?award_label .
        -    FILTER (lang(?award_label) = 'en')
        +    FILTER (lang(?award_label) = '{{ g.lang_code }}')
             BIND(CONCAT("🏆 ",?award_label) AS ?label)
             ?award_statement pq:P585 ?beginning .
           }
        diff --git a/scholia/app/templates/author_venue-statistics-chart.sparql b/scholia/app/templates/author_venue-statistics-chart.sparql
        index 166ca898a..e78ae455b 100644
        --- a/scholia/app/templates/author_venue-statistics-chart.sparql
        +++ b/scholia/app/templates/author_venue-statistics-chart.sparql
        @@ -9,7 +9,7 @@ WITH {
         } AS %counts
         WHERE {
           INCLUDE %counts
        -  ?venue rdfs:label ?long_venue_label FILTER(LANG(?long_venue_label) = 'en')
        +  ?venue rdfs:label ?long_venue_label FILTER(LANG(?long_venue_label) = '{{ g.lang_code }}')
           OPTIONAL { ?venue wdt:P1813 ?short_name . }
           BIND(COALESCE(?short_name, ?long_venue_label) AS ?venue_label_)
         }
        diff --git a/scholia/app/templates/author_venue-statistics.sparql b/scholia/app/templates/author_venue-statistics.sparql
        index 4cbdf85eb..79e007bf5 100644
        --- a/scholia/app/templates/author_venue-statistics.sparql
        +++ b/scholia/app/templates/author_venue-statistics.sparql
        @@ -14,7 +14,7 @@ WITH {
             ?work wdt:P1433 ?venue .
             OPTIONAL {
               ?venue wdt:P921 ?topic .
        -      ?topic rdfs:label ?topic_label . FILTER(LANG(?topic_label) = 'en') }
        +      ?topic rdfs:label ?topic_label . FILTER(LANG(?topic_label) = '{{ g.lang_code }}') }
           }
           GROUP BY ?venue
         } AS %result
        diff --git a/scholia/app/templates/authors_citations-per-publication-year.sparql b/scholia/app/templates/authors_citations-per-publication-year.sparql
        index fd7953f8e..14bfe1790 100644
        --- a/scholia/app/templates/authors_citations-per-publication-year.sparql
        +++ b/scholia/app/templates/authors_citations-per-publication-year.sparql
        @@ -15,7 +15,7 @@ SELECT ?year ?number_of_citations ?author_label WHERE {
                 GROUP BY ?author ?year 
               } 
               ?author rdfs:label ?author_label_ .
        -      FILTER (LANG(?author_label_) = 'en')
        +      FILTER (LANG(?author_label_) = '{{ g.lang_code }}')
             }
           }
           # Represent the author by name and Q identifier
        diff --git a/scholia/app/templates/authors_list-of-jointly-authored-works.sparql b/scholia/app/templates/authors_list-of-jointly-authored-works.sparql
        index 0319f4491..baaa319df 100644
        --- a/scholia/app/templates/authors_list-of-jointly-authored-works.sparql
        +++ b/scholia/app/templates/authors_list-of-jointly-authored-works.sparql
        @@ -11,7 +11,7 @@ WITH {
           {
             VALUES ?author { {% for q in qs %} wd:{{ q }} {% endfor %} }
             ?work wdt:P50 ?author .
        -    OPTIONAL { ?author rdfs:label ?author_label . FILTER(LANG(?author_label) = 'en') }
        +    OPTIONAL { ?author rdfs:label ?author_label . FILTER(LANG(?author_label) = '{{ g.lang_code }}') }
           }
           GROUP BY ?work
           HAVING(?coauthor_count > 1)
        diff --git a/scholia/app/templates/authors_works-per-publication-year.sparql b/scholia/app/templates/authors_works-per-publication-year.sparql
        index 16ccb2dd1..457e12a2d 100644
        --- a/scholia/app/templates/authors_works-per-publication-year.sparql
        +++ b/scholia/app/templates/authors_works-per-publication-year.sparql
        @@ -14,7 +14,7 @@ SELECT ?year ?number_of_works ?author_label WHERE {
                 GROUP BY ?author ?year 
               } 
               ?author rdfs:label ?author_label_ .
        -      FILTER (LANG(?author_label_) = 'en')
        +      FILTER (LANG(?author_label_) = '{{ g.lang_code }}')
             }
           }
           # Represent the author by name and Q identifier
        
        From fb1975ab94b1a9a117a5c7076890653ef4cc030c Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Thu, 2 Sep 2021 19:00:43 -0500
        Subject: [PATCH 089/108] add lang-cookie in filter-lang to sparql award aspect
        
        ---
         scholia/app/templates/award_locations-of-recipients.sparql | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/scholia/app/templates/award_locations-of-recipients.sparql b/scholia/app/templates/award_locations-of-recipients.sparql
        index 9d104d8bf..e2e9cb4b1 100644
        --- a/scholia/app/templates/award_locations-of-recipients.sparql
        +++ b/scholia/app/templates/award_locations-of-recipients.sparql
        @@ -6,7 +6,7 @@ WITH {
             ?recipient ?property ?item . 
             ?item wdt:P625 ?geo .
             ?property_item wikibase:directClaim ?property .
        -    ?property_item rdfs:label ?property_item_label . FILTER (LANG(?property_item_label) = 'en')
        +    ?property_item rdfs:label ?property_item_label . FILTER (LANG(?property_item_label) = '{{ g.lang_code }}')
             OPTIONAL { ?item wdt:P18 ?image . }
           }
         } AS %result
        
        From c5db12c7699c92499fcb1b25ac560cf236746515 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:02:24 -0500
        Subject: [PATCH 090/108] add lang-cookie in filter-lang to sparql chemical
         aspect
        
        ---
         .../app/templates/chemical_class_recent-literature.sparql   | 4 ++--
         .../app/templates/chemical_element_recent-literature.sparql | 4 ++--
         scholia/app/templates/chemical_physchem-properties.sparql   | 6 +++---
         scholia/app/templates/chemical_recent-literature.sparql     | 4 ++--
         4 files changed, 9 insertions(+), 9 deletions(-)
        
        diff --git a/scholia/app/templates/chemical_class_recent-literature.sparql b/scholia/app/templates/chemical_class_recent-literature.sparql
        index 8e473d057..cb75681af 100644
        --- a/scholia/app/templates/chemical_class_recent-literature.sparql
        +++ b/scholia/app/templates/chemical_class_recent-literature.sparql
        @@ -26,9 +26,9 @@ WITH {
           SELECT (MAX(?dates) as ?datetime) ?work (GROUP_CONCAT(DISTINCT ?type_label; separator=", ") AS ?type) ?via (GROUP_CONCAT(DISTINCT ?topic_label; separator=" // ") AS ?topics) WHERE {
             INCLUDE %works
             ?work wdt:P921 ?topic . 
        -    OPTIONAL { ?work wdt:P31 ?type_ . ?type_ rdfs:label ?type_label . FILTER (LANG(?type_label) = 'en') }
        +    OPTIONAL { ?work wdt:P31 ?type_ . ?type_ rdfs:label ?type_label . FILTER (LANG(?type_label) = '{{ g.lang_code }}') }
             OPTIONAL { ?work wdt:P577 ?dates . }
        -    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = 'en')
        +    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?work ?via
         } AS %result
        diff --git a/scholia/app/templates/chemical_element_recent-literature.sparql b/scholia/app/templates/chemical_element_recent-literature.sparql
        index d509bd732..e70df17e2 100644
        --- a/scholia/app/templates/chemical_element_recent-literature.sparql
        +++ b/scholia/app/templates/chemical_element_recent-literature.sparql
        @@ -14,9 +14,9 @@ WITH {
           SELECT (MAX(?dates) as ?datetime) ?work (GROUP_CONCAT(DISTINCT ?type_label; separator=", ") AS ?type) (GROUP_CONCAT(DISTINCT ?topic_label; separator=" // ") AS ?topics) WHERE {
             INCLUDE %works
             ?work wdt:P921 ?topic . 
        -    OPTIONAL { ?work wdt:P31 ?type_ . ?type_ rdfs:label ?type_label . FILTER (LANG(?type_label) = 'en') }
        +    OPTIONAL { ?work wdt:P31 ?type_ . ?type_ rdfs:label ?type_label . FILTER (LANG(?type_label) = '{{ g.lang_code }}') }
             OPTIONAL { ?work wdt:P577 ?dates . }
        -    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = 'en')
        +    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?work
         } AS %result
        diff --git a/scholia/app/templates/chemical_physchem-properties.sparql b/scholia/app/templates/chemical_physchem-properties.sparql
        index 39b192297..162e7e038 100644
        --- a/scholia/app/templates/chemical_physchem-properties.sparql
        +++ b/scholia/app/templates/chemical_physchem-properties.sparql
        @@ -19,16 +19,16 @@ WITH {
             OPTIONAL {
               {
                 ?qualifierProp wikibase:qualifier ?qualifier ;
        -                       rdfs:label ?qProplabel; FILTER (lang(?qProplabel) = "en") .
        +                       rdfs:label ?qProplabel; FILTER (lang(?qProplabel) = '{{ g.lang_code }}') .
                 ?qualifier a owl:DatatypeProperty .
                 ?statement ?qualifier ?qualifierVal .
                 BIND (CONCAT(str(?qProplabel), ": ", str(?qualifierVal)) AS ?qualifierStr)
               } UNION {
                 ?qualifierProp wikibase:qualifier ?qualifier ;
        -                       rdfs:label ?qProplabel; FILTER (lang(?qProplabel) = "en") .
        +                       rdfs:label ?qProplabel; FILTER (lang(?qProplabel) = '{{ g.lang_code }}') .
                 ?qualifier a owl:ObjectProperty .
                 ?statement ?qualifier ?qualifierVal .
        -        ?qualifierVal rdfs:label ?qVallabel; FILTER (lang(?qVallabel) = "en") .
        +        ?qualifierVal rdfs:label ?qVallabel; FILTER (lang(?qVallabel) = '{{ g.lang_code }}') .
                 BIND (CONCAT(str(?qProplabel), ": ", str(?qVallabel)) AS ?qualifierStr)
               }
             }
        diff --git a/scholia/app/templates/chemical_recent-literature.sparql b/scholia/app/templates/chemical_recent-literature.sparql
        index f18d67ac1..1d5c1ac2d 100644
        --- a/scholia/app/templates/chemical_recent-literature.sparql
        +++ b/scholia/app/templates/chemical_recent-literature.sparql
        @@ -23,9 +23,9 @@ WITH {
           SELECT (MAX(?dates) as ?datetime) ?work (GROUP_CONCAT(DISTINCT ?type_label; separator=", ") AS ?type) ?via (GROUP_CONCAT(DISTINCT ?topic_label; separator=" // ") AS ?topics) WHERE {
             INCLUDE %works
             ?work wdt:P921 ?topic . 
        -    OPTIONAL { ?work wdt:P31 ?type_ . ?type_ rdfs:label ?type_label . FILTER (LANG(?type_label) = 'en') }
        +    OPTIONAL { ?work wdt:P31 ?type_ . ?type_ rdfs:label ?type_label . FILTER (LANG(?type_label) = '{{ g.lang_code }}') }
             OPTIONAL { ?work wdt:P577 ?dates . }
        -    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = 'en')
        +    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?work ?via
         } AS %result
        
        From 47c7d46bd87c5d24d753f16cc07ee0faa1fbcf29 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:05:45 -0500
        Subject: [PATCH 091/108] add lang-cookie in filter-lang to sparql
         clinical-trial aspect
        
        ---
         scholia/app/templates/clinical-trial_data.sparql | 8 ++++----
         1 file changed, 4 insertions(+), 4 deletions(-)
        
        diff --git a/scholia/app/templates/clinical-trial_data.sparql b/scholia/app/templates/clinical-trial_data.sparql
        index 912c07301..24f18803a 100644
        --- a/scholia/app/templates/clinical-trial_data.sparql
        +++ b/scholia/app/templates/clinical-trial_data.sparql
        @@ -20,7 +20,7 @@ WHERE {
         
             BIND(SUBSTR(STR(?iri), 32) AS ?q) 
             ?iri rdfs:label ?value_string . 
        -    FILTER (LANG(?value_string) = 'en')
        +    FILTER (LANG(?value_string) = '{{ g.lang_code }}')
             BIND(COALESCE(?value_string, ?q) AS ?value)
             BIND(CONCAT("../topic/", ?q) AS ?valueUrl)
           }
        @@ -32,7 +32,7 @@ WHERE {
         
             BIND(SUBSTR(STR(?iri), 32) AS ?q) 
             ?iri rdfs:label ?value_string . 
        -    FILTER (LANG(?value_string) = 'en')
        +    FILTER (LANG(?value_string) = '{{ g.lang_code }}')
             BIND(COALESCE(?value_string, ?q) AS ?value)
             BIND(CONCAT("../disease/", ?q) AS ?valueUrl)
           }
        @@ -44,7 +44,7 @@ WHERE {
         
             BIND(SUBSTR(STR(?iri), 32) AS ?q) 
             ?iri rdfs:label ?value_string . 
        -    FILTER (LANG(?value_string) = 'en')
        +    FILTER (LANG(?value_string) = '{{ g.lang_code }}')
             BIND(COALESCE(?value_string, ?q) AS ?value)
             BIND(CONCAT("../topic/", ?q) AS ?valueUrl)
           }
        @@ -56,7 +56,7 @@ WHERE {
         
             BIND(SUBSTR(STR(?iri), 32) AS ?q) 
             ?iri rdfs:label ?value_string . 
        -    FILTER (LANG(?value_string) = 'en')
        +    FILTER (LANG(?value_string) = '{{ g.lang_code }}')
             BIND(COALESCE(?value_string, ?q) AS ?value)
             BIND(CONCAT("../sponsor/", ?q) AS ?valueUrl)
           }
        
        From 1b0a1e9bd37d72b991a88c11347e406a20e98d87 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:07:17 -0500
        Subject: [PATCH 092/108] add lang-cookie in filter-lang to sparql complex
         aspect
        
        ---
         scholia/app/templates/complex_articles-by-year.sparql | 2 +-
         scholia/app/templates/complex_articles-recent.sparql  | 2 +-
         scholia/app/templates/complex_participants.sparql     | 2 +-
         3 files changed, 3 insertions(+), 3 deletions(-)
        
        diff --git a/scholia/app/templates/complex_articles-by-year.sparql b/scholia/app/templates/complex_articles-by-year.sparql
        index 32c9d8558..e30bd7d06 100644
        --- a/scholia/app/templates/complex_articles-by-year.sparql
        +++ b/scholia/app/templates/complex_articles-by-year.sparql
        @@ -37,7 +37,7 @@ WITH {
         WHERE {
           {
             INCLUDE %works
        -    ?article_type rdfs:label ?type . FILTER (LANG(?type) = "en")
        +    ?article_type rdfs:label ?type . FILTER (LANG(?type) = '{{ g.lang_code }}')
           }
           UNION
           {
        diff --git a/scholia/app/templates/complex_articles-recent.sparql b/scholia/app/templates/complex_articles-recent.sparql
        index 6237c2978..ffaadf794 100644
        --- a/scholia/app/templates/complex_articles-recent.sparql
        +++ b/scholia/app/templates/complex_articles-recent.sparql
        @@ -14,7 +14,7 @@ WITH {
             INCLUDE %works
             ?work wdt:P921 ?topic . 
             OPTIONAL { ?work wdt:P577 ?dates . }
        -    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = 'en')
        +    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?work
         } AS %result
        diff --git a/scholia/app/templates/complex_participants.sparql b/scholia/app/templates/complex_participants.sparql
        index 907fd5494..ce772b190 100644
        --- a/scholia/app/templates/complex_participants.sparql
        +++ b/scholia/app/templates/complex_participants.sparql
        @@ -9,7 +9,7 @@ WITH {
             OPTIONAL { 
               ?part wdt:P31 ?type_ .
               ?type_ rdfs:label ?type_label .
        -      FILTER (LANG(?type_label) = 'en')
        +      FILTER (LANG(?type_label) = '{{ g.lang_code }}')
             }
           } GROUP BY ?part ?quantity 
         } AS %result
        
        From d40221074c0177c616ed57bf16de57c035f83093 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:25:12 -0500
        Subject: [PATCH 093/108] add lang-cookie in filter-lang to sparql country
         aspect
        
        ---
         scholia/app/templates/country_locations-as-topics.sparql | 2 +-
         scholia/app/templates/country_narrative-locations.sparql | 2 +-
         2 files changed, 2 insertions(+), 2 deletions(-)
        
        diff --git a/scholia/app/templates/country_locations-as-topics.sparql b/scholia/app/templates/country_locations-as-topics.sparql
        index 3dda86439..a10f5f72d 100644
        --- a/scholia/app/templates/country_locations-as-topics.sparql
        +++ b/scholia/app/templates/country_locations-as-topics.sparql
        @@ -23,7 +23,7 @@ WHERE {
           # Move here for speed of query
           OPTIONAL {
             ?work wdt:P31 / rdfs:label ?layer . 
        -    FILTER (LANG(?layer) = 'en')
        +    FILTER (LANG(?layer) = '{{ g.lang_code }}')
           }
           
           SERVICE wikibase:label { bd:serviceParam wikibase:language "{{ g.lang_code }},[AUTO_LANGUAGE],en,da,de,es,fr,jp,nl,no,ru,sv,zh". }
        diff --git a/scholia/app/templates/country_narrative-locations.sparql b/scholia/app/templates/country_narrative-locations.sparql
        index 6771e2649..b8c53a70c 100644
        --- a/scholia/app/templates/country_narrative-locations.sparql
        +++ b/scholia/app/templates/country_narrative-locations.sparql
        @@ -16,7 +16,7 @@ WITH {
             # Filter encyclopedic articles - that may not be so relevant
             FILTER NOT EXISTS { ?work wdt:P31 wd:Q17329259 }
         
        -    OPTIONAL { ?work wdt:P31 / rdfs:label ?layer . FILTER (LANG(?layer) = 'en') }
        +    OPTIONAL { ?work wdt:P31 / rdfs:label ?layer . FILTER (LANG(?layer) = '{{ g.lang_code }}') }
           }
         } AS %results
         WHERE {
        
        From f4dc1c77c6bb6ab0a478fda9e71b0be0dec93fe0 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:26:06 -0500
        Subject: [PATCH 094/108] add lang-cookie in filter-lang to sparql dataset
         aspect
        
        ---
         scholia/app/templates/dataset_list-of-authors.sparql | 4 ++--
         1 file changed, 2 insertions(+), 2 deletions(-)
        
        diff --git a/scholia/app/templates/dataset_list-of-authors.sparql b/scholia/app/templates/dataset_list-of-authors.sparql
        index 7f6bb62bf..db20a0256 100644
        --- a/scholia/app/templates/dataset_list-of-authors.sparql
        +++ b/scholia/app/templates/dataset_list-of-authors.sparql
        @@ -14,7 +14,7 @@ WHERE {
             wd:{{ q }} p:P50 ?author_statement .
             ?author_statement ps:P50 ?author_ .
             ?author_ rdfs:label ?author .
        -    FILTER (LANG(?author) = 'en')
        +    FILTER (LANG(?author) = '{{ g.lang_code }}')
             BIND(CONCAT("../author/", SUBSTR(STR(?author_), 32)) AS ?authorUrl)
             OPTIONAL {
               ?author_statement pq:P1545 ?order_ .
        @@ -25,7 +25,7 @@ WHERE {
             BIND(COALESCE(?orcid_, CONCAT("orcid-search/quick-search/?searchQuery=", ENCODE_FOR_URI(?author))) AS ?orcid)
             OPTIONAL {
               ?author_ schema:description ?authorDescription .
        -      FILTER (LANG(?authorDescription) = "en")
        +      FILTER (LANG(?authorDescription) = '{{ g.lang_code }}')
             }
           }
           UNION
        
        From a887065b428c35e484334df44efb1aa7ccc55805 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:26:55 -0500
        Subject: [PATCH 095/108] add lang-cookie in filter-lang to sparql disease
         aspect
        
        ---
         scholia/app/templates/disease_related-diseases.sparql | 4 ++--
         1 file changed, 2 insertions(+), 2 deletions(-)
        
        diff --git a/scholia/app/templates/disease_related-diseases.sparql b/scholia/app/templates/disease_related-diseases.sparql
        index 935dc50eb..2d30060b8 100644
        --- a/scholia/app/templates/disease_related-diseases.sparql
        +++ b/scholia/app/templates/disease_related-diseases.sparql
        @@ -12,7 +12,7 @@ SELECT
               ?gene wdt:P2293 ?disease . 
               FILTER (wd:{{ q }} != ?disease)
               ?gene rdfs:label ?gene_label
        -      FILTER(lang(?gene_label) = "en")
        +      FILTER(lang(?gene_label) = '{{ g.lang_code }}')
             }
             GROUP BY ?disease
           }
        @@ -24,7 +24,7 @@ SELECT
               wd:{{ q }} wdt:P780 ?symptom .
               ?disease wdt:P780 ?symptom . 
               FILTER (wd:{{ q }} != ?disease)
        -      ?symptom rdfs:label ?symptom_label . FILTER(lang(?symptom_label) = "en")
        +      ?symptom rdfs:label ?symptom_label . FILTER(lang(?symptom_label) = '{{ g.lang_code }}')
             }
             GROUP BY ?disease
           }
        
        From 34bd9a118e5c6efefef0dcce6fc4438ea78b6e33 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:28:52 -0500
        Subject: [PATCH 096/108] add lang-cookie in filter-lang to sparql event aspect
        
        ---
         scholia/app/templates/event_proceedings.sparql                | 4 ++--
         scholia/app/templates/event_recent-publications.sparql        | 2 +-
         .../templates/event_series_proceedings-publications.sparql    | 4 ++--
         scholia/app/templates/event_series_recent-publications.sparql | 2 +-
         scholia/app/templates/event_series_timeline.sparql            | 2 +-
         5 files changed, 7 insertions(+), 7 deletions(-)
        
        diff --git a/scholia/app/templates/event_proceedings.sparql b/scholia/app/templates/event_proceedings.sparql
        index 3bb8cb689..fb0502c1a 100644
        --- a/scholia/app/templates/event_proceedings.sparql
        +++ b/scholia/app/templates/event_proceedings.sparql
        @@ -14,11 +14,11 @@ WITH {
             ?work wdt:P1433 / wdt:P4745 wd:{{ q }} .
             OPTIONAL {
               ?work wdt:P50 ?author .
        -      ?author rdfs:label ?author_label . FILTER(LANG(?author_label) = "en")
        +      ?author rdfs:label ?author_label . FILTER(LANG(?author_label) = '{{ g.lang_code }}')
             }
             OPTIONAL {
               ?work wdt:P921 ?topic .
        -      ?topic rdfs:label ?topic_label . FILTER(LANG(?topic_label) = "en")
        +      ?topic rdfs:label ?topic_label . FILTER(LANG(?topic_label) = '{{ g.lang_code }}')
             }
           }
           GROUP BY ?work
        diff --git a/scholia/app/templates/event_recent-publications.sparql b/scholia/app/templates/event_recent-publications.sparql
        index 1ca23be69..050fdfd3d 100644
        --- a/scholia/app/templates/event_recent-publications.sparql
        +++ b/scholia/app/templates/event_recent-publications.sparql
        @@ -37,7 +37,7 @@ WITH {
           WHERE {
             INCLUDE %people .
             ?work wdt:P50 ?person ; wdt:P577 ?publication_datetime .
        -    ?person rdfs:label ?person_label . FILTER(LANG(?person_label) = 'en')
        +    ?person rdfs:label ?person_label . FILTER(LANG(?person_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?work
         } AS %results
        diff --git a/scholia/app/templates/event_series_proceedings-publications.sparql b/scholia/app/templates/event_series_proceedings-publications.sparql
        index 5d5f8ca1a..973a60f57 100644
        --- a/scholia/app/templates/event_series_proceedings-publications.sparql
        +++ b/scholia/app/templates/event_series_proceedings-publications.sparql
        @@ -19,11 +19,11 @@ WITH {
             }
             OPTIONAL {
               ?work wdt:P50 ?author .
        -      ?author rdfs:label ?author_label . FILTER(LANG(?author_label) = "en")
        +      ?author rdfs:label ?author_label . FILTER(LANG(?author_label) = '{{ g.lang_code }}')
             }
             OPTIONAL {
               ?work wdt:P921 ?topic .
        -      ?topic rdfs:label ?topic_label . FILTER(LANG(?topic_label) = "en")
        +      ?topic rdfs:label ?topic_label . FILTER(LANG(?topic_label) = '{{ g.lang_code }}')
             }
           }
           GROUP BY ?work
        diff --git a/scholia/app/templates/event_series_recent-publications.sparql b/scholia/app/templates/event_series_recent-publications.sparql
        index 367dc3b88..9947bdfa0 100644
        --- a/scholia/app/templates/event_series_recent-publications.sparql
        +++ b/scholia/app/templates/event_series_recent-publications.sparql
        @@ -38,7 +38,7 @@ WITH {
           WHERE {
             INCLUDE %people .
             ?work wdt:P50 ?person ; wdt:P577 ?publication_datetime .
        -    ?person rdfs:label ?person_label . FILTER(LANG(?person_label) = 'en')
        +    ?person rdfs:label ?person_label . FILTER(LANG(?person_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?work
         } AS %results
        diff --git a/scholia/app/templates/event_series_timeline.sparql b/scholia/app/templates/event_series_timeline.sparql
        index 2824e7823..2b93a2ca6 100644
        --- a/scholia/app/templates/event_series_timeline.sparql
        +++ b/scholia/app/templates/event_series_timeline.sparql
        @@ -29,7 +29,7 @@ WITH {
             ?event p:P793 [ ps:P793 ?item ; pq:P585 ?time ] .
             OPTIONAL {
               ?item rdfs:label ?description .
        -      FILTER (LANG(?description) = "en")
        +      FILTER (LANG(?description) = '{{ g.lang_code }}')
             }
           }
         } AS %events2
        
        From 981d1d4e79e19499427cf7ad5b6bc4846f694877 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:29:51 -0500
        Subject: [PATCH 097/108] add lang-cookie in filter-lang to sparql gene aspect
        
        ---
         scholia/app/templates/gene_variants.sparql | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        
        diff --git a/scholia/app/templates/gene_variants.sparql b/scholia/app/templates/gene_variants.sparql
        index 5454e0245..e7e9b9f7a 100644
        --- a/scholia/app/templates/gene_variants.sparql
        +++ b/scholia/app/templates/gene_variants.sparql
        @@ -12,7 +12,7 @@ WITH {
             INCLUDE %variants
             OPTIONAL {
               ?variant wdt:P279 ?variantType . 
        -      ?variantType rdfs:label ?type_label .  FILTER (lang(?type_label) = 'en')
        +      ?variantType rdfs:label ?type_label .  FILTER (lang(?type_label) = '{{ g.lang_code }}')
             }
           }
           GROUP BY ?variant
        
        From f521aae1055c7285b79e910b39368bf50dfcbaa6 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:30:52 -0500
        Subject: [PATCH 098/108] add lang-cookie in filter-lang to sparql organization
         aspect
        
        ---
         scholia/app/templates/organization_awards.sparql            | 2 +-
         scholia/app/templates/organization_page-production.sparql   | 2 +-
         scholia/app/templates/organization_recent-literature.sparql | 2 +-
         3 files changed, 3 insertions(+), 3 deletions(-)
        
        diff --git a/scholia/app/templates/organization_awards.sparql b/scholia/app/templates/organization_awards.sparql
        index ae97d0821..c694b68fc 100644
        --- a/scholia/app/templates/organization_awards.sparql
        +++ b/scholia/app/templates/organization_awards.sparql
        @@ -8,7 +8,7 @@ WITH {
               } 
             }
             ?researcher wdt:P166 ?award .
        -    ?researcher rdfs:label ?researcher_label . FILTER (LANG(?researcher_label) = 'en')
        +    ?researcher rdfs:label ?researcher_label . FILTER (LANG(?researcher_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?award 
         } AS %result
        diff --git a/scholia/app/templates/organization_page-production.sparql b/scholia/app/templates/organization_page-production.sparql
        index 812819a0b..8f41c42e5 100644
        --- a/scholia/app/templates/organization_page-production.sparql
        +++ b/scholia/app/templates/organization_page-production.sparql
        @@ -22,7 +22,7 @@ WHERE {
               ?work wdt:P1104 ?pages .
               ?work wdt:P577 ?date . 
               BIND(STR(YEAR(?date)) AS ?year) 
        -      ?researcher rdfs:label ?researcher_label . FILTER(LANG(?researcher_label) = 'en')
        +      ?researcher rdfs:label ?researcher_label . FILTER(LANG(?researcher_label) = '{{ g.lang_code }}')
             } 
             GROUP BY ?work ?researcher_label ?year
           }
        diff --git a/scholia/app/templates/organization_recent-literature.sparql b/scholia/app/templates/organization_recent-literature.sparql
        index 46b58e199..4133a8666 100644
        --- a/scholia/app/templates/organization_recent-literature.sparql
        +++ b/scholia/app/templates/organization_recent-literature.sparql
        @@ -11,7 +11,7 @@ WITH {
           WHERE {                                                         
             ?researcher ( wdt:P108 | wdt:P463 | wdt:P1416 ) / wdt:P361* wd:{{ q }} .
             ?work wdt:P50 ?researcher .
        -    ?researcher rdfs:label ?researcher_label . FILTER (LANG(?researcher_label) = 'en')
        +    ?researcher rdfs:label ?researcher_label . FILTER (LANG(?researcher_label) = '{{ g.lang_code }}')
             OPTIONAL {
               ?work wdt:P577 ?publication_datetimes .
             }
        
        From a40de091d1c3eed0fca381f9e9ceb8f5b7552682 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:31:52 -0500
        Subject: [PATCH 099/108] add lang-cookie in filter-lang to sparql pathway
         aspect
        
        ---
         scholia/app/templates/pathway_participants.sparql    | 2 +-
         scholia/app/templates/pathway_recent-articles.sparql | 4 ++--
         2 files changed, 3 insertions(+), 3 deletions(-)
        
        diff --git a/scholia/app/templates/pathway_participants.sparql b/scholia/app/templates/pathway_participants.sparql
        index 37d18d281..ae02000b6 100644
        --- a/scholia/app/templates/pathway_participants.sparql
        +++ b/scholia/app/templates/pathway_participants.sparql
        @@ -7,7 +7,7 @@ WITH {
             OPTIONAL { 
               ?part wdt:P31 ?type_ .
               ?type_ rdfs:label ?type_label .
        -      FILTER (LANG(?type_label) = 'en')
        +      FILTER (LANG(?type_label) = '{{ g.lang_code }}')
             }
           } GROUP BY ?part
         } AS %result
        diff --git a/scholia/app/templates/pathway_recent-articles.sparql b/scholia/app/templates/pathway_recent-articles.sparql
        index 959e31628..e84ba69fb 100644
        --- a/scholia/app/templates/pathway_recent-articles.sparql
        +++ b/scholia/app/templates/pathway_recent-articles.sparql
        @@ -17,12 +17,12 @@ WITH {
             OPTIONAL {
               ?work wdt:P921 ?topic .
               ?topic rdfs:label ?topic_label .
        -      FILTER (lang(?topic_label) = 'en')
        +      FILTER (lang(?topic_label) = '{{ g.lang_code }}')
             }
             OPTIONAL { 
               ?work wdt:P31 ?type_ .
               ?type_ rdfs:label ?type_label .
        -      FILTER (LANG(?type_label) = 'en') 
        +      FILTER (LANG(?type_label) = '{{ g.lang_code }}') 
             }
             OPTIONAL { ?work wdt:P577 ?dates . }
           }
        
        From a28af5f5c6dd32acd4af7ec8a8c0a77d1df1f3ac Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:32:54 -0500
        Subject: [PATCH 100/108] add lang-cookie in filter-lang to sparql project
         aspect
        
        ---
         scholia/app/templates/project_recent-articles.sparql | 4 ++--
         scholia/app/templates/project_timeline.sparql        | 2 +-
         2 files changed, 3 insertions(+), 3 deletions(-)
        
        diff --git a/scholia/app/templates/project_recent-articles.sparql b/scholia/app/templates/project_recent-articles.sparql
        index 810255362..e6b20c405 100644
        --- a/scholia/app/templates/project_recent-articles.sparql
        +++ b/scholia/app/templates/project_recent-articles.sparql
        @@ -31,12 +31,12 @@ WITH {
             INCLUDE %works
             OPTIONAL {
                ?work wdt:P31 ?type_ .
        -       ?type_ rdfs:label ?type_label . FILTER (LANG(?type_label) = 'en')
        +       ?type_ rdfs:label ?type_label . FILTER (LANG(?type_label) = '{{ g.lang_code }}')
             }
             OPTIONAL { ?work wdt:P577 ?dates . }
             OPTIONAL {
               ?work wdt:P921 ?topic .
        -      ?topic rdfs:label ?topic_label . FILTER (lang(?topic_label) = 'en')
        +      ?topic rdfs:label ?topic_label . FILTER (lang(?topic_label) = '{{ g.lang_code }}')
             }
           }
           GROUP BY ?work
        diff --git a/scholia/app/templates/project_timeline.sparql b/scholia/app/templates/project_timeline.sparql
        index 0e2081103..9237e36dc 100644
        --- a/scholia/app/templates/project_timeline.sparql
        +++ b/scholia/app/templates/project_timeline.sparql
        @@ -11,7 +11,7 @@ SELECT DISTINCT ?start_time ?end_time ?description WHERE {
             ?project (wdt:P571 | wdt:P580) ?start_time ;
                      (wdt:P576 | wdt:P582) ?end_time .
             ?project rdfs:label ?projectName .
        -    FILTER (lang(?projectName) = "en")
        +    FILTER (lang(?projectName) = '{{ g.lang_code }}')
             BIND(?projectName AS ?description)
           }   
           UNION 
        
        From 53b33d9ede354ace209a7b6dc394b8c601db53c5 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:34:06 -0500
        Subject: [PATCH 101/108] add lang-cookie in filter-lang to sparql protein
         aspect
        
        ---
         scholia/app/templates/protein_cofunctional-proteins.sparql | 2 +-
         scholia/app/templates/protein_similar-proteins.sparql      | 2 +-
         2 files changed, 2 insertions(+), 2 deletions(-)
        
        diff --git a/scholia/app/templates/protein_cofunctional-proteins.sparql b/scholia/app/templates/protein_cofunctional-proteins.sparql
        index e3e6cbe7c..3c189807b 100644
        --- a/scholia/app/templates/protein_cofunctional-proteins.sparql
        +++ b/scholia/app/templates/protein_cofunctional-proteins.sparql
        @@ -7,7 +7,7 @@ WITH {
             ?query_protein wdt:P680 ?function .
             FILTER (?query_protein != ?protein)
             ?protein wdt:P680 ?function . 
        -    ?function rdfs:label ?function_label FILTER(lang(?function_label) = "en")
        +    ?function rdfs:label ?function_label FILTER(lang(?function_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?protein
         } AS %result 
        diff --git a/scholia/app/templates/protein_similar-proteins.sparql b/scholia/app/templates/protein_similar-proteins.sparql
        index d751160f4..8d2b62932 100644
        --- a/scholia/app/templates/protein_similar-proteins.sparql
        +++ b/scholia/app/templates/protein_similar-proteins.sparql
        @@ -7,7 +7,7 @@ WITH {
             ?query_protein wdt:P680 | wdt:P681 | wdt:P682 | wdt:P129 ?function .
             FILTER (?query_protein != ?protein)
             ?protein wdt:P680 | wdt:P681 | wdt:P682 | wdt:P129 ?function . 
        -    ?function rdfs:label ?function_label FILTER(lang(?function_label) = "en")
        +    ?function rdfs:label ?function_label FILTER(lang(?function_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?protein
         } AS %result 
        
        From 33eea71ae06afb471da9b433ef8b595e6f0e261c Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:36:11 -0500
        Subject: [PATCH 102/108] add lang-cookie in filter-lang to sparql publisher
         aspect
        
        ---
         scholia/app/templates/publisher_editor-photos.sparql | 2 +-
         scholia/app/templates/publisher_editors.sparql       | 2 +-
         scholia/app/templates/publisher_journals.sparql      | 2 +-
         3 files changed, 3 insertions(+), 3 deletions(-)
        
        diff --git a/scholia/app/templates/publisher_editor-photos.sparql b/scholia/app/templates/publisher_editor-photos.sparql
        index 35481c926..b7956a7ca 100644
        --- a/scholia/app/templates/publisher_editor-photos.sparql
        +++ b/scholia/app/templates/publisher_editor-photos.sparql
        @@ -14,7 +14,7 @@ WITH {
             ?venue_ wdt:P98 | wdt:P5769 ?editor .
             ?editor wdt:P18 ?image_ .
             OPTIONAL {
        -      ?venue_ rdfs:label ?venue_label . FILTER(LANG(?venue_label) = 'en')
        +      ?venue_ rdfs:label ?venue_label . FILTER(LANG(?venue_label) = '{{ g.lang_code }}')
             }
           }
           GROUP BY ?editor
        diff --git a/scholia/app/templates/publisher_editors.sparql b/scholia/app/templates/publisher_editors.sparql
        index ce3c50cb1..46587da0e 100644
        --- a/scholia/app/templates/publisher_editors.sparql
        +++ b/scholia/app/templates/publisher_editors.sparql
        @@ -12,7 +12,7 @@ WITH {
             # Find editors for a work published by publisher
             ?venue_ wdt:P123 wd:{{ q }} .
             ?venue_ wdt:P98 | wdt:P5769 ?editor .
        -    # ?venue_ rdfs:label ?venue_label . FILTER(LANG(?venue_label) = 'en')
        +    # ?venue_ rdfs:label ?venue_label . FILTER(LANG(?venue_label) = '{{ g.lang_code }}')
           } 
           GROUP BY ?editor
         } AS %result
        diff --git a/scholia/app/templates/publisher_journals.sparql b/scholia/app/templates/publisher_journals.sparql
        index e14032139..263067d5d 100644
        --- a/scholia/app/templates/publisher_journals.sparql
        +++ b/scholia/app/templates/publisher_journals.sparql
        @@ -18,7 +18,7 @@ WHERE {
           OPTIONAL {
             ?journal wdt:P921 ?themes .
             ?themes rdfs:label ?themes_labels .
        -    FILTER (LANG(?themes_labels) = 'en')
        +    FILTER (LANG(?themes_labels) = '{{ g.lang_code }}')
           }
           OPTIONAL { ?journal wdt:P1240 ?bfi . }
           SERVICE wikibase:label { bd:serviceParam wikibase:language "{{ g.lang_code }},[AUTO_LANGUAGE],en" . } 
        
        From e2cf4bfab7387a399292d368cf1e4f26ec215d25 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:37:29 -0500
        Subject: [PATCH 103/108] add lang-cookie in filter-lang to sparql taxon aspect
        
        ---
         scholia/app/templates/taxon_parent-taxa.sparql | 2 +-
         scholia/app/templates/taxon_tree.sparql        | 8 ++++----
         2 files changed, 5 insertions(+), 5 deletions(-)
        
        diff --git a/scholia/app/templates/taxon_parent-taxa.sparql b/scholia/app/templates/taxon_parent-taxa.sparql
        index 6bf951a4a..cf4fce4e1 100644
        --- a/scholia/app/templates/taxon_parent-taxa.sparql
        +++ b/scholia/app/templates/taxon_parent-taxa.sparql
        @@ -5,7 +5,7 @@ SELECT
           wd:{{ q }} wdt:P171+ ?parent .
           ?parent wdt:P105 ?rank .
           OPTIONAL {
        -    ?rank rdfs:label ?rank_label_ . FILTER (LANG(?rank_label_) = 'en')
        +    ?rank rdfs:label ?rank_label_ . FILTER (LANG(?rank_label_) = '{{ g.lang_code }}')
           }
           SERVICE wikibase:label { bd:serviceParam wikibase:language "{{ g.lang_code }},[AUTO_LANGUAGE],en". }
         }
        diff --git a/scholia/app/templates/taxon_tree.sparql b/scholia/app/templates/taxon_tree.sparql
        index 882744753..e02aa0510 100644
        --- a/scholia/app/templates/taxon_tree.sparql
        +++ b/scholia/app/templates/taxon_tree.sparql
        @@ -38,13 +38,13 @@ WITH {
         WHERE {
           INCLUDE %results 
                   
        -  ?child rdfs:label ?child_label . FILTER(LANG(?child_label) = 'en')
        -  ?parent rdfs:label ?parent_label . FILTER(LANG(?parent_label) = 'en')
        +  ?child rdfs:label ?child_label . FILTER(LANG(?child_label) = '{{ g.lang_code }}')
        +  ?parent rdfs:label ?parent_label . FILTER(LANG(?parent_label) = '{{ g.lang_code }}')
           OPTIONAL {
        -    ?child wdt:P105 / rdfs:label ?child_rank_label . FILTER (LANG(?child_rank_label) = 'en')
        +    ?child wdt:P105 / rdfs:label ?child_rank_label . FILTER (LANG(?child_rank_label) = '{{ g.lang_code }}')
           }
           OPTIONAL {
        -    ?parent wdt:P105 / rdfs:label ?parent_rank_label . FILTER (LANG(?parent_rank_label) = 'en')
        +    ?parent wdt:P105 / rdfs:label ?parent_rank_label . FILTER (LANG(?parent_rank_label) = '{{ g.lang_code }}')
           }
           BIND(CONCAT(?child_label, " - ", COALESCE(?child_rank_label, "???")) AS ?childLabel)
           BIND(CONCAT(?parent_label, " - ", COALESCE(?parent_rank_label, "???")) AS ?parentLabel)
        
        From ba9b72a9967d227766683a957c922c5cc7bc50a9 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:41:06 -0500
        Subject: [PATCH 104/108] add lang-cookie in filter-lang to sparql topic aspect
        
        ---
         scholia/app/templates/topic_author-awards.sparql            | 4 ++--
         scholia/app/templates/topic_earliest-published-works.sparql | 2 +-
         scholia/app/templates/topic_publications-per-year.sparql    | 2 +-
         scholia/app/templates/topic_recently-published-works.sparql | 2 +-
         scholia/app/templates/topics_list-of-works.sparql           | 2 +-
         5 files changed, 6 insertions(+), 6 deletions(-)
        
        diff --git a/scholia/app/templates/topic_author-awards.sparql b/scholia/app/templates/topic_author-awards.sparql
        index 884b343fb..a0ec28e47 100644
        --- a/scholia/app/templates/topic_author-awards.sparql
        +++ b/scholia/app/templates/topic_author-awards.sparql
        @@ -13,13 +13,13 @@ WITH {
               } 
               LIMIT 100
             }
        -    ?researcher rdfs:label ?researcher_label . FILTER (LANG(?researcher_label) = 'en')
        +    ?researcher rdfs:label ?researcher_label . FILTER (LANG(?researcher_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?award 
         } AS %result
         WHERE {
           INCLUDE %result
        -    ?award rdfs:label ?awardLabel . FILTER (LANG(?awardLabel) = 'en')
        +    ?award rdfs:label ?awardLabel . FILTER (LANG(?awardLabel) = '{{ g.lang_code }}')
         }
         GROUP BY ?count ?award ?awardLabel ?recipients ?recipientsUrl
         ORDER BY DESC(?count)
        diff --git a/scholia/app/templates/topic_earliest-published-works.sparql b/scholia/app/templates/topic_earliest-published-works.sparql
        index d17594f23..784170f5c 100644
        --- a/scholia/app/templates/topic_earliest-published-works.sparql
        +++ b/scholia/app/templates/topic_earliest-published-works.sparql
        @@ -12,7 +12,7 @@ WITH {
             ?work wdt:P921 ?topic . 
             ?work wdt:P577 ?dates . 
         	FILTER (!isBLANK(?dates)) .
        -    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = 'en')
        +    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?work
         } AS %result
        diff --git a/scholia/app/templates/topic_publications-per-year.sparql b/scholia/app/templates/topic_publications-per-year.sparql
        index f872b8594..bc5141da6 100644
        --- a/scholia/app/templates/topic_publications-per-year.sparql
        +++ b/scholia/app/templates/topic_publications-per-year.sparql
        @@ -36,7 +36,7 @@ WITH {
         WHERE {
           {
             INCLUDE %works
        -    ?article_type rdfs:label ?type . FILTER (LANG(?type) = "en")
        +    ?article_type rdfs:label ?type . FILTER (LANG(?type) = '{{ g.lang_code }}')
           }
           UNION
           {
        diff --git a/scholia/app/templates/topic_recently-published-works.sparql b/scholia/app/templates/topic_recently-published-works.sparql
        index 8f4ea880a..df81483ca 100644
        --- a/scholia/app/templates/topic_recently-published-works.sparql
        +++ b/scholia/app/templates/topic_recently-published-works.sparql
        @@ -12,7 +12,7 @@ WITH {
             INCLUDE %works
             ?work wdt:P921 ?topic . 
             OPTIONAL { ?work wdt:P577 ?dates . }
        -    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = 'en')
        +    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?work
         } AS %result
        diff --git a/scholia/app/templates/topics_list-of-works.sparql b/scholia/app/templates/topics_list-of-works.sparql
        index 9b7228a9f..01118935b 100644
        --- a/scholia/app/templates/topics_list-of-works.sparql
        +++ b/scholia/app/templates/topics_list-of-works.sparql
        @@ -15,7 +15,7 @@ WITH {
             # long time and time out.
             ?work wdt:P921 ?topic  .
             ?topic rdfs:label ?topic_label .
        -    FILTER(LANG(?topic_label) = 'en')
        +    FILTER(LANG(?topic_label) = '{{ g.lang_code }}')
           }
           GROUP BY ?work ?topics
           HAVING(?count > 1)
        
        From e999a7d653ef6b890cc24fdf525a8832bd98cdae Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:41:55 -0500
        Subject: [PATCH 105/108] add lang-cookie in filter-lang to sparql venue aspect
        
        ---
         scholia/app/templates/venue_cito_articles-by-intention.sparql | 2 +-
         scholia/app/templates/venue_recently-published-works.sparql   | 2 +-
         2 files changed, 2 insertions(+), 2 deletions(-)
        
        diff --git a/scholia/app/templates/venue_cito_articles-by-intention.sparql b/scholia/app/templates/venue_cito_articles-by-intention.sparql
        index a7aeb796b..3bdcfe94f 100644
        --- a/scholia/app/templates/venue_cito_articles-by-intention.sparql
        +++ b/scholia/app/templates/venue_cito_articles-by-intention.sparql
        @@ -27,7 +27,7 @@ select ?year (count(?work) as ?number_of_publications) ?intention where {
                     p:P2860 / pq:P3712 / rdfs:label ?intention ;
                     wdt:P1433 ?JOURNAL .
               bind(str(year(?dates)) as ?years) .
        -      FILTER (LANG(?intention) = "en")
        +      FILTER (LANG(?intention) = '{{ g.lang_code }}')
             }
             group by ?work ?intention
           }
        diff --git a/scholia/app/templates/venue_recently-published-works.sparql b/scholia/app/templates/venue_recently-published-works.sparql
        index 96d5f7cb3..28c8ccda5 100644
        --- a/scholia/app/templates/venue_recently-published-works.sparql
        +++ b/scholia/app/templates/venue_recently-published-works.sparql
        @@ -13,7 +13,7 @@ WHERE {
           OPTIONAL {
             ?work wdt:P50 ?author .
             ?author rdfs:label ?author_label .
        -    FILTER (LANG(?author_label) = 'en')
        +    FILTER (LANG(?author_label) = '{{ g.lang_code }}')
           }
           SERVICE wikibase:label { bd:serviceParam wikibase:language "{{ g.lang_code }},[AUTO_LANGUAGE],en" . } 
         }
        
        From f0e05714d5fa6577fcbe5785de0fcf6b8c61f345 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 10:43:41 -0500
        Subject: [PATCH 106/108] add lang-cookie in filter-lang to sparql work aspect
        
        ---
         .../app/templates/work_citation-graph.sparql   |  4 ++--
         scholia/app/templates/work_data.sparql         | 18 +++++++++---------
         .../app/templates/work_list-of-authors.sparql  |  4 ++--
         scholia/app/templates/work_timeline.sparql     |  2 +-
         4 files changed, 14 insertions(+), 14 deletions(-)
        
        diff --git a/scholia/app/templates/work_citation-graph.sparql b/scholia/app/templates/work_citation-graph.sparql
        index 597665072..63e220a64 100644
        --- a/scholia/app/templates/work_citation-graph.sparql
        +++ b/scholia/app/templates/work_citation-graph.sparql
        @@ -41,7 +41,7 @@ WHERE {
               ?citing_author_statement pq:P1545 "1" .
               ?citing_author_statement ps:P50 ?citing_author .
               ?citing_author rdfs:label ?citing_author_name .
        -      filter(lang(?citing_author_name) = 'en')
        +      filter(lang(?citing_author_name) = '{{ g.lang_code }}')
             }
             union 
           	{ 
        @@ -55,7 +55,7 @@ WHERE {
               ?cited_author_statement pq:P1545 "1" .
               ?cited_author_statement ps:P50 ?cited_author .
               ?cited_author rdfs:label ?cited_author_name .
        -      filter(lang(?cited_author_name) = 'en')
        +      filter(lang(?cited_author_name) = '{{ g.lang_code }}')
             }
             union 
           	{ 
        diff --git a/scholia/app/templates/work_data.sparql b/scholia/app/templates/work_data.sparql
        index 71dd2969e..5633b0cbc 100644
        --- a/scholia/app/templates/work_data.sparql
        +++ b/scholia/app/templates/work_data.sparql
        @@ -18,7 +18,7 @@ WHERE {
               wd:{{ q }} wdt:P50 ?iri .
               BIND(SUBSTR(STR(?iri), 32) AS ?q) 
               ?iri rdfs:label ?value_string . 
        -      FILTER (LANG(?value_string) = 'en')
        +      FILTER (LANG(?value_string) = '{{ g.lang_code }}')
               BIND(COALESCE(?value_string, ?q) AS ?value_)
             }
             GROUP BY ?dummy
        @@ -35,7 +35,7 @@ WHERE {
               wd:{{ q }} wdt:P98 ?iri .
               BIND(SUBSTR(STR(?iri), 32) AS ?q) 
               ?iri rdfs:label ?value_string . 
        -      FILTER (LANG(?value_string) = 'en')
        +      FILTER (LANG(?value_string) = '{{ g.lang_code }}')
               BIND(COALESCE(?value_string, ?q) AS ?value_)
             }
             GROUP BY ?dummy
        @@ -61,7 +61,7 @@ WHERE {
               wd:{{ q }} wdt:P4032 ?iri .
               BIND(SUBSTR(STR(?iri), 32) AS ?q) 
               ?iri rdfs:label ?value_string . 
        -      FILTER (LANG(?value_string) = 'en')
        +      FILTER (LANG(?value_string) = '{{ g.lang_code }}')
               BIND(COALESCE(?value_string, ?q) AS ?value_)
             }
             GROUP BY ?dummy
        @@ -73,7 +73,7 @@ WHERE {
             ?work wdt:P1433 ?iri .
             BIND(SUBSTR(STR(?iri), 32) AS ?q) 
             ?iri rdfs:label ?value_string . 
        -    FILTER (LANG(?value_string) = 'en')
        +    FILTER (LANG(?value_string) = '{{ g.lang_code }}')
             BIND(COALESCE(?value_string, ?q) AS ?value)
             BIND(CONCAT("../venue/", ?q) AS ?valueUrl)
           }
        @@ -84,7 +84,7 @@ WHERE {
             ?work wdt:P179 ?iri .
             BIND(SUBSTR(STR(?iri), 32) AS ?q) 
             ?iri rdfs:label ?value_string . 
        -    FILTER (LANG(?value_string) = 'en')
        +    FILTER (LANG(?value_string) = '{{ g.lang_code }}')
             BIND(COALESCE(?value_string, ?q) AS ?value)
             BIND(CONCAT("../series/", ?q) AS ?valueUrl)
           }
        @@ -104,7 +104,7 @@ WHERE {
             ?work wdt:P123 ?iri .
             BIND(SUBSTR(STR(?iri), 32) AS ?q) 
             ?iri rdfs:label ?value_string . 
        -    FILTER (LANG(?value_string) = 'en')
        +    FILTER (LANG(?value_string) = '{{ g.lang_code }}')
             BIND(COALESCE(?value_string, ?q) AS ?value)
             BIND(CONCAT("../publisher/", ?q) AS ?valueUrl)
           }
        @@ -120,7 +120,7 @@ WHERE {
               wd:{{ q }} wdt:P921 ?iri .
               BIND(SUBSTR(STR(?iri), 32) AS ?q) 
               ?iri rdfs:label ?value_string . 
        -      FILTER (LANG(?value_string) = 'en')
        +      FILTER (LANG(?value_string) = '{{ g.lang_code }}')
               BIND(COALESCE(?value_string, ?q) AS ?value_)
             }
             GROUP BY ?dummy
        @@ -162,7 +162,7 @@ WHERE {
             ?work wdt:P5824 ?iri .
             BIND(SUBSTR(STR(?iri), 32) AS ?q) 
             ?iri rdfs:label ?value_string . 
        -    FILTER (LANG(?value_string) = 'en')
        +    FILTER (LANG(?value_string) = '{{ g.lang_code }}')
             BIND(COALESCE(?value_string, ?q) AS ?value)
             BIND(CONCAT("../work/", ?q) AS ?valueUrl)
           }
        @@ -180,7 +180,7 @@ WHERE {
               ?statement pq:P642 ?pub .
             BIND(SUBSTR(STR(?pub), 32) AS ?pubqid) 
             ?pub rdfs:label ?value_string . 
        -    FILTER (LANG(?value_string) = 'en')
        +    FILTER (LANG(?value_string) = '{{ g.lang_code }}')
             BIND(COALESCE(?value_string, ?pubqid) AS ?value)
             BIND(CONCAT("../work/", ?pubqid) AS ?valueUrl)}
           }
        diff --git a/scholia/app/templates/work_list-of-authors.sparql b/scholia/app/templates/work_list-of-authors.sparql
        index 7f6bb62bf..db20a0256 100644
        --- a/scholia/app/templates/work_list-of-authors.sparql
        +++ b/scholia/app/templates/work_list-of-authors.sparql
        @@ -14,7 +14,7 @@ WHERE {
             wd:{{ q }} p:P50 ?author_statement .
             ?author_statement ps:P50 ?author_ .
             ?author_ rdfs:label ?author .
        -    FILTER (LANG(?author) = 'en')
        +    FILTER (LANG(?author) = '{{ g.lang_code }}')
             BIND(CONCAT("../author/", SUBSTR(STR(?author_), 32)) AS ?authorUrl)
             OPTIONAL {
               ?author_statement pq:P1545 ?order_ .
        @@ -25,7 +25,7 @@ WHERE {
             BIND(COALESCE(?orcid_, CONCAT("orcid-search/quick-search/?searchQuery=", ENCODE_FOR_URI(?author))) AS ?orcid)
             OPTIONAL {
               ?author_ schema:description ?authorDescription .
        -      FILTER (LANG(?authorDescription) = "en")
        +      FILTER (LANG(?authorDescription) = '{{ g.lang_code }}')
             }
           }
           UNION
        diff --git a/scholia/app/templates/work_timeline.sparql b/scholia/app/templates/work_timeline.sparql
        index 0458d14a4..c0cccb789 100644
        --- a/scholia/app/templates/work_timeline.sparql
        +++ b/scholia/app/templates/work_timeline.sparql
        @@ -20,7 +20,7 @@ SELECT DISTINCT ?datetime ?description WHERE {
             ?event_statement ps:P793 ?event_type .
             ?event_type rdfs:label ?description_ .
             ?event_statement pq:P585 ?datetime .
        -    FILTER (LANG(?description_) = "en")
        +    FILTER (LANG(?description_) = '{{ g.lang_code }}')
             
             # Warning icon for retraction
             BIND(
        
        From 92f1a24274a12986872a0dcedd4f6b9eccba2240 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Fri, 3 Sep 2021 18:28:22 -0500
        Subject: [PATCH 107/108] add template.json with data-i18n attr of all html
         files
        
        ---
         scholia/app/static/i18n/template.json | 414 ++++++++++++++++++++++++++
         1 file changed, 414 insertions(+)
         create mode 100644 scholia/app/static/i18n/template.json
        
        diff --git a/scholia/app/static/i18n/template.json b/scholia/app/static/i18n/template.json
        new file mode 100644
        index 000000000..21a931c80
        --- /dev/null
        +++ b/scholia/app/static/i18n/template.json
        @@ -0,0 +1,414 @@
        +{
        +    "@metadata": {
        +        "authors": [
        +            "scholia"
        +        ],
        +        "last-updated": "",
        +        "locale": "en"
        +    },
        +    "404-doi-quickstatements": "",
        +    "about-acknowledgment": "",
        +    "about-background-reading": "",
        +    "about-citation": "",
        +    "about-faq": "",
        +    "about-presentations": "",
        +    "about-technical-acknowledgement": "",
        +    "arxiv-to-quickstatements-arxiv-to-quickstatements": "",
        +    "arxiv-to-quickstatements-input": "",
        +    "arxiv-to-quickstatements-result": "",
        +    "author-academic-tree": "",
        +    "author-associated-images": "",
        +    "author-citation-statistics": "",
        +    "author-citations-by-year": "",
        +    "author-coauthor-map": "",
        +    "author-coauthors": "",
        +    "author-curation-missing-author-resolving": "",
        +    "author-curation-missing-citing-author-items": "",
        +    "author-curation-missing-coauthor-items": "",
        +    "author-curation-missing-topic": "",
        +    "author-events": "",
        +    "author-index-author": "",
        +    "author-index-comparisons": "",
        +    "author-index-example-profiles": "",
        +    "author-index-redirects": "",
        +    "author-list-of-publications": "",
        +    "author-most-cited-works": "",
        +    "author-most-citing-authors": "",
        +    "author-other-locations": "",
        +    "author-pages-per-year": "",
        +    "author-publications-per-year": "",
        +    "author-review-statistics": "",
        +    "author-timeline": "",
        +    "author-topic-scores": "",
        +    "author-topics-w0": "",
        +    "author-topics-w1": "",
        +    "author-topics-works matrix": "",
        +    "author-venue-statistics": "",
        +    "authors-citations-per-publication-year": "",
        +    "authors-co-author": "",
        +    "authors-list-of-jointly-authored-works": "",
        +    "authors-works-per-publication-year": "",
        +    "award-Co-awards": "",
        +    "award-Gender-distribution": "",
        +    "award-Images-of-recipients": "",
        +    "award-List-of-recipients": "",
        +    "award-Locations-of-recipients": "",
        +    "award-Recent-publications-by-recipients": "",
        +    "award-Topics-of-works-by-recipients": "",
        +    "award-curation-missing-author-items": "",
        +    "award-curation-missing-coauthor-items": "",
        +    "award-curation-missing-topics": "",
        +    "award-empty-aggregates": "",
        +    "award-empty-award": "",
        +    "award-empty-examples": "",
        +    "award-empty-statistics": "",
        +    "catalogue-empty-catalogue": "",
        +    "catalogue-empty-examples": "",
        +    "catalogue-images": "",
        +    "catalogue-items": "",
        +    "chemical-class-class-hierarchy": "",
        +    "chemical-class-empty-chemical-classes": "",
        +    "chemical-class-empty-examples": "",
        +    "chemical-class-empty-redirecting": "",
        +    "chemical-class-empty-single-items": "",
        +    "chemical-class-identifiers": "",
        +    "chemical-class-publications-per-year": "",
        +    "chemical-class-recent-literature": "",
        +    "chemical-class-related-chemicals": "",
        +    "chemical-element-allotropes": "",
        +    "chemical-element-empty-chemical-elements": "",
        +    "chemical-element-empty-examples": "",
        +    "chemical-element-empty-redirecting": "",
        +    "chemical-element-empty-single-items": "",
        +    "chemical-element-isotopes": "",
        +    "chemical-element-recent-literature": "",
        +    "chemical-found-in-taxon": "",
        +    "chemical-identifiers": "",
        +    "chemical-index-chemcuration": "",
        +    "chemical-index-chemical-substances": "",
        +    "chemical-index-curation-missing-boiling-points": "",
        +    "chemical-index-curation-missing-chemical-structure": "",
        +    "chemical-index-curation-missing-combustion-enthalpy": "",
        +    "chemical-index-curation-missing-density": "",
        +    "chemical-index-curation-missing-enthalpy-of-formation": "",
        +    "chemical-index-curation-missing-flash-point": "",
        +    "chemical-index-curation-missing-idlh": "",
        +    "chemical-index-curation-missing-mass": "",
        +    "chemical-index-curation-missing-melting-points": "",
        +    "chemical-index-curation-missing-molar-entropy": "",
        +    "chemical-index-curation-missing-pKa": "",
        +    "chemical-index-curation-missing-physicochemical-properties-for-chemicals": "",
        +    "chemical-index-curation-missing-solubility": "",
        +    "chemical-index-curation-missing-vapor-pressure": "",
        +    "chemical-index-examples": "",
        +    "chemical-index-redirecting": "",
        +    "chemical-index-single-items": "",
        +    "chemical-index-statistics": "",
        +    "chemical-physchem-properties": "",
        +    "chemical-publications-per-year": "",
        +    "chemical-recent-literature": "",
        +    "chemical-related": "",
        +    "chemical-structural-identifiers": "",
        +    "cito-articles": "",
        +    "cito-articles-by-year": "",
        +    "cito-empty-article-counts": "",
        +    "cito-empty-articles-by-year": "",
        +    "cito-empty-citation-typing-ontology-intentions": "",
        +    "cito-empty-journal-counts": "",
        +    "cito-empty-statistics": "",
        +    "cito-journals": "",
        +    "clinical-trial-clinical-trial": "",
        +    "clinical-trial-data": "",
        +    "clinical-trial-index-clinical-trials": "",
        +    "clinical-trial-index-interventions": "",
        +    "clinical-trial-index-medical-conditions": "",
        +    "clinical-trial-index-phases": "",
        +    "clinical-trial-index-recent-clinical-trials": "",
        +    "clinical-trial-index-statistics": "",
        +    "clinical-trial-related-trials": "",
        +    "complex-articles-by-year": "",
        +    "complex-articles-recent": "",
        +    "complex-empty-biological-complexes": "",
        +    "complex-empty-examples": "",
        +    "complex-empty-redirecting": "",
        +    "complex-empty-single-items": "",
        +    "complex-empty-statistics": "",
        +    "complex-identifiers": "",
        +    "complex-participants": "",
        +    "countries-list-of-countries": "",
        +    "country-authors": "",
        +    "country-co-organizations": "",
        +    "country-empty-country": "",
        +    "country-empty-examples": "",
        +    "country-empty-multiple-countries": "",
        +    "country-empty-subaspects": "",
        +    "country-locations-as-topics": "",
        +    "country-narrative-locations": "",
        +    "country-organizations": "",
        +    "country-topic-authors": "",
        +    "country-topic-coauthors-graph": "",
        +    "country-topic-cocitations-graph": "",
        +    "dataset-citations": "",
        +    "dataset-identifiers": "",
        +    "dataset-index-dataset": "",
        +    "dataset-index-examples": "",
        +    "dataset-index-single-items": "",
        +    "dataset-list-of-authors": "",
        +    "dataset-topic-scores": "",
        +    "disease-clinical-trials": "",
        +    "disease-empty-disease": "",
        +    "disease-empty-examples": "",
        +    "disease-publications-per-year": "",
        +    "disease-related-diseases": "",
        +    "event-co-authors": "",
        +    "event-empty-events": "",
        +    "event-empty-future-events": "",
        +    "event-empty-past-events": "",
        +    "event-empty-upcoming-deadlines": "",
        +    "event-people": "",
        +    "event-proceedings": "",
        +    "event-recent-publications": "",
        +    "event-related-events": "",
        +    "event-related-events-people": "",
        +    "event-related-events-timelocation": "",
        +    "event-series-empty-examples": "",
        +    "event-series-empty-list": "",
        +    "event-series-events": "",
        +    "event-series-map": "",
        +    "event-series-people": "",
        +    "event-series-proceedings-publications": "",
        +    "event-series-recent-publications": "",
        +    "event-series-timeline": "",
        +    "event-series-topics": "",
        +    "event-series-works": "",
        +    "event-table": "",
        +    "event-timeline": "",
        +    "event-works": "",
        +    "gene-empty-examples": "",
        +    "gene-empty-genes": "",
        +    "gene-empty-redirecting": "",
        +    "gene-empty-single-items": "",
        +    "gene-orthologs": "",
        +    "gene-proteins": "",
        +    "gene-transcripts": "",
        +    "gene-variants": "",
        +    "index-combinations": "",
        +    "index-examples": "",
        +    "index-profiles": "",
        +    "index-redirects": "",
        +    "index-search": "",
        +    "index-statistics-statistics": "",
        +    "lexeme-empty-lexemes": "",
        +    "lexeme-works": "",
        +    "location-empty-examples": "",
        +    "location-empty-location": "",
        +    "location-empty-subaspects": "",
        +    "location-nearby-locations-as-topics-in-works": "",
        +    "location-nearby-organizations": "",
        +    "location-topic-nearby-researchers": "",
        +    "organization-#employees-and-affiliated": "",
        +    "organization-Citations": "",
        +    "organization-advisor-graph": "",
        +    "organization-awards": "",
        +    "organization-co-author-graph": "",
        +    "organization-co-author-normalized-citations": "",
        +    "organization-curation-authors": "",
        +    "organization-curation-authors-no-initials": "",
        +    "organization-curation-authors-with-initials": "",
        +    "organization-curation-h3": "",
        +    "organization-empty-examples": "",
        +    "organization-empty-multiple-organizations": "",
        +    "organization-empty-organization": "",
        +    "organization-empty-subaspect": "",
        +    "organization-gender-distribution": "",
        +    "organization-most-cited-papers": "",
        +    "organization-page-production": "",
        +    "organization-recent-citations": "",
        +    "organization-recent-literature": "",
        +    "organization-topic-recent-literature": "",
        +    "organization-topics": "",
        +    "organizations-citations-per-year": "",
        +    "organizations-citations-to-works": "",
        +    "organizations-coauthorships": "",
        +    "organizations-list": "",
        +    "organizations-topic-tree": "",
        +    "organizations-works-per-year": "",
        +    "pathway-citing-articles": "",
        +    "pathway-empty-biological-pathways": "",
        +    "pathway-empty-examples": "",
        +    "pathway-empty-redirecting": "",
        +    "pathway-empty-single-items": "",
        +    "pathway-empty-statistics": "",
        +    "pathway-organism": "",
        +    "pathway-participants": "",
        +    "pathway-publications-per-year": "",
        +    "pathway-recent-articles": "",
        +    "printer-index-map": "",
        +    "printer-index-printed-works-per-publisher": "",
        +    "printer-index-printer": "",
        +    "printer-works": "",
        +    "project-authors": "",
        +    "project-empty-citations-per-budget": "",
        +    "project-empty-clusters": "",
        +    "project-empty-examples": "",
        +    "project-empty-individual-projects": "",
        +    "project-empty-project": "",
        +    "project-empty-redirecting": "",
        +    "project-empty-statistics": "",
        +    "project-partners": "",
        +    "project-prolific-authors": "",
        +    "project-publications-per-year": "",
        +    "project-recent-articles": "",
        +    "project-timeline": "",
        +    "project-topic-scores": "",
        +    "property-item-counts": "",
        +    "property-property": "",
        +    "property-property-value-counts": "",
        +    "property-use": "",
        +    "protein-cofunctional-proteins": "",
        +    "protein-empty-examples": "",
        +    "protein-empty-proteins": "",
        +    "protein-empty-redirecting": "",
        +    "protein-empty-single-items": "",
        +    "protein-participates-in": "",
        +    "protein-publications-per-year": "",
        +    "publisher-citations": "",
        +    "publisher-citations-works": "",
        +    "publisher-editors": "",
        +    "publisher-empty-examples": "",
        +    "publisher-empty-publisher": "",
        +    "publisher-journals": "",
        +    "publisher-most-cited": "",
        +    "publisher-timeline": "",
        +    "search-back": "",
        +    "search-next": "",
        +    "search-results": "",
        +    "search-search": "",
        +    "series-authors": "",
        +    "series-empty-examples": "",
        +    "series-empty-series": "",
        +    "series-in-series": "",
        +    "series-organizations": "",
        +    "series-topics": "",
        +    "series-works": "",
        +    "software-authors": "",
        +    "software-coused": "",
        +    "software-dependencies": "",
        +    "software-empty-examples": "",
        +    "software-empty-most-used-software": "",
        +    "software-empty-overview": "",
        +    "software-empty-software": "",
        +    "software-recent-works": "",
        +    "software-topics": "",
        +    "sponsor-authors-on-sponsored-works": "",
        +    "sponsor-co-sponsors": "",
        +    "sponsor-empty-examples": "",
        +    "sponsor-empty-sponsor": "",
        +    "sponsor-project-budgets": "",
        +    "sponsor-recently-published-sponsored-works": "",
        +    "sponsor-topics-of-sponsored-works": "",
        +    "taxon-empty-examples": "",
        +    "taxon-empty-redirecting": "",
        +    "taxon-empty-single-items": "",
        +    "taxon-empty-taxa": "",
        +    "taxon-genome": "",
        +    "taxon-identifiers": "",
        +    "taxon-metabolome": "",
        +    "taxon-parent-taxa": "",
        +    "taxon-proteome": "",
        +    "text-to-topics-text": "",
        +    "topic-author-awards": "",
        +    "topic-author-scores": "",
        +    "topic-authors-w0": "",
        +    "topic-authors-w1": "",
        +    "topic-citations": "",
        +    "topic-co-occurring": "",
        +    "topic-co-occurring-map": "",
        +    "topic-coauthor-graph": "",
        +    "topic-context": "",
        +    "topic-country-citation-graph": "",
        +    "topic-curation-missing-author-items": "",
        +    "topic-curation-missing-co-topic": "",
        +    "topic-curation-missing-pub-date": "",
        +    "topic-curation-missing-pub-venue": "",
        +    "topic-earliest-published-works": "",
        +    "topic-empty-comparisons": "",
        +    "topic-empty-examples": "",
        +    "topic-empty-specialized-topics": "",
        +    "topic-empty-topic": "",
        +    "topic-empty-topic-profiles": "",
        +    "topic-most-cited-authors": "",
        +    "topic-organization-map": "",
        +    "topic-publications-per-year": "",
        +    "topic-recently-published-works": "",
        +    "topic-top-cited": "",
        +    "topic-topics-w0": "",
        +    "topic-topics-w1": "",
        +    "topic-venues": "",
        +    "topics-authors": "",
        +    "topics-list-of-works": "",
        +    "use-authors-of-works-using-the-resource": "",
        +    "use-co-used": "",
        +    "use-empty-examples": "",
        +    "use-empty-most-used": "",
        +    "use-empty-overview": "",
        +    "use-empty-use": "",
        +    "use-recent-work-using-the-used": "",
        +    "use-topics-of-works-using-the-resource": "",
        +    "use-usage-over-time": "",
        +    "venue-articles-citing-retracted-articles": "",
        +    "venue-author-awards": "",
        +    "venue-author-gender-distribution": "",
        +    "venue-author-images": "",
        +    "venue-authors-w0": "",
        +    "venue-authors-w1": "",
        +    "venue-authorship-gender-distribution": "",
        +    "venue-citation-distribution": "",
        +    "venue-citations": "",
        +    "venue-cited-venues": "",
        +    "venue-citing-venues": "",
        +    "venue-cito-articles-by-intention": "",
        +    "venue-cito-incoming-bubble": "",
        +    "venue-cito-most-reused-articles": "",
        +    "venue-cito-outgoing-bubble": "",
        +    "venue-co-author-graph": "",
        +    "venue-curation-missing-author-item": "",
        +    "venue-curation-missing-topics": "",
        +    "venue-empty-examples": "",
        +    "venue-empty-multiple-venues": "",
        +    "venue-empty-venues": "",
        +    "venue-gender-distribution": "",
        +    "venue-most-cited-articles": "",
        +    "venue-most-cited-authors": "",
        +    "venue-recently-published-works": "",
        +    "venue-topics": "",
        +    "venues-citations-per-year": "",
        +    "venues-citations-to-work-ratio": "",
        +    "venues-published-works-per-year": "",
        +    "work-citation-graph": "",
        +    "work-citations-per-year": "",
        +    "work-citations-w0": "",
        +    "work-citations-w1": "",
        +    "work-cited-work-authors": "",
        +    "work-cited-works": "",
        +    "work-cito-cito-incoming": "",
        +    "work-empty-comparisons": "",
        +    "work-empty-examples": "",
        +    "work-empty-recently-retracted-works": "",
        +    "work-empty-redirects": "",
        +    "work-empty-work": "",
        +    "work-empty-works": "",
        +    "work-export-bibtex": "",
        +    "work-export-citation.cff": "",
        +    "work-list-of-authors": "",
        +    "work-related-works": "",
        +    "work-statements": "",
        +    "work-timeline": "",
        +    "work-topic-scores": "",
        +    "work-wikipedia-mentions": "",
        +    "works-authors": "",
        +    "works-citations": "",
        +    "works-citations-per-year": "",
        +    "works-citing-works": "",
        +    "works-topics": ""
        +}
        \ No newline at end of file
        
        From 0b99ac7a70f860b2f172af471684fbfa07237876 Mon Sep 17 00:00:00 2001
        From: Cesar Uribe 
        Date: Mon, 6 Sep 2021 12:21:39 -0500
        Subject: [PATCH 108/108] add script to create json and update requirements
        
        ---
         i18n_create_json.py | 268 ++++++++++++++++++++++++++++++++++++++++++++
         requirements.txt    |   6 +-
         2 files changed, 273 insertions(+), 1 deletion(-)
         create mode 100644 i18n_create_json.py
        
        diff --git a/i18n_create_json.py b/i18n_create_json.py
        new file mode 100644
        index 000000000..5aebfcc9a
        --- /dev/null
        +++ b/i18n_create_json.py
        @@ -0,0 +1,268 @@
        +"""
        +Create json file for internationalitation process.
        +
        +Script to create json file using data-i18n attributes
        +inside html files for internationalitation process
        +"""
        +
        +import json
        +import click
        +import re
        +import glob
        +from pathlib import Path
        +from bs4 import BeautifulSoup
        +from tabulate import tabulate
        +from colorama import Fore, Style
        +from collections import OrderedDict, Counter
        +
        +
        +def read_file(filename):
        +    """Read a file an return its content as string."""
        +    with open(filename, "r") as fstream:
        +        content = fstream.read()
        +    return content
        +
        +
        +def write_file(filename, content):
        +    """Write into a file."""
        +    with open(filename, "w") as f:
        +        f.write(content)
        +
        +
        +def read_json(filename):
        +    """Read a json file an return its content as dict."""
        +    with open(filename, "r") as f:
        +        content = json.loads(f.read())
        +    return content
        +
        +
        +def write_json(filename, data):
        +    """Write dict as json file."""
        +    with open(filename, "w") as f:
        +        f.write(json.dumps(data, indent=4))
        +
        +
        +def show_table(datadict, color, fmt="pretty"):
        +    """Show dict as a table with tabulate with color."""
        +    print(color)
        +    print(tabulate(datadict, headers="keys", tablefmt=fmt))
        +    print(Style.RESET_ALL)
        +
        +
        +def print_info(datadict, color, title=''):
        +    """Show dict info as a table with tabulate with color."""
        +    print(color)
        +    print(f"+{title:-^60s}+")
        +    print(json.dumps(datadict, indent=4))
        +    print(f"+{'':-^60s}+")
        +    print(Style.RESET_ALL)
        +
        +
        +def create_json_i18n(filename, json_content, verbose=False):
        +    """Create the dict/json i18n from html content.
        +
        +    Search for data-i18n attribute inside html content
        +    and generate/update the json file following banana format
        +    """
        +    content = read_file(filename)
        +    soup = BeautifulSoup(content, 'html.parser')
        +    matches = soup.find_all([], {"data-i18n": True})
        +    oldfields = set(json_content)
        +
        +    for tag in matches:
        +        if not json_content.get(tag.get("data-i18n"), None):
        +            json_content.update({f"{tag.get('data-i18n')}": ''})
        +
        +    newfields = {
        +        key
        +        for key in json_content.keys() if key not in oldfields
        +    }
        +    if verbose:
        +        show_table({
        +            "file": [Path(filename).name],
        +            "existing fields": oldfields,
        +            "new fields": newfields
        +        }, Fore.YELLOW)
        +
        +
        +def normalize(name):
        +    """Allow click to use command with underscore."""
        +    return name.replace("_", "-")
        +
        +
        +@click.group(context_settings={"token_normalize_func": normalize})
        +def cli():
        +    """Create/update json for internationalitation.
        +
        +    This program allows you to create or update a .json file
        +    for an internationalitation process, using the banana format. You
        +    can look for the data-i18n atrribute in one or several html files at time
        +    and therefore, extract them and create/update the json file. Also you
        +    can check if there are attributes duplicated in html files before
        +    put in json
        +    file.
        +
        +    To show help for specific command, you can run:
        +
        +    python i18n_create_json.py COMMAND --help
        +    """
        +    pass
        +
        +
        +@cli.command()
        +@click.option('-f', "--file", help="to pass the html file which it will \
        +be scanned")
        +@click.option('--output', '-o', help="To give the name of the output json")
        +@click.option('-i', "--inplace", is_flag=True, help="To create/update the file. Without \
        +this option, the command is executed in a dry-run mode")
        +@click.option('-v', "--verbose", is_flag=True, help="To show more detailed information \
        +about the process")
        +def onefile(**kwargs):
        +    """To search all data-i18n attributes inside one html file.
        +
        +    This command allows you look for all data-i18n attributes inside one html
        +    file passed by command line with the option -f/--file and create or update
        +    a json file with these attributes following the banana format.
        +
        +
        +    How to use:
        +
        +    1. To execute in dry-run mode
        +
        +       $ python i18n_create_json.py onefile --file="path/to/file.html"
        +        -o path/to/output.json
        +
        +
        +    2. To execute and replace in-place
        +
        +       $ python i18n_create_json.py onefile --file="path/to/file.html"
        +        -o path/to/output.json -i/--inplace
        +
        +    """
        +    filename = kwargs['file']
        +    trfile_content = {}
        +    verbose = kwargs["verbose"]
        +
        +    outfile = Path(filename).parent.parent / "static/i18n" / kwargs['output']
        +
        +    if outfile.exists():
        +        trfile_content = read_json(outfile)
        +
        +    metadata = {"@metadata": trfile_content.pop("@metadata", None)}
        +    create_json_i18n(filename, trfile_content, verbose)
        +    trfile_content = {
        +        **metadata,
        +        **OrderedDict(sorted(trfile_content.items()))
        +    }
        +
        +    if not kwargs["inplace"]:
        +        print_info(
        +            trfile_content,
        +            Fore.LIGHTGREEN_EX,
        +            title=f"New content for {kwargs['output']}"
        +        )
        +    else:
        +        write_json(outfile, trfile_content)
        +
        +
        +@cli.command()
        +@click.option("--pattern", help="To pass the html files using unix wildcards")
        +@click.option('--output', '-o', help="To give the name of the output json")
        +@click.option('-i', "--inplace", is_flag=True, help="To create/update the file. \
        +Without this option, the command is executed in a dry-run mode")
        +@click.option('-v', "--verbose", is_flag=True, help="To show more detailed information \
        +about the process")
        +def severalfiles(**kwargs):
        +    """To search all data-i18n attributes inside several html files.
        +
        +    This command allows you look for all data-i18n attributes inside several
        +    html files passed by command line with the option -p/--pattern as a
        +    pattern. You can use the bash wildcards. With this pattern, you can create
        +    or update the json file with these attributes following the banana format.
        +
        +
        +    How to use:
        +
        +    1. To execute in dry-run mode
        +
        +       $ python i18n_create_json.py severalfiles --pattern="path/to/file*.html"
        +        -o path/to/output.json
        +
        +
        +    2. To execute and replace in-place
        +
        +       $ python i18n_create_json.py everalfiles --pattern="path/to/file*.html"
        +       -o path/to/output.json -i/--inplace
        +
        +    """
        +    pattern = kwargs['pattern']
        +    verbose = kwargs["verbose"]
        +
        +    trfile_content = {}
        +    outfile = Path(pattern).parent.parent / "static/i18n" / kwargs['output']
        +
        +    if outfile.exists():
        +        trfile_content = read_json(outfile)
        +
        +    metadata = {"@metadata": trfile_content.pop("@metadata", None)}
        +    files = glob.glob(pattern)
        +    for file in files:
        +        create_json_i18n(file, trfile_content, verbose)
        +
        +    trfile_content = {
        +        **metadata,
        +        **OrderedDict(sorted(trfile_content.items()))
        +    }
        +
        +    if not kwargs["inplace"]:
        +        print_info(
        +            trfile_content,
        +            Fore.LIGHTGREEN_EX,
        +            title=f"New content for {kwargs['output']}"
        +        )
        +    else:
        +        write_json(outfile, trfile_content)
        +
        +
        +@cli.command()
        +@click.option('--path', required=True, help="To pass the html files using \
        +unix wildcards")
        +def check_duplicates(**kwargs):
        +    """To look for data-i18n attributes duplicated.
        +
        +    This command allows you look for all duplicated data-i18n attributes
        +    inside several html files passed by command line with the option
        +    --path as a pattern.
        +
        +    How to use:
        +
        +    1. To show duplicated data-i18n attributes
        +
        +       $ python i18n_create_json.py check_duplicates
        +       --path="path/to/file*.html"
        +
        +    """
        +    path = kwargs["path"]
        +    files = glob.glob(path)
        +    rx = re.compile(r'(data-i18n\b=\"([^"]*)\")')
        +    content = []
        +    for file in files:
        +        string = read_file(file)
        +        matches = rx.finditer(string)
        +        for match in matches:
        +            content.append(match.group(2))
        +
        +    duplicates = [key for key, val in Counter(content).items() if val > 1]
        +
        +    show_table(
        +        {
        +            "KEY DUPLICATES": duplicates if duplicates
        +            else ["There are not duplicated keys"]
        +        },
        +        color=Fore.LIGHTRED_EX,
        +        fmt="simple"
        +    )
        +
        +
        +if __name__ == '__main__':
        +    cli()
        diff --git a/requirements.txt b/requirements.txt
        index e5ed87d9b..58af07140 100644
        --- a/requirements.txt
        +++ b/requirements.txt
        @@ -8,4 +8,8 @@ requests
         simplejson
         werkzeug>=0.9
         urllib3>=1.25.1
        -feedparser
        \ No newline at end of file
        +feedparser
        +colorama
        +bs4
        +tabulate
        +click