Completa i18n IT/EN/FR/DE/ES su sito pubblico, area autenticata e admin.
Tutte le view marketing, legali, viewer, dashboard e admin usano t(); mailer utente-facing e flash localizzati; admin con LocaleResolver e selettore lingua. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,16 +8,16 @@ module Public
|
||||
when "basket", "timed"
|
||||
live_score_period_label(match, score_state)
|
||||
when "timer"
|
||||
"Cronometro"
|
||||
t("score.timer_label")
|
||||
when "generic"
|
||||
"Punteggio"
|
||||
t("score.generic_label")
|
||||
else
|
||||
"Set #{score_state.current_set} · Set vinti #{score_state.home_sets}-#{score_state.away_sets}"
|
||||
t("score.sets_label", set: score_state.current_set, home: score_state.home_sets, away: score_state.away_sets)
|
||||
end
|
||||
end
|
||||
|
||||
def live_score_period_label(match, score_state)
|
||||
return "—" unless score_state
|
||||
return t("score.fallback") unless score_state
|
||||
|
||||
score_state.current_period_label
|
||||
end
|
||||
@@ -35,16 +35,16 @@ module Public
|
||||
def live_scheduled_label(datetime)
|
||||
return nil unless datetime
|
||||
|
||||
datetime.in_time_zone.strftime("%d/%m/%Y alle %H:%M")
|
||||
datetime.in_time_zone.strftime(t("score.scheduled_date_format"))
|
||||
end
|
||||
|
||||
def live_scheduled_relative(datetime)
|
||||
return nil unless datetime
|
||||
|
||||
if datetime.to_date == Time.zone.today
|
||||
"Oggi alle #{datetime.strftime('%H:%M')}"
|
||||
t("score.scheduled_today", time: datetime.strftime("%H:%M"))
|
||||
elsif datetime.to_date == Time.zone.tomorrow
|
||||
"Domani alle #{datetime.strftime('%H:%M')}"
|
||||
t("score.scheduled_tomorrow", time: datetime.strftime("%H:%M"))
|
||||
else
|
||||
live_scheduled_label(datetime)
|
||||
end
|
||||
@@ -52,7 +52,7 @@ module Public
|
||||
|
||||
def live_match_card_heading(match, link_team: true)
|
||||
team = match.team
|
||||
club_name = team.club&.name.presence || "Società"
|
||||
club_name = team.club&.name.presence || t("score.default_club_name")
|
||||
team_slug = team.respond_to?(:slug) ? team.slug : nil
|
||||
team_label = if link_team && team_slug.present?
|
||||
link_to(team.name, public_team_page_path(team_slug), class: "live-card__team-link")
|
||||
@@ -69,7 +69,7 @@ module Public
|
||||
|
||||
def live_match_page_heading(match)
|
||||
team = match.team
|
||||
club_name = team.club&.name.presence || "Società"
|
||||
club_name = team.club&.name.presence || t("score.default_club_name")
|
||||
content_tag(:div, class: "live-page-heading") do
|
||||
safe_join([
|
||||
content_tag(:p, club_name, class: "live-page-heading__club"),
|
||||
@@ -79,7 +79,7 @@ module Public
|
||||
end
|
||||
|
||||
def live_score_points_label(match, score_state)
|
||||
return "—" unless score_state
|
||||
return t("score.fallback") unless score_state
|
||||
|
||||
board = match.effective_board_type
|
||||
home = case board
|
||||
@@ -91,7 +91,7 @@ module Public
|
||||
else score_state.away_points
|
||||
end
|
||||
|
||||
"#{match.team.name} #{home} - #{away} #{match.opponent_name}"
|
||||
t("score.points_label", team: match.team.name, home: home, away: away, opponent: match.opponent_name)
|
||||
end
|
||||
|
||||
private
|
||||
@@ -101,8 +101,11 @@ module Public
|
||||
set_no = data[:set] || data["set"]
|
||||
home = data[:home] || data["home"]
|
||||
away = data[:away] || data["away"]
|
||||
label = set_no.present? ? "Set #{set_no}" : "Set"
|
||||
"#{label} #{home}-#{away}"
|
||||
if set_no.present?
|
||||
t("score.partial_entry", set: set_no, home: home, away: away)
|
||||
else
|
||||
t("score.partial_entry_no_number", home: home, away: away)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user