本文整理汇总了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}`;
}
开发者ID:amkronen,项目名称:office-ui-fabric-react,代码行数:14,代码来源:DefaultFontStyles.ts
示例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 +
开发者ID:zoarif,项目名称:office-ui-fabric-react,代码行数:31,代码来源:DefaultFontStyles.ts
注:本文中的@uifabric/utilities/lib/language.getLanguage函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论