本文整理匯總了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 +