// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class I18nApi {
    static async changeLanguage(data: string): Promise<number | Error> {
        const params =  String(data);
        return await fetch(`/control/i18n/change_language`, {
            method: 'POST',
            headers: {
                'Content-Type': 'text/plain',
            },
            body: params,
        }).then(async (res) => {
            if (res.status === 200) {
                return res.status;
            } else {
                return new Error(String(res.status));
            }
        })
    }

    static async currentLanguage(): Promise<number | Error> {
        return await fetch(`/control/i18n/current_language`, {
            method: 'GET',
        }).then(async (res) => {
            if (res.status === 200) {
                return res.status;
            } else {
                return new Error(String(res.status));
            }
        })
    }
}
