refactor: update weather art descriptions

- Change description to use @weather_art.prompt instead of
  a translated string with multiple parameters.
- Update image_alt method to include the prompt in the
  descriptive text.

These changes simplify the metadata generation for weather art and
improve the clarity of the image descriptions by incorporating the
prompt, which may provide users with additional context.
This commit is contained in:
songtianlun 2025-04-12 15:28:47 +08:00
parent 7bdf40e176
commit 43ae514242
2 changed files with 6 additions and 5 deletions

View File

@ -21,10 +21,11 @@ class WeatherArtsController < ApplicationController
title: t("meta.weather_arts.show.title",
city_name: @city.name,
date: formatted_date),
description: t("meta.weather_arts.show.description",
city_name: @city.name,
description: @weather_art.description,
temperature: @weather_art.temperature),
description: @weather_art.prompt,
# description: t("meta.weather_arts.show.description",
# city_name: @city.name,
# description: @weather_art.description,
# temperature: @weather_art.temperature),
keywords: t("meta.weather_arts.show.keywords",
city_name: @city.name,
country_name: @city.country.name,

View File

@ -168,7 +168,7 @@ class WeatherArt < ApplicationRecord
end
def image_alt
"#{self.city.full_name} Weather Art - #{self.description} at #{self.temperature}°C on #{self.formatted_time(:date)}"
"#{self.city.full_name} Weather Art - #{self.description} at #{self.temperature}°C on #{self.formatted_time(:date)}, #{self.prompt}"
end
private