Merge pull request #9034 from colinux/editor-typo
Admin: corrige une typo dans une option de nombre de caractères limite
This commit is contained in:
commit
8592571b50
7 changed files with 16 additions and 12 deletions
|
@ -1,3 +1,4 @@
|
||||||
en:
|
en:
|
||||||
remaining_characters: You have %{remaining_words} characters remaining.
|
remaining_characters: You have %{remaining_words} characters remaining.
|
||||||
excess_characters: You have %{excess_words} characters too many.
|
excess_characters: You have %{excess_words} characters too many.
|
||||||
|
recommended_size: The recommended maximum size is %{size} characters.
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
fr:
|
fr:
|
||||||
remaining_characters: Il vous reste %{remaining_words} caractères.
|
remaining_characters: Il vous reste %{remaining_words} caractères.
|
||||||
excess_characters: Vous avez dépassé la taille conseillée de %{excess_words} caractères.
|
excess_characters: Vous avez dépassé la taille conseillée de %{excess_words} caractères. Réduire le nombre de caractère.
|
||||||
|
recommended_size: La taille maximale conseillée est de %{size} caractères.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
%span.sr-only= t('.recommended_size', size: @champ.character_limit_base)
|
||||||
|
|
||||||
~ @form.text_area :value,
|
~ @form.text_area :value,
|
||||||
id: @champ.input_id,
|
id: @champ.input_id,
|
||||||
aria: { describedby: @champ.describedby_id },
|
aria: { describedby: @champ.describedby_id },
|
||||||
|
@ -10,5 +12,5 @@
|
||||||
= t('.remaining_characters', remaining_words: @champ.remaining_characters)
|
= t('.remaining_characters', remaining_words: @champ.remaining_characters)
|
||||||
|
|
||||||
- if @champ.character_limit_warning?
|
- if @champ.character_limit_warning?
|
||||||
%span.fr-icon-close-circle-fill.fr-text-default--error.characters-count
|
%span.fr-icon-warning-fill.fr-text-default--warning.characters-count
|
||||||
= t('.excess_characters', excess_words: @champ.excess_characters)
|
= t('.excess_characters', excess_words: @champ.excess_characters)
|
||||||
|
|
|
@ -125,10 +125,10 @@ class TypesDeChampEditor::ChampComponent < ApplicationComponent
|
||||||
def options_for_character_limit
|
def options_for_character_limit
|
||||||
[
|
[
|
||||||
[t('.character_limit.unlimited'), nil],
|
[t('.character_limit.unlimited'), nil],
|
||||||
[t('.character_limit.limit', limit: 400), 400],
|
[t('.character_limit.limit', limit: '400'), 400],
|
||||||
[t('.character_limit.limit', limit: 1000), 1000],
|
[t('.character_limit.limit', limit: '1 000'), 1000],
|
||||||
[t('.character_limit.limit', limit: 5000), 5000],
|
[t('.character_limit.limit', limit: '5 000'), 5000],
|
||||||
[t('.character_limit.limit', limit: 10000), 10000]
|
[t('.character_limit.limit', limit: '10 000'), 10000]
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,5 +11,5 @@ fr:
|
||||||
zones_humides: Zones humides d’importance internationale
|
zones_humides: Zones humides d’importance internationale
|
||||||
znieff: ZNIEFF
|
znieff: ZNIEFF
|
||||||
character_limit:
|
character_limit:
|
||||||
unlimited: Pas de limite de charactères
|
unlimited: Pas de limite de caractère
|
||||||
limit: Limité à %{limit} caractères
|
limit: Limité à %{limit} caractères
|
||||||
|
|
|
@ -104,7 +104,7 @@
|
||||||
- if type_de_champ.textarea?
|
- if type_de_champ.textarea?
|
||||||
.cell
|
.cell
|
||||||
= form.label :character_limit, for: dom_id(type_de_champ, :character_limit) do
|
= form.label :character_limit, for: dom_id(type_de_champ, :character_limit) do
|
||||||
Spécifier un nombre maximal de caractères (non restrictif) :
|
Spécifier un nombre maximal conseillé de caractères :
|
||||||
= form.select :character_limit, options_for_character_limit, id: dom_id(type_de_champ, :character_limit)
|
= form.select :character_limit, options_for_character_limit, id: dom_id(type_de_champ, :character_limit)
|
||||||
|
|
||||||
- if type_de_champ.block?
|
- if type_de_champ.block?
|
||||||
|
|
|
@ -41,16 +41,16 @@ class Champs::TextareaChamp < Champs::TextChamp
|
||||||
analyze_character_count == :warning
|
analyze_character_count == :warning
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def character_limit_base
|
||||||
|
character_limit&.to_i
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def character_count
|
def character_count
|
||||||
return value&.bytesize
|
return value&.bytesize
|
||||||
end
|
end
|
||||||
|
|
||||||
def character_limit_base
|
|
||||||
character_limit&.to_i
|
|
||||||
end
|
|
||||||
|
|
||||||
def character_limit_threshold_75
|
def character_limit_threshold_75
|
||||||
character_limit_base * 0.75
|
character_limit_base * 0.75
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue