--- import { getLanguageFromURL, useTranslation } from "@root/i18n/utils"; import { createRelativeArticleUrl } from "@root/utils"; import { Article_TranslationsQuery } from "../graphql/graphql"; export interface Props { articles: Article_TranslationsQuery["article_translations"][0]["article_id"]; } const pageLang = getLanguageFromURL(Astro.url.pathname); const t = useTranslation(Astro); const { articles } = Astro.props; --- { articles && articles.translations && articles.translations?.length !== 1 && (
{t("article.availableOn")}:{" "} {articles.translations .filter((a) => a && a.languages_code?.code.split("-")[0] !== pageLang) .map( (a) => a && ( {`${a.languages_code?.name}`} ) )}
) }