generated from dataforgoodfr/d4g-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from dataforgoodfr/global_dashboard
Translations
- Loading branch information
Showing
10 changed files
with
228 additions
and
179 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"app_title": "Lichens Go Dashboard", | ||
"observation_tab_title": "Sites", | ||
"observation_tab_tooltip": "Click on a site to discover what lichens can teach us.", | ||
"species_tab_title": "Species", | ||
"map_title": "Observation Map", | ||
"map_tooltip": "Click on a point to display observation details", | ||
"species_number_distribution_hist1_title": "Species Count Distribution", | ||
"species_number_distribution_hist1_tooltip": "The number of lichen species (or diversity) reflects environmental quality. Generally, more species indicate less pollution. Select a site on the map to see its position (red line) relative to other Lichens GO records (blue bars).", | ||
"vdl_distribution_hist2_title": "Lichen Diversity Value Distribution", | ||
"vdl_distribution_hist2_tooltip": "The LDV (lichen diversity value) measures the abundance of lichens at a site. This abundance corresponds to the number of squares in which a species is present. A high LDV suggests less pollution, but other environmental factors such as climate can also influence this index. It is therefore important to consider the ecology of the species present by looking at other indicators, such as the presence of toxitolerant species. Select a site to see its position (red line) compared to other Lichens GO records (blue bars).", | ||
"species_distribution_hist3_title": "Observed Species", | ||
"species_distribution_hist3_tooltip": "This chart shows the percentage of squares where each species was observed on the selected site.", | ||
"thallus_pie_chart_title": "Thallus Type", | ||
"thallus_pie_chart_tooltip": "This chart illustrates the number of fruticose, foliose, and crustose lichens observed at the selected site.", | ||
"toxitolerance_gauge_title": "Toxitolerant Species (%)", | ||
"toxitolerance_gauge_tooltip": "This indicator shows the proportion of toxitolerant species at the site. Toxitolerant species are generally tolerant to air pollution. They are mainly found in highly disturbed urban environments. Generally, the higher their proportion at a site, the more it is affected by human activities.", | ||
"eutrophication_gauge_title": "Eutrophic Species (%)", | ||
"eutrophication_gauge_tooltip": "This indicator shows the proportion of eutrophic species at the site. Eutrophic species are favored by pollution enriched with nitrogen nutrients, mainly related to urban traffic and rural agriculture. A high proportion of eutrophic species often indicates ecological imbalance, signaling that the site is heavily affected by this form of pollution.", | ||
"acidity_gauge_title": "Acidophilic Species (%)", | ||
"acidity_gauge_tooltip": "Acidophilic species are favored by acidic pollution. However, this type of pollution has practically disappeared from our cities. Therefore, currently, acidophilic species are rather indicators of an absence of eutrophic pollution.", | ||
"species_presence_map_title": "Selected Species Presence Map", | ||
"species_presence_map_tooltip": "This map illustrates the distribution of lichen species based on the records of Lichens GO participants.", | ||
"species_distribution_hist4_title": "Most Observed Species", | ||
"species_distribution_hist4_tooltip": "This chart shows the number of sites where each species was observed.", | ||
"species_dropdown_label": "Species", | ||
"species_dropdown_description": "Select a species to display its information", | ||
"toxitolerance_badge": "Toxitolerance", | ||
"acidity_badge": "Acidity", | ||
"eutrophication_badge": "Eutrophication", | ||
"species_description1": "This lichen", | ||
"species_description2": "is", | ||
"species_description3": "in urban environment", | ||
"nb_species_cat": "Species Count", | ||
"VDL_cat": "LDV", | ||
"deg_toxitolerance_cat": "Toxitolerant Species (%)", | ||
"deg_eutrophication_cat": "Eutrophic Species (%)", | ||
"deg_acidity_cat": "Acidophilic Species (%)", | ||
"unknown": "unknown", | ||
"acidophilous": "acidophilic", | ||
"neutrophilous": "neutrophilic", | ||
"basophilous": "basophilic", | ||
"oligotrophic": "oligotrophic", | ||
"mesotrophic": "mesotrophic", | ||
"eutrophic": "eutrophic", | ||
"sensitive": "sensitive", | ||
"intermediate": "intermediate", | ||
"tolerant": "tolerant", | ||
"resistant": "resistant" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"app_title": "Tableau de bord Lichens Go", | ||
"observation_tab_title": "Sites", | ||
"observation_tab_tooltip": "Cliquez sur un site pour découvrir ce que les lichens peuvent nous apprendre.", | ||
"species_tab_title": "Espèces", | ||
"map_title": "Carte des observations", | ||
"map_tooltip": "Cliquer sur un point pour afficher les informations de l'observation", | ||
"species_number_distribution_hist1_title": "Distribution du nombre d'espèces", | ||
"species_number_distribution_hist1_tooltip": "Le nombre d'espèces (ou diversité) des lichens reflète la qualité de l'environnement. En règle générale, plus il y a d'espèces, moins le site est pollué. Sélectionnez un site sur la carte pour voir sa position (ligne rouge) par rapport aux autres relevés Lichens GO (barres bleues).", | ||
"vdl_distribution_hist2_title": "Distribution de la valeur de diversité lichénique", | ||
"vdl_distribution_hist2_tooltip": "La VDL (valeur de diversité lichénique) mesure l'abondance des lichens sur un site. Cette abondance correspond au nombre de carrés dans lesquels une espèce est présente. Une VDL élevée suggère moins de pollution, mais d'autres facteurs environnementaux comme le climat peuvent influencer cet indice. Il est donc important de considérer l'écologie des espèces présentes en s'intéressant à d'autres indicateurs, tels que la présence d'espèces toxitolérantes. Sélectionnez un site pour voir sa position (ligne rouge) par rapport aux relevés Lichens GO (barres bleues).", | ||
"species_distribution_hist3_title": "Espèces observées", | ||
"species_distribution_hist3_tooltip": "Ce graphique montre le pourcentage de cases où chaque espèce a été observée sur le site sélectionné.", | ||
"thallus_pie_chart_title": "Type de thalle", | ||
"thallus_pie_chart_tooltip": "Ce graphique illustre le nombre de lichens fruticuleux, foliacés et crustacés observés sur le site sélectionné.", | ||
"toxitolerance_gauge_title": "Espèces toxitolérantes (%)", | ||
"toxitolerance_gauge_tooltip": "Cet indicateur présente la proportion des espèces toxitolérantes sur le site. Les espèces toxitolérantes sont tolérantes à la pollution de l'air en général. Elles se trouvent principalement dans les environnements urbains fortement perturbés. En général, plus leur proportion sur un site est élevée, plus ce site est affecté par les activités humaines.", | ||
"eutrophication_gauge_title": "Espèces eutrophes (%)", | ||
"eutrophication_gauge_tooltip": "Cet indicateur présente la proportion des espèces eutrophes sur le site. Les espèces eutrophes sont favorisées par une pollution enrichie en nutriments azotés, principalement liée au trafic automobile en milieu urbain et à l'agriculture en milieu rural. Une proportion élevée d'espèces eutrophes indique souvent un déséquilibre écologique, signalant que le site est fortement affecté par cette forme de pollution.", | ||
"acidity_gauge_title": "Espèces acidophiles (%)", | ||
"acidity_gauge_tooltip": "Les espèces acidophiles sont favorisées par la pollution acide. Cependant, ce type de pollution a pratiquement disparu de nos villes. C'est pourquoi à l'heure actuelle, les espèces acidophiles sont plutôt indicatrices d'une absence de pollution eutrophisante.", | ||
"species_presence_map_title": "Carte de présence de l'espèce sélectionnée", | ||
"species_presence_map_tooltip": "Cette carte illustre la répartition des espèces de lichens sur base des relevés des participants Lichens GO.", | ||
"species_distribution_hist4_title": "Espèces les plus observées", | ||
"species_distribution_hist4_tooltip": "Ce graphique présente le nombre de sites où chaque espèce a été observée.", | ||
"species_dropdown_label": "Espèce", | ||
"species_dropdown_description": "Sélectionnez une espèce pour afficher les informations s'y rapportant", | ||
"toxitolerance_badge": "Toxitolérance", | ||
"acidity_badge": "Acidité", | ||
"eutrophication_badge": "Eutrophisation", | ||
"species_description1": "Ce lichen", | ||
"species_description2": "est", | ||
"species_description3": "en milieu urbain", | ||
"nb_species_cat": "Nombre d'espèces", | ||
"VDL_cat": "VDL", | ||
"deg_toxitolerance_cat": "Espèces toxitolérantes (%)", | ||
"deg_eutrophication_cat": "Espèces eutrophes (%)", | ||
"deg_acidity_cat": "Espèces acidophiles (%)", | ||
"unknown": "inconnu", | ||
"acidophilous": "acidophile", | ||
"neutrophilous": "neutrophile", | ||
"basophilous": "basophile", | ||
"oligotrophic": "oligotrophe", | ||
"mesotrophic": "mésotrophe", | ||
"eutrophic": "eutrophe", | ||
"sensitive": "sensible", | ||
"intermediate": "intermédiaire", | ||
"tolerant": "tolérant", | ||
"resistant": "résistant" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import json | ||
import os | ||
|
||
def load_translations(lang): | ||
try: | ||
parent_dir = os.path.dirname(os.path.dirname(__file__)) | ||
file_path = os.path.join(parent_dir, 'assets', 'locale', f'{lang}.json') | ||
with open(file_path, 'r') as file: | ||
return json.load(file) | ||
except FileNotFoundError: | ||
print(f"Translation file for language '{lang}' not found.") | ||
return {} | ||
except json.JSONDecodeError: | ||
print(f"Error decoding JSON from translation file for language '{lang}'.") | ||
return {} | ||
|
||
def get_translation(key, lang='fr'): | ||
try: | ||
translations = load_translations(lang) | ||
return translations.get(key, key) | ||
except Exception as e: | ||
print(f"Error getting translation for key '{key}' in language '{lang}': {e}") | ||
return key |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters