// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

/**
 * Service provides internationalization and localization.
 * It is the primary entrypoint for the i18n package.
 * @module
 */

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as i18n$0 from "../../../../nicksnyder/go-i18n/v2/i18n/models.js";

/**
 * AvailableLanguages returns a list of available language codes.
 */
export function AvailableLanguages(): $CancellablePromise<string[]> {
    return $Call.ByID(3797911080).then(($result: any) => {
        return $$createType0($result);
    });
}

/**
 * GetAllMessages returns all translation messages for the specified language.
 * The keys are message IDs and values are the translated strings.
 * If lang is empty, it uses the current language.
 */
export function GetAllMessages(lang: string): $CancellablePromise<{ [_: string]: string }> {
    return $Call.ByID(497958721, lang).then(($result: any) => {
        return $$createType1($result);
    });
}

/**
 * SetBundle is a test helper to inject a bundle.
 */
export function SetBundle(bundle: i18n$0.Bundle | null): $CancellablePromise<void> {
    return $Call.ByID(2373446086, bundle);
}

/**
 * SetLanguage sets the language for the i18n service.
 * The language tag should be a valid BCP 47 language tag (e.g., "en", "en-US").
 * If the language is not supported, an error is returned.
 */
export function SetLanguage(lang: string): $CancellablePromise<void> {
    return $Call.ByID(1882213732, lang);
}

/**
 * Translate translates a message by its ID.
 * It accepts an optional template data argument to interpolate into the translation.
 * If the message is not found, the message ID is returned.
 */
export function Translate(messageID: string, ...args: any[]): $CancellablePromise<string> {
    return $Call.ByID(1625170060, messageID, args);
}

// Private type creation functions
const $$createType0 = $Create.Array($Create.Any);
const $$createType1 = $Create.Map($Create.Any, $Create.Any);
