Skip to content

Commit

Permalink
site: add warning for not translated articles, close: ant-design#5404
Browse files Browse the repository at this point in the history
  • Loading branch information
benjycui committed May 17, 2017
1 parent 0b332f0 commit 067d1af
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion site/theme/template/Content/Article.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { PropTypes, Children, cloneElement } from 'react';
import { FormattedMessage } from 'react-intl';
import DocumentTitle from 'react-document-title';
import { getChildren } from 'jsonml.js/lib/utils';
import { Timeline } from 'antd';
import { Timeline, Alert } from 'antd';
import delegate from 'delegate';
import EditButton from './EditButton';
import * as utils from '../utils';
Expand Down Expand Up @@ -72,9 +72,21 @@ export default class Article extends React.Component {
const { meta, description } = content;
const { title, subtitle, filename } = meta;
const locale = this.context.intl.locale;
const isNotTranslated = locale === 'en-US' && typeof title === 'object';
return (
<DocumentTitle title={`${title[locale] || title} - Ant Design`}>
<article className="markdown" ref={(node) => { this.node = node; }}>
{isNotTranslated && (
<Alert
type="warning"
message={(
<span>
This article has not been translated, hope that your can PR to translated it.
<a href="https://github.com/ant-design/ant-design/issues/1471"> more</a>
</span>
)}
/>
)}
<h1>
{title[locale] || title}
{
Expand Down

0 comments on commit 067d1af

Please sign in to comment.