<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ### Summary by CodeRabbit - Refactor: Transitioned to a new translation library (`@tolgee/react`) across the application, enhancing the localization capabilities and consistency. - New Feature: Introduced a JSON configuration file for application settings, improving customization and flexibility. - Refactor: Updated SVG attribute naming convention in the `WhatsAppLogo` component to align with React standards. - Chore: Adjusted the `.gitignore` file and added a new line at the end. - Documentation: Added instructions for setting up environment variables for the Tolgee i18n contribution dev tool, improving the self-hosting configuration guide. - Style: Updated the `CollaborationMenuButton` to hide the `PopoverContent` component by scaling it down to zero. - Refactor: Simplified error handling logic for fetching and updating typebots in `TypebotProvider.tsx`, improving code readability and maintenance. - Refactor: Removed the dependency on the `parseGroupTitle` function, simplifying the code in several components. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
27 lines
728 B
TypeScript
27 lines
728 B
TypeScript
import type en from './src/locales/en.json'
|
|
|
|
declare module '@tolgee/core/lib/types' {
|
|
type TranslationsType = typeof en
|
|
|
|
// ensures that nested keys are accessible with "."
|
|
type DotNotationEntries<T> = T extends object
|
|
? {
|
|
[K in keyof T]: `${K & string}${T[K] extends undefined
|
|
? ''
|
|
: T[K] extends object
|
|
? `.${DotNotationEntries<T[K]>}`
|
|
: ''}`
|
|
}[keyof T]
|
|
: ''
|
|
|
|
// enables both intellisense and new keys without an error
|
|
type LiteralUnion<LiteralType extends BaseType, BaseType extends Primitive> =
|
|
| LiteralType
|
|
| (BaseType & { _?: never })
|
|
|
|
export type TranslationKey = LiteralUnion<
|
|
DotNotationEntries<TranslationsType>,
|
|
string
|
|
>
|
|
}
|