Skip to content

Commit

Permalink
Fix translations for fields that were in English in fr mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Potiron committed Nov 10, 2023
1 parent 0c40f9e commit 3ee179c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
16 changes: 11 additions & 5 deletions georiviere/contribution/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-15 17:01+0000\n"
"POT-Creation-Date: 2023-11-10 12:01+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -238,16 +238,16 @@ msgid "contributions quantity"
msgstr "Contributions quantité"

msgid "Nature pollution"
msgstr "Nature pollution"
msgstr "Nature de la pollution"

msgid "Natures pollution"
msgstr "Natures pollution"
msgstr "Natures des pollutions"

msgid "Type pollution"
msgstr "Type pollution"
msgstr "Type de pollution"

msgid "Types pollution"
msgstr "Types pollution"
msgstr "Types de pollution"

msgid "Algal development"
msgstr "Développement algal"
Expand Down Expand Up @@ -315,6 +315,12 @@ msgstr "Contentieux"
msgid "Knowledge"
msgstr "Connaissance"

msgid "Observed species"
msgstr "Espèce observée"

msgid "Observation type"
msgstr "Type d'observation"

msgid "None"
msgstr "Aucun"

Expand Down
25 changes: 10 additions & 15 deletions georiviere/contribution/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_landing(choices, meta):
'landing_type':
{
'type': "string",
'title': str(meta.get_field('landing_type').verbose_name.capitalize()),
'title': str(meta.get_field('landing_type').related_model._meta.verbose_name.capitalize()),
'enum': list(LandingType.objects.values_list('label', flat=True))
}
},
Expand Down Expand Up @@ -111,7 +111,7 @@ def get_disruptive_jam(choices, meta):
{
'type': "string",
'title': str(meta.get_field(
'jam_type').verbose_name.capitalize()),
'jam_type').related_model._meta.verbose_name.capitalize()),
'enum': list(JamType.objects.values_list('label', flat=True))
}
},
Expand Down Expand Up @@ -175,7 +175,7 @@ def get_fish_diseases(choices, meta):
{
'type': "string",
'title': str(meta.get_field(
'disease_type').verbose_name.capitalize()),
'disease_type').related_model._meta.verbose_name.capitalize()),
'enum': list(DiseaseType.objects.values_list('label', flat=True))
}
},
Expand All @@ -196,8 +196,7 @@ def get_fish_mortality(choices, meta):
if DeadSpecies.objects.exists():
fish_mortality_property['dead_species'] = {
'type': "string",
'title': str(meta.get_field(
'dead_species').verbose_name.capitalize()),
'title': _("Observed species"),
'enum': list(DeadSpecies.objects.values_list('label', flat=True))
}
fish_mortality = {
Expand Down Expand Up @@ -265,8 +264,7 @@ def get_invasive_species(choices, meta):
if InvasiveSpecies.objects.exists():
invasive_species_property['invasive_species'] = {
'type': "string",
'title': str(meta.get_field(
'invasive_species').verbose_name.capitalize()),
'title': _("Observed species"),
'enum': list(InvasiveSpecies.objects.values_list('label', flat=True))
}
invasive_species = {
Expand Down Expand Up @@ -294,15 +292,13 @@ def get_heritage_species(choices, meta):
if HeritageSpecies.objects.exists():
heritage_species_property['heritage_species'] = {
'type': "string",
'title': str(meta.get_field(
'heritage_species').verbose_name.capitalize()),
'title': _("Observed species"),
'enum': list(HeritageSpecies.objects.values_list('label', flat=True))
}
if HeritageObservation.objects.exists():
heritage_species_property['heritage_observation'] = {
'type': "string",
'title': str(meta.get_field(
'heritage_observation').verbose_name.capitalize()),
'title': _("Observation type"),
'enum': list(HeritageObservation.objects.values_list('label', flat=True))
}
heritage_species = {
Expand Down Expand Up @@ -330,8 +326,7 @@ def get_fish_species(choices, meta):
if FishSpecies.objects.exists():
fish_species_property['fish_species'] = {
'type': "string",
'title': str(meta.get_field(
'fish_species').verbose_name.capitalize()),
'title': _("Observed species"),
'enum': list(FishSpecies.objects.values_list('label', flat=True))
}
fish_species = {
Expand Down Expand Up @@ -430,14 +425,14 @@ def get_pollution(choices, meta):
pollution_property['nature_pollution'] = {
'type': "string",
'title': str(meta.get_field(
'nature_pollution').verbose_name.capitalize()),
'nature_pollution').related_model._meta.verbose_name.capitalize()),
'enum': list(NaturePollution.objects.values_list('label', flat=True))
}
if TypePollution.objects.exists():
pollution_property['type_pollution'] = {
'type': "string",
'title': str(meta.get_field(
'type_pollution').verbose_name.capitalize()),
'type_pollution').related_model._meta.verbose_name.capitalize()),
'enum': list(TypePollution.objects.values_list('label', flat=True))
}
pollution = {
Expand Down
17 changes: 11 additions & 6 deletions georiviere/portal/tests/data/json_schema_base_contribution.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
},
"dead_species": {
"type": "string",
"title": "Dead species",
"title": "Observed species",
"enum": [
"Dead species 0",
"Dead species 1",
Expand Down Expand Up @@ -194,7 +194,12 @@
"properties": {
"jam_type": {
"type": "string",
"title": "Jam type"
"title": "Jam type",
"enum": [
"Jam type 0",
"Jam type 1",
"Jam type 2"
]
}
}
}
Expand Down Expand Up @@ -262,7 +267,7 @@
},
"invasive_species": {
"type": "string",
"title": "Invasive species",
"title": "Observed species",
"enum": [
"Invasive species 0",
"Invasive species 1",
Expand All @@ -288,7 +293,7 @@
},
"heritage_species": {
"type": "string",
"title": "Heritage species",
"title": "Observed species",
"enum": [
"Heritage species 0",
"Heritage species 1",
Expand All @@ -297,7 +302,7 @@
},
"heritage_observation": {
"type": "string",
"title": "Heritage observation",
"title": "Observation type",
"enum": [
"Heritage observation 0",
"Heritage observation 1",
Expand All @@ -323,7 +328,7 @@
},
"fish_species": {
"type": "string",
"title": "Fish species",
"title": "Observed species",
"enum": [
"Fish species 0",
"Fish species 1",
Expand Down

0 comments on commit 3ee179c

Please sign in to comment.