Skip to content

Commit

Permalink
Translate to english (#269)
Browse files Browse the repository at this point in the history
* Prepare files for translation
* ✨ feat(english): remove "draft" parameters
*  quick format
* ✨ feat(english): add slugs
*  remove unnecessary parameter "no_padding = true"
* Update index.md
* Update _#first_intro.md
* Update _#first_test-url.md
* Delete _10_header.md
* Update _10_why-important.md
* Update _10_intro.md
* Update _10_eco-design.md
* Update _10_editor.md
* Update _10_contributors.md
* Update _10_simple.md
* Update _10_join-us.md
* Update _20_contribute.md
* Update _20_appreciation.md
* Update _20_good-practices-book.md
* Update _20_compare.md
* Update _20_numbers.md
* Update _20_privacy.md
* Update _30_did-you-know.md
* Update _30_conditions.md
* Update _30_good-practices-tips.md
* Update _30_sources.md
* Update _30_footprint.md
* Update _30_urls-use.md
* Update _35_details.md
* Update _30_criterias.md
* Update _40_contribute.md
* Update _40_hosting.md
* Update _40_badge.md
* Update _40_tools.md
* Update _40_ecoindex.md
* Update _45_what-it-means.md
* Update _50_more.md
* Update _50_formula.md
* Update _60_tips.md
* Update _60_footprint.md
* Update _66_error-codes.md
* Update _70_extension.md
* Update _70_important.md
* Update _20_hosting.md
* Update linked to current French content
* Update module base-structure
* clean go.sum
* hugo-microtypo update fixes double content in English
* feat: make the form analysis redirect to the correct localized result page
* feat: add missing english translations for the results page
* fix: make it possible to switch language on the result page
* doc: update Vincent profile

---------

Co-authored-by: Yaacov <[email protected]>
Co-authored-by: aureliebaton <[email protected]>
Co-authored-by: clem-mndi <[email protected]>
Co-authored-by: Lucile Alteyrac <[email protected]>
Co-authored-by: Bastien Gatellier <[email protected]>
  • Loading branch information
6 people authored Dec 1, 2023
1 parent b9baa62 commit d75c87a
Show file tree
Hide file tree
Showing 89 changed files with 1,103 additions and 616 deletions.
1 change: 0 additions & 1 deletion archetypes/default.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
+++
title = "{{- replace .Name "-" " " | title -}}"
date = {{- .Date -}}
draft = true
weight = 1
menu = "main"
+++
7 changes: 7 additions & 0 deletions assets/css/1_revert_dependencies.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Revert Every Layout CSS property changes since version used in goodimpact-hugo/modules/base-structure v0.0.0-20221129171738-d8c79a5e4c78
*/
.box-l.--s2p0 {
/* use value from .box-l */
padding: var(--s1, 1.3rem);
}
File renamed without changes.
File renamed without changes.
25 changes: 18 additions & 7 deletions assets/js/components/SiteAnalysisResult.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import ResultRangeSlider from "./ResultRangeSlider";
import AnalysisService from "../services/AnalysisService";
import ResultCacheService from "../services/ResultCacheService";
import { getUrlHostName } from "../helpers/urlUtils";

import { clamp, getPercentFromRange } from "../helpers/mathUtils";
import { camelize } from "../helpers/stringUtils";
import { getUrlHostName } from "../helpers/urlUtils";
import AnalysisService from "../services/AnalysisService";
import ResultRangeSlider from "./ResultRangeSlider";

/**
* @typedef ResultRelativeTextData
Expand Down Expand Up @@ -41,6 +38,7 @@ class SiteAnalysisResult {
*/
async _init() {
const urlParams = new URLSearchParams(window.location.search);
const langSwitchersElements = document.querySelectorAll(".language-switcher a.lang")

let pageResultData = {};

Expand All @@ -51,11 +49,24 @@ class SiteAnalysisResult {
pageResultData[key] = value;
}

// update the link URL of every lang switcher
langSwitchersElements.forEach((a) => {
const href = a.getAttribute("href") + "?" + urlParams.toString()
a.setAttribute("href", href)
})

// else fetch analysis result from id
// NOTE : url params example to test : "?id=ec839aca-7c12-42e8-8541-5f7f94c36b7f
} else if (urlParams.has("id")) {
const id = urlParams.get("id");
pageResultData = await AnalysisService.fetchAnalysisById(id);
// window.location.pathname is something like /resultat (in french) or /en/result (in english)
pageResultData = await AnalysisService.fetchAnalysisById(id, window.location.pathname);

// update the link URL of every lang switcher
langSwitchersElements.forEach((a) => {
const href = a.getAttribute("href") + "?id=" + id
a.setAttribute("href", href)
})
} else {
// TODO: redirect to error page or show dialog ?
window.location = `${window.location.origin}/erreur/?status=404`;
Expand Down
6 changes: 3 additions & 3 deletions assets/js/helpers/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Redirects to the results page given an analysis id (retrieved from back-end)
*
* @param {string} analysisId EcoIndex analyis identifier
* @param {string} resultUrlPrefix Results page prefix URL
*/
export function redirectToResults(analysisId) {
// TODO: get lang relative url
window.location = `${window.location.origin}/resultat/?id=${analysisId}`;
export function redirectToResults(analysisId, resultUrlPrefix) {
window.location = `${window.location.origin}${resultUrlPrefix}?id=${analysisId}`;
}
7 changes: 4 additions & 3 deletions assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ function initSubmitUrlForm() {
e.preventDefault();

const url = e.target.querySelector("input[name='siteurl']").value;
launchAnalysisByURL(url);
const resultUrlPrefix = form.getAttribute("action")
launchAnalysisByURL(url, resultUrlPrefix);
});
}

async function launchAnalysisByURL(url) {
async function launchAnalysisByURL(url, resultUrlPrefix) {
try {
await AnalysisService.launchAnalysisByURL(url);
await AnalysisService.launchAnalysisByURL(url, resultUrlPrefix);
updateFormMessages({ success: true });
} catch (error) {
updateFormMessages({ success: false, error });
Expand Down
13 changes: 9 additions & 4 deletions assets/js/services/AnalysisService.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ResultCacheService from "./ResultCacheService";
import { redirectToResults } from "../helpers/routing";

class AnalysisService {
async launchAnalysisByURL(url) {
async launchAnalysisByURL(url, resultUrlPrefix) {
// If the given url parameter is only a domain name,
// let's transform it to a full URL by prepending "https://" to it
const domainNameRegex =
Expand All @@ -30,7 +30,7 @@ class AnalysisService {

if (taskResult.status === "SUCCESS" && ecoindex.status === "SUCCESS") {
ResultCacheService.add(ecoindex.detail);
redirectToResults(taskId);
redirectToResults(taskId, resultUrlPrefix);
}

if (taskResult.status === "SUCCESS" && ecoindex.status === "FAILURE") {
Expand All @@ -56,7 +56,12 @@ class AnalysisService {
}
}

async fetchAnalysisById(id) {
/**
*
* @param {string} id
* @param {string} resultPagePrefix
*/
async fetchAnalysisById(id, resultPagePrefix) {
// Check local storage: if analysis results object exist returns it
let apiResult = ResultCacheService.get(id);
if (apiResult) {
Expand All @@ -70,7 +75,7 @@ class AnalysisService {
(result) => {
apiResult = result;
ResultCacheService.add(result);
redirectToResults(result.id);
redirectToResults(result.id, resultPagePrefix);
EcoIndexDialog.close();
},
(e) => {
Expand Down
2 changes: 1 addition & 1 deletion config/_default/menu.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[[footer]]
identifier = "github"
title = "Github"
title = "GitHub"
url = "https://github.com/cnumr/Ecoindex/"
weight = 10
[footer.params]
Expand Down
1 change: 0 additions & 1 deletion content/en/404/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
+++
draft = true
title = "Page not found"
decoType = "404"
+++
Expand Down
6 changes: 2 additions & 4 deletions content/en/_home_widgets/_#first_test-url.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
id = "test-url"
+++

Enter a website URL to discover the score:
{{< ecoindex_form action="/en/result" >}}

{{< ecoindex_form >}}

More than 40 000 sites already tested ! [Method](/en/how-it-works/)
More than 40,000 web pages already tested! [How does it work?](/en/how-it-works/)
25 changes: 19 additions & 6 deletions content/en/_home_widgets/_10_why-important.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,28 @@ id = "why-important"
weight = 10
+++

{{% info_2_columns %}}

{{% info_2_columns_col1 %}}

## Why is it important?

### Le numérique, ce n’est pas que du vent
Digital technologies are not just "clouds"

{{% /info_2_columns_col1 %}}

{{% info_2_columns_col2 %}}

[**WARNING !!! A passer en anglais**] Aujourd’hui, l’empreinte environnementale des nouvelles technologies représente
plus de gaz à effet de serre que l’aviation civile.
Today, the environmental footprint of digital technologies emits more greenhouse gases than civil aviation.

Et ce chiffre est en constante augmentation : de plus en plus de gens ont accès au numérique et les objets connectés ne
cessent de se multiplier.
And it's constantly increasing: more and more people have access to Internet and connected devices are multiplying.

{{% highlight %}}

**Digital technologies could be considered as a 7th continent, 2 to 3 times the size of France.**

{{% highlight %}} **Le numérique mondial représente un 7ème continent de la taille de 2 à 3 fois celle de la France.**
{{% /highlight %}}

{{% /info_2_columns_col2 %}}

{{% /info_2_columns %}}
41 changes: 21 additions & 20 deletions content/en/_home_widgets/_20_numbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ id = "numbers"
weight = 20
+++

### Today, global worldwide digital footprint represents

[A passer en anglais : ] {{<grid min-cell-width="160">}} {{<highlight_info_card
icon="energy"
title="4,2 %"
>}} consommation d'energie primaire {{</highlight_info_card>}} {{<highlight_info_card
icon="cloud"
title="3,2 %"
text="émission de gaz <br/> à effet de serre"
>}} émission de gaz à effet de serre {{</highlight_info_card>}} {{<highlight_info_card
icon="water-drop"
title="0,2 %"
text=""
>}} consommation d’eau {{</highlight_info_card>}} {{<highlight_info_card
icon="electricity"
title="5,6 %"
text=""
>}} consommation d’électricité {{</highlight_info_card>}} {{</grid>}}

<small>Source: Empreinte environnementale du numérique mondial - greenit.fr</small>
{{% info_1_column %}}

Its contribution to humanity's environmental impact is far from insignificant

{{% /info_1_column %}}

{{<grid min-cell-width="160">}}

{{<highlight_info_card icon="energy" title="4,2 %">}} primary energy consumption {{</highlight_info_card>}}

{{<highlight_info_card icon="cloud" title="3,2 %">}} greenhouse gases emissions {{</highlight_info_card>}}

{{<highlight_info_card icon="water-drop" title="0,2 %">}} water consumption {{</highlight_info_card>}}

{{<highlight_info_card icon="electricity" title="5,6 %">}} electricity consumption {{</highlight_info_card>}}

{{</grid>}}

<small>Source: Global digital environmental footprint - greenit.fr</small>

On your scale, digital equals 40 % of your sustainable GHG package (GHG quantity you're allowed to emit per year to target 1.5°C global warming).
17 changes: 14 additions & 3 deletions content/en/_home_widgets/_30_did-you-know.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@ id = "did-you-know"
weight = 30
+++

{{% info_2_columns %}}

{{% info_2_columns_col1 %}}

## Did you know?

[**WARNING !!! A passer en anglais**] Le poids d’une page web a été multiplié par 115 entre 1995 et 2015 et n’a pas
cessé d’augmenter depuis !
{{% /info_2_columns_col1 %}}

{{% info_2_columns_col2 %}}

An average web page weight has been multiplied by 155 between 1995 and 2022 and it doesn't stop increasing!

**<a hreflang="fr" href="https://www.greenit.fr/empreinte-environnementale-du-numerique-mondial">Learn more about digital environmental footprint</a>**

{{% /info_2_columns_col2 %}}

[**En savoir plus sur l’empreinte environnementale du numérique**](https://www.greenit.fr/empreinte-environnementale-du-numerique-mondial/)
{{% /info_2_columns %}}
20 changes: 17 additions & 3 deletions content/en/_home_widgets/_40_contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,22 @@ id = "contribute"
weight = 40
+++

## You like this project? You can contribute
{{% info_2_columns %}}

Join the community [...] and participate to our actions.
{{% info_2_columns_col1 %}}

[**Join us**](/en/join-us)
## Are you interested?

You can contribute to this project

{{% /info_2_columns_col1 %}}

{{% info_2_columns_col2 %}}

Join our community of digital sustainability and eco-design experts and take part in our actions.

[**Join us**](/en/join-us/)

{{% /info_2_columns_col2 %}}

{{% /info_2_columns %}}
1 change: 0 additions & 1 deletion content/en/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
+++
draft = true
title = "Test a website"
layout = "single"
decoType = "home"
Expand Down
6 changes: 2 additions & 4 deletions content/en/about/_#first_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
id = "intro"
+++

[**WARNING !!! A passer en anglais**] À l’origine, EcoIndex.fr est un service en ligne conçu et proposé par Frédéric
Bordage (GreenIT.fr) et réalisé par Gwenael Chailleu et Thomas Samain de la société Nxtweb. Par la suite, de
nombreux·ses contributeur·ices bénévoles ont participé aux évolutions et améliorations de l’outil, devenu un projet
collectif et ouvert à tous·tes.
EcoIndex.fr is an online service initially designed by Frédéric Bordage (GreenIT.fr) and produced by Gwenael Chailleu and Thomas Samain (Nxtweb).
After the first version, many volunteers contributed to the evolutions and improvements of this tool that became a collective project open to all.
6 changes: 4 additions & 2 deletions content/en/about/_10_contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ weight = 10
- [Yaacov Cohen](https://www.linkedin.com/in/yaacovcohen/)
- [Romuald Priol](https://www.linkedin.com/in/romuald-p/)
- [Romain Dulieu](https://www.linkedin.com/in/romain-dulieu-53a354120/)
- [Vincent Vatelot](https://vincent-vatelot.welovedevs.com/)
- [Bastien Cornier](https://www.linkedin.com/in/bastiencornier/)
- [Julien Wilhelm](https://www.linkedin.com/in/julien-wilhelm/)

Also, many thanks to:
And many thanks to:

- [Jade Vincent](https://www.linkedin.com/in/jadevincent/)
- [Richard Hanna](https://www.linkedin.com/in/%F0%9F%8C%B1-richard-hanna-76a18115/)
- [Ninda Sitthiso](https://www.linkedin.com/in/ninda-lejeune-sitthiso-76545817/)
- [Julien Wilhelm](https://www.linkedin.com/in/julien-wilhelm/)
- [Raphaël Lemaire](https://www.linkedin.com/in/rapha%C3%ABl-lemaire-71b99910/)
- [Lise Breteau](https://www.linkedin.com/in/lisebreteau/)
- [Alexandre Patti](https://www.linkedin.com/in/alexandre-patti/)
19 changes: 16 additions & 3 deletions content/en/about/_20_contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@ id = "contribute"
weight = 20
+++

## Ce projet vous intéresse ? Vous pouvez y contribuer
{{% info_2_columns %}}

[**WARNING !!! A passer en anglais**] Rejoignez la communauté des acteur·ices du numérique responsable et de
l’écoconception et participez à nos actions.
{{% info_2_columns_col1 %}}

## Are you interested?

You can contribute to this project

{{% /info_2_columns_col1 %}}

{{% info_2_columns_col2 %}}

Join our community of digital sustainability and eco-design experts and take part in our actions.

[Join us](/en/join-us)

{{% /info_2_columns_col2 %}}

{{% /info_2_columns %}}
24 changes: 15 additions & 9 deletions content/en/about/_30_sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ id = "sources"
weight = 30
+++

## Sources et conditions d’utilisation

[**WARNING !!! A passer en anglais**] Vous pouvez trouvez les sources et contribuer sur
[Github](https://github.com/cnumr/EcoIndex) L’algorithme et le service EcoIndex, ainsi que les outils associés, et les
résultats fournis sont proposés sous licence
[Creative Commons CC-By-NC-ND](https://creativecommons.org/licenses/by-nc-nd/2.0/fr/) Cela signifie que tout le monde
peut utiliser l’algorithme, les outils et les résultats, à condition de citer la source des chiffres obtenus –
EcoIndex.fr et un lien vers le service [http://ecoindex.fr](http://ecoindex.fr). Il n’est pas possible d’en faire un
usage commercial. Pour plus d’informations voir [legal](/en/legal)
{{% info_2_columns %}}

{{% info_2_columns_col1 %}}

## Project sources and terms of use

{{% /info_2_columns_col1 %}}

{{% info_2_columns_col2 %}}

You can find the project sources and contribute on our GitHub repositories: [EcoIndex website](https://github.com/cnumr/EcoIndex) and [EcoIndex API](https://github.com/cnumr/ecoindex_api). EcoIndex algorithm, service, associated tools and results provided are licensed under a [Creative Commons License CC-By-NC-ND](https://creativecommons.org/licenses/by-nc-nd/2.0/). This means everybody can use the algorithm, tools and results, under the following terms: give credit to EcoIndex.fr and provide a link to the service [https://ecoindex.fr](https://ecoindex.fr). You may not use the material for commercial purposes. For more information, see [legal notice](/en/legal).

{{% /info_2_columns_col2 %}}

{{% /info_2_columns %}}
12 changes: 6 additions & 6 deletions content/en/about/_40_hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ weight = 30

{{% info_2_columns_col2 %}}

This site is generously hosted by the service provider Neutral IT, which stands out on the environmental level at different levels:
This site is generously hosted by Neutral IT, which stands out on several environmental levels:

- It has 13 datacenters in France which are distributed in Lyon, Nantes, Paris, Lille. The particularity of its datacenters is to **reuse 96% of the energy they consume** to heat swimming pools and domestic hot water.
- It also uses powerful **refurbished used servers**, from the research and IT industry.
- It has proven, thanks to a Life Cycle Analysis, that the environmental footprint of the IT services hosted in its datacenters was drastically optimized: it is **116% reduction in greenhouse gas emissions** compared to non-optimized datacenters!
- The distributed architecture of its data centers allows Neutral-IT to **host high availability services.**
- The Company uses **only open source technologies** to operate and monitor its servers and Service.
- It has 13 datacenters in France, located in Lyon, Nantes, Paris, Lille. Those datacenters **reuse 96% of the energy they consume** to heat swimming pools and domestic hot water.
- It uses powerful **refurbished second-hand servers** previously used by research and IT industries.
- It was proven, through a Life Cycle Analysis, that the environmental footprint of IT services hosted in their datacenters was drastically optimized: **116% reduction in greenhouse gases emissions** compared to non-optimized datacenters!
- The distributed architecture of its datacenters allows Neutral-IT to **host high availability services.**
- The company **only uses open source technologies** to operate and monitor its servers and services.

Do not hesitate to [contact](https://neutral-it.com/#contact) them for your hosting needs.

Expand Down
Loading

0 comments on commit d75c87a

Please sign in to comment.