Merged in feat/SW-1956-add-English-caption-fallback (pull request #2574)

Feat/SW-1956 add English caption fallback

* feat(SW-1956): add English fallback to gallery caption

* feat(SW-1956): add English fallback to gallery caption


Approved-by: Anton Gunnarsson
This commit is contained in:
Matilda Landström
2025-07-29 06:12:57 +00:00
parent aabfa12007
commit 9679212864
5 changed files with 13 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
import type { GalleryImage } from "@/types/components/imageGallery"
import type { ImageVaultAsset } from "@scandic-hotels/trpc/types/imageVault"
import type { ApiImage } from "@scandic-hotels/trpc/types/hotel"
import type { ImageVaultAsset } from "@scandic-hotels/trpc/types/imageVault"
import type { GalleryImage } from "@/types/components/imageGallery"
function mapApiImageToGalleryImage(apiImage: ApiImage): GalleryImage {
return {
@@ -8,8 +9,9 @@ function mapApiImageToGalleryImage(apiImage: ApiImage): GalleryImage {
alt:
apiImage.metaData.altText ||
apiImage.metaData.altText_En ||
apiImage.metaData.title,
caption: apiImage.metaData.title,
apiImage.metaData.title ||
apiImage.metaData.title_En,
caption: apiImage.metaData.title || apiImage.metaData.title_En,
smallSrc: apiImage.imageSizes.small,
}
}