• create i18n

    Type Parameters

    • T extends Record<string, any>

    Parameters

    • data: {
          en: undefined | T;
          ru: undefined | T;
          zh-CN: undefined | T;
          zh-TW: undefined | T;
      }

      language data

      • en: undefined | T
      • ru: undefined | T
      • zh-CN: undefined | T
      • zh-TW: undefined | T
    • defaultLanguage:
          | "en"
          | "zh-CN"
          | "zh-TW"
          | "ru" = 'en'

      default language

    Returns {
        $$t: ((path: keyof Flat<T, "">, ...args: string[]) => string);
        $t: Ref<((path: keyof Flat<T, "">, ...args: string[]) => string), ((path: keyof Flat<T, "">, ...args: string[]) => string)>;
        t: ((path: keyof Flat<T, "">, ...args: string[]) => string);
    }

    • $$t: ((path: keyof Flat<T, "">, ...args: string[]) => string)
        • (path, ...args): string
        • Parameters

          • path: keyof Flat<T, "">
          • Rest...args: string[]

          Returns string

    • $t: Ref<((path: keyof Flat<T, "">, ...args: string[]) => string), ((path: keyof Flat<T, "">, ...args: string[]) => string)>
    • t: ((path: keyof Flat<T, "">, ...args: string[]) => string)
        • (path, ...args): string
        • Parameters

          • path: keyof Flat<T, "">
          • Rest...args: string[]

          Returns string