move footer_notice from lang files to source code

This commit is contained in:
Kaaninchen
2026-08-23 16:09:52 +02:00
parent 10b6ee560e
commit dc2f9dade0
4 changed files with 7 additions and 16 deletions
-2
View File
@@ -4,8 +4,6 @@ channel:
train_via: "{train_name} to {goes_to} via {from_station}"
short_name: "{train_name} to {goes_to}"
embeds:
footer:
notice: "Data provided by https://transitous.org/sources/ • Maps (C) CARTO (C) OpenStreetMap.org contributors"
info:
description: "Departure from {station} at {departure}. Arrival by {arrival}"
via: "via"
+4 -4
View File
@@ -7,8 +7,8 @@ from src.lang.locales import lang
lang_embed = lang.embeds
def build_embed_footer(mode: str, slogans):
footer_notice = f"{lang.embeds.footer.notice()} • mode: {mode}"
def build_embed_footer(slogans):
footer_notice = f"https://transitous.org/sources/ • Maps (C) CARTO (C) OpenStreetMap.org contributors"
icon = "https://raw.githubusercontent.com/kaaninchen/Gleiswechsel/refs/heads/main/src/data/assets/transitous-logo.png"
if slogans is not None:
@@ -55,7 +55,7 @@ def build_info_embed() -> discord.Embed:
for field_name, field_value in route_fields:
embed.add_field(name=field_name, value=field_value, inline=False)
footer = build_embed_footer(trip["mode"], metadata["slogans"])
footer = build_embed_footer(metadata["slogans"])
embed.set_footer(text=footer["text"], icon_url=footer["icon"])
embed.set_author(name=agency)
@@ -78,7 +78,7 @@ def build_announcement_embed(msg):
embed.set_author(name=agency)
embed.set_thumbnail(url=metadata["logo"])
footer = build_embed_footer(trip["mode"], metadata.get("slogan"))
footer = build_embed_footer(metadata.get("slogan"))
embed.set_footer(text=footer["text"], icon_url=footer["icon"])
return embed
+1 -7
View File
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: en.yaml
# timestamp: 2026-08-20T10:40:43+00:00
# timestamp: 2026-08-23T14:08:25+00:00
from __future__ import annotations
@@ -19,11 +19,6 @@ class Channel:
short_name: str
@dataclass
class Footer:
notice: str
@dataclass
class Info:
description: str
@@ -45,7 +40,6 @@ class Announcement:
@dataclass
class Embeds:
footer: Footer
info: Info
announcement: Announcement