feat(SW-706): add Lokalise tooling and codemod

This commit is contained in:
Michael Zetterberg
2025-03-12 07:02:49 +01:00
parent 1c5b116ed8
commit e22fc1f3c8
26 changed files with 1478 additions and 130 deletions

16
apps/scandic-web/types/intl.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
// import type { MessageDescriptor } from "@formatjs/intl"
// Module augmentation
declare module "@formatjs/intl" {
// We are unable to override description field on MessageDescriptor from formatjs.
// Module augmentation does not allow for that. But we leave it here for reference.
// Instead we export our own LokaliseMessageDescriptor and use that where we control the code.
// For example in our custom formatter in i18n/formatter.ts
// interface MessageDescriptor {
// description?: {
// context?: string
// limit?: number
// tags?: string[]
// }
// }
}

View File

@@ -0,0 +1,10 @@
import type { MessageDescriptor } from "@formatjs/intl"
export interface LokaliseMessageDescriptor
extends Omit<MessageDescriptor, "description"> {
description: {
context?: string
limit?: number
tags?: string
}
}