How to use the umi/locale.formatMessage function in umi

To help you get started, we’ve selected a few umi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gangtao / dataplay3 / client / src / components / GlobalHeader / RightContent.js View on Github external
className={styles.action}
          >
            
          
        
         {
            console.log(item, tabProps); // eslint-disable-line
            this.changeReadState(item, tabProps);
          }}
          locale={{
            emptyText: formatMessage({ id: 'component.noticeIcon.empty' }),
            clear: formatMessage({ id: 'component.noticeIcon.clear' }),
            loadedAll: formatMessage({ id: 'component.noticeIcon.loaded' }),
            loadMore: formatMessage({ id: 'component.noticeIcon.loading-more' }),
          }}
          onClear={onNoticeClear}
          onLoadMore={this.fetchMoreNotices}
          onPopupVisibleChange={onNoticeVisibleChange}
          loading={fetchingNotices}
          clearClose
        >
github zhang8043 / abp-react-antd / Precise-Antd / src / components / GlobalHeader / RightContent.js View on Github external
>
            
          
        
         {
            console.log(item, tabProps); // eslint-disable-line
            this.changeReadState(item, tabProps);
          }}
          locale={{
            emptyText: formatMessage({ id: 'component.noticeIcon.empty' }),
            clear: formatMessage({ id: 'component.noticeIcon.clear' }),
            loadedAll: formatMessage({ id: 'component.noticeIcon.loaded' }),
            loadMore: formatMessage({ id: 'component.noticeIcon.loading-more' }),
          }}
          onClear={onNoticeClear}
          onLoadMore={this.fetchMoreNotices}
          onPopupVisibleChange={onNoticeVisibleChange}
          loading={fetchingNotices}
          clearClose
        >
github kuhami / react-ant / src / components / SettingDrawer / index.js View on Github external
this.changeSetting('primaryColor', color)}
          />

          

          
             this.changeSetting('layout', value)}
            />
github mojisrc / fashop-admin / src / components / settingDrawer / index.js View on Github external
)
            },
            {
                title: formatMessage({ id: "app.setting.fixedheader" }),
                action: (
github kuhami / react-ant / src / layouts / BasicLayout.js View on Github external
getPageTitle = (pathname, breadcrumbNameMap) => {
    const currRouterData = this.matchParamsPath(pathname, breadcrumbNameMap);

    if (!currRouterData) {
      return 'Ant Tabs';
    }
    const pageName = formatMessage({
      id: currRouterData.locale || currRouterData.name,
      defaultMessage: currRouterData.name,
    });

    return `${pageName} - Ant Tabs`;
  };
github VKSRC / Github-Monitor / client / src / pages / Tasks / TaskModal.js View on Github external
{getFieldDecorator('mail', {
                initialValue: mail,
              })(<input>)}
            
            
              {getFieldDecorator('pages', {
                initialValue: pages,
              })()}
            
            
              {getFieldDecorator('interval', {
                initialValue: interval,
              })()}
            
          
        
      
    );
  }
}
github umijs / umi-blocks / ant-design-pro / UserRegister / src / index.js View on Github external
value={prefix}
                onChange={this.changePrefix}
                style={{ width: '20%' }}
              &gt;
                <option value="86">+86</option>
                <option value="87">+87</option>
              
              {getFieldDecorator('mobile', {
                rules: [
                  {
                    required: true,
                    message: formatMessage({ id: 'BLOCK_NAME.phone-number.required' }),
                  },
                  {
                    pattern: /^\d{11}$/,
                    message: formatMessage({ id: 'BLOCK_NAME.phone-number.wrong-format' }),
                  },
                ],
              })(
                <input placeholder="{formatMessage({" style="{{" size="large">
              )}
            
          
          
            
              
                {getFieldDecorator('captcha', {
                  rules: [
github tangtanglove / fullstack-backend / resources / app / src / pages / Auth / Login.js View on Github external
placeholder={`${formatMessage({ id: 'app.login.password' })}`}
              rules={[
                {
                  required: true,
                  message: formatMessage({ id: 'validation.password.required' }),
                },
              ]}
              onPressEnter={() =&gt; this.loginForm.validateFields(this.handleSubmit)}
            /&gt;
          
          
            {login.status === 'error' &amp;&amp;
              login.type === 'mobile' &amp;&amp;
              !submitting &amp;&amp;
              this.renderMessage(
                formatMessage({ id: 'app.login.message-invalid-verification-code' })
              )}
github ZhiXiao-Lin / nestify / admin / src / global.js View on Github external
return true;
		};
		const key = `open${Date.now()}`;
		const btn = (
			<button type="primary"> {
					notification.close(key);
					reloadSW();
				}}
			&gt;
				{formatMessage({ id: 'app.pwa.serviceworker.updated.ok' })}
			</button>
		);
		notification.open({
			message: formatMessage({ id: 'app.pwa.serviceworker.updated' }),
			description: formatMessage({ id: 'app.pwa.serviceworker.updated.hint' }),
			btn,
			key,
			onClose: async () =&gt; {}
		});
	});
}
github cjbi / weshop / weshop-admin-ui / src / layouts / BasicLayout.js View on Github external
getPageTitle = pathname => {
    const currRouterData = this.matchParamsPath(pathname);

    if (!currRouterData) {
      return 'Ant Design Pro';
    }
    const message = formatMessage({
      id: currRouterData.locale || currRouterData.name,
      defaultMessage: currRouterData.name,
    });
    return `${message} - Ant Design Pro`;
  };