Skip to content

Commit

Permalink
Mauvaise traduction
Browse files Browse the repository at this point in the history
Avec des tests plus complets.

A noter que les tests ne savent pas tester toutes les locales.
  • Loading branch information
ptitfred committed Oct 2, 2024
1 parent 30b78a6 commit e006c22
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
12 changes: 12 additions & 0 deletions apps/transport/lib/validators/gtfs_transport_validator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ defmodule Transport.Validators.GTFSTransport do
end
end

@doc """
iex> Gettext.put_locale("en")
iex> format_severity("Fatal", 1)
"1 fatal failure"
iex> format_severity("Fatal", 2)
"2 fatal failures"
iex> Gettext.put_locale("fr")
iex> format_severity("Fatal", 1)
"1 échec irrécupérable"
iex> format_severity("Fatal", 2)
"2 échecs irrécupérables"
"""
@spec format_severity(binary(), non_neg_integer()) :: binary()
def format_severity(key, count) do
case key do
Expand Down
12 changes: 12 additions & 0 deletions apps/transport/lib/validators/netex_validator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@ defmodule Transport.Validators.NeTEx do
end
end

@doc """
iex> Gettext.put_locale("en")
iex> format_severity("error", 1)
"1 error"
iex> format_severity("error", 2)
"2 errors"
iex> Gettext.put_locale("fr")
iex> format_severity("error", 1)
"1 erreur"
iex> format_severity("error", 2)
"2 erreurs"
"""
@spec format_severity(binary(), non_neg_integer()) :: binary()
def format_severity(key, count) do
case key do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,23 @@ msgstr "Temps d'arrêt négatif"
#, elixir-autogen, elixir-format, fuzzy
msgid "Error"
msgid_plural "Errors"
msgstr[0] "%{count} Erreurs"
msgstr[1] "%{count} Erreurs"
msgstr[0] "%{count} erreur"
msgstr[1] "%{count} erreurs"

#, elixir-autogen, elixir-format, fuzzy
msgid "Fatal failure"
msgid_plural "Fatal failures"
msgstr[0] "%{count} échecs irrécupérables"
msgstr[0] "%{count} échec irrécupérable"
msgstr[1] "%{count} échecs irrécupérables"

#, elixir-autogen, elixir-format, fuzzy
msgid "Information"
msgid_plural "Informations"
msgstr[0] "%{count} informations"
msgstr[0] "%{count} information"
msgstr[1] "%{count} informations"

#, elixir-autogen, elixir-format, fuzzy
msgid "Warning"
msgid_plural "Warnings"
msgstr[0] "%{count} avertissements"
msgstr[0] "%{count} avertissement"
msgstr[1] "%{count} avertissements"

0 comments on commit e006c22

Please sign in to comment.