@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
46 lines (45 loc) • 1.61 kB
TypeScript
/**
* Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { App } from 'vue';
import { I18n } from 'vue-i18n';
import { LocaleConfig } from './types';
export declare class LocaleService {
static i18n: I18n;
private static config;
static setup(app: App, config?: Partial<LocaleConfig>): Promise<void>;
/**
* 获取当前语言
* @returns
*/
static getLocale(): string;
/**
* 默认加载的多语言值,返回中文值
* @param key
* @returns
*/
static getDefaultLocaleValue(locale: string, key: string): any;
static getLocaleValue(key: string, options?: any): any;
/**
* 属性空值或者有值但等于默认值,返回默认值多语言属性;有值但不相等返回当前属性自有值
* @param propertyValue
* @param defaultValue
* @param localeKey
* @returns
*/
static getRealPropertyValue(propertyValue: any, defaultValue: any, localeKey: any): any;
private static loadResources;
private static loadLocaleResources;
}