本文整理汇总了TypeScript中@uifabric/utilities/lib/language.getLanguage函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getLanguage函数的具体用法?TypeScript getLanguage怎么用?TypeScript getLanguage使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getLanguage函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: _getFontFamily
function _getFontFamily(): string {
let language = getLanguage();
let fontFamily = FontFamilyWestEuropean;
for (let lang in LanguageToFontMap) {
if (LanguageToFontMap.hasOwnProperty(lang) && language && lang.indexOf(language) === 0) {
// tslint:disable-next-line:no-any
fontFamily = (LanguageToFontMap as any)[lang];
break;
}
}
return `${fontFamily}, ${FontFamilyFallbacks}`;
}
示例2: createFontStyles
import {
fontFace,
IFontWeight
} from '@uifabric/merge-styles/lib/index';
import {
IFontStyles
} from '../interfaces/index';
import { createFontStyles, FontWeights, LocalizedFontFamilies, LocalizedFontNames } from './fonts';
import { getLanguage } from '@uifabric/utilities/lib/language';
import { IFabricConfig } from '../interfaces/IFabricConfig';
// Default urls.
const DefaultBaseUrl = 'https://static2.sharepointonline.com/files/fabric/assets';
// Standard font styling.
export const DefaultFontStyles: IFontStyles = createFontStyles(getLanguage());
function _registerFontFace(
fontFamily: string,
url: string,
fontWeight?: IFontWeight,
localFontName?: string
): void {
fontFamily = `'${fontFamily}'`;
const localFontSrc = localFontName !== undefined ? `local('${localFontName}'),` : '';
fontFace({
fontFamily,
src:
localFontSrc +