mirror of https://github.com/micromata/borgbackup-butler.git

Fin Reinhard
22.27.2019 910bf7b1c1e58c1b8dbe2ae7aeb362af5788a932
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import PropTypes from 'prop-types';
import {getTranslation} from '../../../utilities/i18n';
import {isDevelopmentMode} from '../../../utilities/global';
 
function I18n({name, children, params}) {
    return getTranslation(name, params) || (isDevelopmentMode() ? `??? ${children ? children : name} ???` : children);
}
 
I18n.propTypes = {
    name: PropTypes.string.isRequired,
    children: PropTypes.node,
    params: PropTypes.arrayOf(PropTypes.node)
};
 
I18n.defaultProps = {
    children: '',
    params: []
};
 
export default I18n;