Convert i18n resource to key type
This commit is contained in:
@@ -30,7 +30,7 @@ class BlockedDomains extends Component {
|
||||
);
|
||||
},
|
||||
}, {
|
||||
Header: <Trans>Requests count</Trans>,
|
||||
Header: <Trans>requests_count</Trans>,
|
||||
accessor: 'domain',
|
||||
maxWidth: 190,
|
||||
Cell: ({ value }) => {
|
||||
@@ -51,14 +51,14 @@ class BlockedDomains extends Component {
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
return (
|
||||
<Card title={ t('Top blocked domains') } subtitle={ t('for the last 24 hours') } bodyType="card-table" refresh={this.props.refreshButton}>
|
||||
<Card title={ t('top_blocked_domains') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}>
|
||||
<ReactTable
|
||||
data={map(this.props.topBlockedDomains, (value, prop) => (
|
||||
{ ip: prop, domain: value }
|
||||
))}
|
||||
columns={this.columns}
|
||||
showPagination={false}
|
||||
noDataText={ t('No domains found') }
|
||||
noDataText={ t('no_domains_found') }
|
||||
minRows={6}
|
||||
className="-striped -highlight card-table-overflow stats__table"
|
||||
/>
|
||||
|
||||
@@ -26,7 +26,7 @@ class Clients extends Component {
|
||||
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>),
|
||||
sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10),
|
||||
}, {
|
||||
Header: <Trans>Requests count</Trans>,
|
||||
Header: <Trans>requests_count</Trans>,
|
||||
accessor: 'count',
|
||||
Cell: ({ value }) => {
|
||||
const percent = getPercent(this.props.dnsQueries, value);
|
||||
@@ -41,14 +41,14 @@ class Clients extends Component {
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
return (
|
||||
<Card title={ t('Top clients') } subtitle={ t('for the last 24 hours') } bodyType="card-table" refresh={this.props.refreshButton}>
|
||||
<Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}>
|
||||
<ReactTable
|
||||
data={map(this.props.topClients, (value, prop) => (
|
||||
{ ip: prop, count: value }
|
||||
))}
|
||||
columns={this.columns}
|
||||
showPagination={false}
|
||||
noDataText={ t('No clients found') }
|
||||
noDataText={ t('no_clients_found') }
|
||||
minRows={6}
|
||||
className="-striped -highlight card-table-overflow"
|
||||
/>
|
||||
|
||||
@@ -8,13 +8,13 @@ import Tooltip from '../ui/Tooltip';
|
||||
const tooltipType = 'tooltip-custom--narrow';
|
||||
|
||||
const Counters = props => (
|
||||
<Card title={ props.t('General statistics') } subtitle={ props.t('for the last 24 hours') } bodyType="card-table" refresh={props.refreshButton}>
|
||||
<Card title={ props.t('general_statistics') } subtitle={ props.t('for_last_24_hours') } bodyType="card-table" refresh={props.refreshButton}>
|
||||
<table className="table card-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<Trans>DNS Queries</Trans>
|
||||
<Tooltip text={ props.t('A number of DNS quieries processed for the last 24 hours') } type={tooltipType} />
|
||||
<Trans>dns_query</Trans>
|
||||
<Tooltip text={ props.t('number_of_dns_query_24_hours') } type={tooltipType} />
|
||||
</td>
|
||||
<td className="text-right">
|
||||
<span className="text-muted">
|
||||
@@ -24,8 +24,8 @@ const Counters = props => (
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Trans>Blocked by</Trans> <a href="#filters"><Trans>Filters</Trans></a>
|
||||
<Tooltip text={ props.t('A number of DNS requests blocked by adblock filters and hosts blocklists') } type={tooltipType} />
|
||||
<Trans>blocked_by</Trans> <a href="#filters"><Trans>Filters</Trans></a>
|
||||
<Tooltip text={ props.t('number_of_dns_query_blocked_24_hours') } type={tooltipType} />
|
||||
</td>
|
||||
<td className="text-right">
|
||||
<span className="text-muted">
|
||||
@@ -35,8 +35,8 @@ const Counters = props => (
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Trans>Blocked malware/phishing</Trans>
|
||||
<Tooltip text={ props.t('A number of DNS requests blocked by the AdGuard browsing security module') } type={tooltipType} />
|
||||
<Trans>stats_malware_phishing</Trans>
|
||||
<Tooltip text={ props.t('number_of_dns_query_blocked_24_hours_by_sec') } type={tooltipType} />
|
||||
</td>
|
||||
<td className="text-right">
|
||||
<span className="text-muted">
|
||||
@@ -46,8 +46,8 @@ const Counters = props => (
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Trans>Blocked adult websites</Trans>
|
||||
<Tooltip text={ props.t('A number of adult websites blocked') } type={tooltipType} />
|
||||
<Trans>stats_adult</Trans>
|
||||
<Tooltip text={ props.t('number_of_dns_query_blocked_24_hours_adult') } type={tooltipType} />
|
||||
</td>
|
||||
<td className="text-right">
|
||||
<span className="text-muted">
|
||||
@@ -57,8 +57,8 @@ const Counters = props => (
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Trans>Enforced safe search</Trans>
|
||||
<Tooltip text={ props.t('A number of DNS requests to search engines for which Safe Search was enforced') } type={tooltipType} />
|
||||
<Trans>enforced_save_search</Trans>
|
||||
<Tooltip text={ props.t('number_of_dns_query_to_safe_search') } type={tooltipType} />
|
||||
</td>
|
||||
<td className="text-right">
|
||||
<span className="text-muted">
|
||||
@@ -68,8 +68,8 @@ const Counters = props => (
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<Trans>Average processing time</Trans>
|
||||
<Tooltip text={ props.t('Average time in milliseconds on processing a DNS request') } type={tooltipType} />
|
||||
<Trans>average_processing_time</Trans>
|
||||
<Tooltip text={ props.t('average_processing_time_hint') } type={tooltipType} />
|
||||
</td>
|
||||
<td className="text-right">
|
||||
<span className="text-muted">
|
||||
|
||||
@@ -39,7 +39,7 @@ class QueriedDomains extends Component {
|
||||
);
|
||||
},
|
||||
}, {
|
||||
Header: <Trans>Requests count</Trans>,
|
||||
Header: <Trans>requests_count</Trans>,
|
||||
accessor: 'count',
|
||||
maxWidth: 190,
|
||||
Cell: ({ value }) => {
|
||||
@@ -55,14 +55,14 @@ class QueriedDomains extends Component {
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
return (
|
||||
<Card title={ t('Top queried domains') } subtitle={ t('for the last 24 hours') } bodyType="card-table" refresh={this.props.refreshButton}>
|
||||
<Card title={ t('stats_query_domain') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}>
|
||||
<ReactTable
|
||||
data={map(this.props.topQueriedDomains, (value, prop) => (
|
||||
{ ip: prop, count: value }
|
||||
))}
|
||||
columns={this.columns}
|
||||
showPagination={false}
|
||||
noDataText={ t('No domains found') }
|
||||
noDataText={ t('no_domains_found') }
|
||||
minRows={6}
|
||||
className="-striped -highlight card-table-overflow stats__table"
|
||||
/>
|
||||
|
||||
@@ -31,7 +31,7 @@ class Statistics extends Component {
|
||||
{dnsQueries}
|
||||
</div>
|
||||
<div className="card-title-stats">
|
||||
<Trans>DNS Queries</Trans>
|
||||
<Trans>dns_query</Trans>
|
||||
</div>
|
||||
</div>
|
||||
<div className="card-chart-bg">
|
||||
@@ -49,7 +49,7 @@ class Statistics extends Component {
|
||||
{getPercent(dnsQueries, blockedFiltering)}
|
||||
</div>
|
||||
<div className="card-title-stats">
|
||||
<Trans>Blocked by</Trans> <a href="#filters"><Trans>Filters</Trans></a>
|
||||
<Trans>blocked_by</Trans> <a href="#filters"><Trans>Filters</Trans></a>
|
||||
</div>
|
||||
</div>
|
||||
<div className="card-chart-bg">
|
||||
@@ -67,7 +67,7 @@ class Statistics extends Component {
|
||||
{getPercent(dnsQueries, replacedSafebrowsing)}
|
||||
</div>
|
||||
<div className="card-title-stats">
|
||||
<Trans>Blocked malware/phishing</Trans>
|
||||
<Trans>stats_malware_phishing</Trans>
|
||||
</div>
|
||||
</div>
|
||||
<div className="card-chart-bg">
|
||||
@@ -85,7 +85,7 @@ class Statistics extends Component {
|
||||
{getPercent(dnsQueries, replacedParental)}
|
||||
</div>
|
||||
<div className="card-title-stats">
|
||||
<Trans>Blocked adult websites</Trans>
|
||||
<Trans>stats_adult</Trans>
|
||||
</div>
|
||||
</div>
|
||||
<div className="card-chart-bg">
|
||||
|
||||
@@ -26,12 +26,12 @@ class Dashboard extends Component {
|
||||
|
||||
getToggleFilteringButton = () => {
|
||||
const { protectionEnabled } = this.props.dashboard;
|
||||
const buttonText = protectionEnabled ? 'Disable' : 'Enable';
|
||||
const buttonText = protectionEnabled ? 'disable_protection' : 'enable_protection';
|
||||
const buttonClass = protectionEnabled ? 'btn-gray' : 'btn-success';
|
||||
|
||||
return (
|
||||
<button type="button" className={`btn btn-sm mr-2 ${buttonClass}`} onClick={() => this.props.toggleProtection(protectionEnabled)}>
|
||||
<Trans>{buttonText} protection</Trans>
|
||||
<Trans>{buttonText}</Trans>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -44,12 +44,12 @@ class Dashboard extends Component {
|
||||
dashboard.processingStatsHistory ||
|
||||
dashboard.processingTopStats;
|
||||
|
||||
const refreshFullButton = <button type="button" className="btn btn-outline-primary btn-sm" onClick={() => this.getAllStats()}><Trans>Refresh statistics</Trans></button>;
|
||||
const refreshFullButton = <button type="button" className="btn btn-outline-primary btn-sm" onClick={() => this.getAllStats()}><Trans>refresh_statics</Trans></button>;
|
||||
const refreshButton = <button type="button" className="btn btn-outline-primary btn-sm card-refresh" onClick={() => this.getAllStats()} />;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<PageTitle title={ t('Dashboard') }>
|
||||
<PageTitle title={ t('dashboard') }>
|
||||
<div className="page-title__actions">
|
||||
{this.getToggleFilteringButton()}
|
||||
{refreshFullButton}
|
||||
|
||||
@@ -18,8 +18,8 @@ class UserRules extends Component {
|
||||
const { t } = this.props;
|
||||
return (
|
||||
<Card
|
||||
title={ t('Custom filtering rules') }
|
||||
subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') }
|
||||
title={ t('custom_filter_rules') }
|
||||
subtitle={ t('custom_filter_rules_hint') }
|
||||
>
|
||||
<form onSubmit={this.handleSubmit}>
|
||||
<textarea className="form-control form-control--textarea-large" value={this.props.userRules} onChange={this.handleChange} />
|
||||
@@ -29,28 +29,28 @@ class UserRules extends Component {
|
||||
type="submit"
|
||||
onClick={this.handleSubmit}
|
||||
>
|
||||
<Trans>Apply</Trans>
|
||||
<Trans>apply_btn</Trans>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<hr/>
|
||||
<div className="list leading-loose">
|
||||
<Trans>Examples</Trans>:
|
||||
<Trans>examples_title</Trans>:
|
||||
<ol className="leading-loose">
|
||||
<li>
|
||||
<code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') }
|
||||
<code>||example.org^</code> - { t('example_meaning_filter_block') }
|
||||
</li>
|
||||
<li>
|
||||
<code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') }
|
||||
<code> @@||example.org^</code> - { t('example_meaning_filter_whitelist') }
|
||||
</li>
|
||||
<li>
|
||||
<code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') }
|
||||
<code>127.0.0.1 example.org</code> - { t('example_comment') }
|
||||
</li>
|
||||
<li>
|
||||
<code>{ t('! Here goes a comment') }</code> - { t('just a comment') }
|
||||
<code>{ t('example_comment') }</code> - { t('example_comment_meaning') }
|
||||
</li>
|
||||
<li>
|
||||
<code>{ t('# Also a comment') }</code> - { t('just a comment') }
|
||||
<code>{ t('example_comment_hash') }</code> - { t('example_comment_meaning') }
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
@@ -34,32 +34,32 @@ class Filters extends Component {
|
||||
};
|
||||
|
||||
columns = [{
|
||||
Header: this.props.t('Enabled'),
|
||||
Header: this.props.t('enabled_table_header'),
|
||||
accessor: 'enabled',
|
||||
Cell: this.renderCheckbox,
|
||||
width: 90,
|
||||
className: 'text-center',
|
||||
}, {
|
||||
Header: this.props.t('Name'),
|
||||
Header: this.props.t('name_table_header'),
|
||||
accessor: 'name',
|
||||
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>),
|
||||
}, {
|
||||
Header: this.props.t('Filter URL'),
|
||||
Header: this.props.t('filter_url_table_header'),
|
||||
accessor: 'url',
|
||||
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><a href={value} target='_blank' rel='noopener noreferrer' className="link logs__text">{value}</a></div>),
|
||||
}, {
|
||||
Header: this.props.t('Rules count'),
|
||||
Header: this.props.t('rules_count_table_header'),
|
||||
accessor: 'rulesCount',
|
||||
className: 'text-center',
|
||||
Cell: props => props.value.toLocaleString(),
|
||||
}, {
|
||||
Header: this.props.t('Last time updated'),
|
||||
Header: this.props.t('last_time_updated_table_header'),
|
||||
accessor: 'lastUpdated',
|
||||
className: 'text-center',
|
||||
}, {
|
||||
Header: this.props.t('Actions'),
|
||||
Header: this.props.t('actions_table_header'),
|
||||
accessor: 'url',
|
||||
Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
|
||||
Cell: ({ value }) => (<span title={ this.props.t('delete_table_action') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
|
||||
className: 'text-center',
|
||||
width: 75,
|
||||
sortable: false,
|
||||
@@ -71,24 +71,24 @@ class Filters extends Component {
|
||||
const { filters, userRules } = this.props.filtering;
|
||||
return (
|
||||
<div>
|
||||
<PageTitle title={ t('Filters') } />
|
||||
<PageTitle title={ t('filters') } />
|
||||
<div className="content">
|
||||
<div className="row">
|
||||
<div className="col-md-12">
|
||||
<Card
|
||||
title={ t('Filters and hosts blocklists') }
|
||||
subtitle={ t('AdGuard Home understands basic adblock rules and hosts files syntax.') }
|
||||
title={ t('filters_and_hosts') }
|
||||
subtitle={ t('filters_and_hosts_hint') }
|
||||
>
|
||||
<ReactTable
|
||||
data={filters}
|
||||
columns={this.columns}
|
||||
showPagination={false}
|
||||
noDataText={ t('No filters added') }
|
||||
noDataText={ t('no_filters_added') }
|
||||
minRows={4} // TODO find out what to show if rules.length is 0
|
||||
/>
|
||||
<div className="card-actions">
|
||||
<button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button>
|
||||
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button>
|
||||
<button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>add_filter_btn</Trans></button>
|
||||
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>cancel_btn</Trans></button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
@@ -106,8 +106,8 @@ class Filters extends Component {
|
||||
toggleModal={this.props.toggleFilteringModal}
|
||||
addFilter={this.props.addFilter}
|
||||
isFilterAdded={this.props.filtering.isFilterAdded}
|
||||
title={ t('New filter subscription') }
|
||||
inputDescription={ t('Enter a valid URL to a filter subscription or a hosts file.') }
|
||||
title={ t('new_filter_btn') }
|
||||
inputDescription={ t('enter_valid_filter_url') }
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -28,37 +28,37 @@ class Menu extends Component {
|
||||
<li className="nav-item border-bottom d-lg-none" onClick={this.toggleMenu}>
|
||||
<div className="nav-link nav-link--back">
|
||||
<svg className="nav-icon" fill="none" height="24" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="m19 12h-14"/><path d="m12 19-7-7 7-7"/></svg>
|
||||
<Trans>Back</Trans>
|
||||
<Trans>back</Trans>
|
||||
</div>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<NavLink to="/" exact={true} className="nav-link">
|
||||
<svg className="nav-icon" fill="none" height="24" stroke="#9aa0ac" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="m3 9 9-7 9 7v11a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2-2z"/><path d="m9 22v-10h6v10"/></svg>
|
||||
<Trans>Dashboard</Trans>
|
||||
<Trans>dashboard</Trans>
|
||||
</NavLink>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<NavLink to="/settings" className="nav-link">
|
||||
<svg className="nav-icon" fill="none" height="24" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="3"/><path d="m19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1 -2.83 0l-.06-.06a1.65 1.65 0 0 0 -1.82-.33 1.65 1.65 0 0 0 -1 1.51v.17a2 2 0 0 1 -2 2 2 2 0 0 1 -2-2v-.09a1.65 1.65 0 0 0 -1.08-1.51 1.65 1.65 0 0 0 -1.82.33l-.06.06a2 2 0 0 1 -2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0 -1.51-1h-.17a2 2 0 0 1 -2-2 2 2 0 0 1 2-2h.09a1.65 1.65 0 0 0 1.51-1.08 1.65 1.65 0 0 0 -.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33h.08a1.65 1.65 0 0 0 1-1.51v-.17a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0 -.33 1.82v.08a1.65 1.65 0 0 0 1.51 1h.17a2 2 0 0 1 2 2 2 2 0 0 1 -2 2h-.09a1.65 1.65 0 0 0 -1.51 1z"/></svg>
|
||||
<Trans>Settings</Trans>
|
||||
<Trans>settings</Trans>
|
||||
</NavLink>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<NavLink to="/filters" className="nav-link">
|
||||
<svg className="nav-icon" fill="none" height="24" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="m22 3h-20l8 9.46v6.54l4 2v-8.54z"/></svg>
|
||||
<Trans>Filters</Trans>
|
||||
<Trans>filters</Trans>
|
||||
</NavLink>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<NavLink to="/logs" className="nav-link">
|
||||
<svg className="nav-icon" fill="none" height="24" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="m14 2h-8a2 2 0 0 0 -2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-12z"/><path d="m14 2v6h6"/><path d="m16 13h-8"/><path d="m16 17h-8"/><path d="m10 9h-1-1"/></svg>
|
||||
<Trans>Query Log</Trans>
|
||||
<Trans>query_log</Trans>
|
||||
</NavLink>
|
||||
</li>
|
||||
<li className="nav-item">
|
||||
<a href={`${REPOSITORY.URL}/wiki`} className="nav-link" target="_blank" rel="noopener noreferrer">
|
||||
<svg className="nav-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#66b574" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12" y2="17"></line></svg>
|
||||
<Trans>FAQ</Trans>
|
||||
<Trans>faq</Trans>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -45,7 +45,7 @@ class Header extends Component {
|
||||
</Link>
|
||||
{!dashboard.proccessing && dashboard.isCoreRunning &&
|
||||
<span className={badgeClass}>
|
||||
<Trans>{dashboard.protectionEnabled ? 'ON' : 'OFF'}</Trans>
|
||||
<Trans>{dashboard.protectionEnabled ? 'on' : 'off'}</Trans>
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -57,10 +57,10 @@ class Logs extends Component {
|
||||
|
||||
if (userRules.match(preparedBlockingRule)) {
|
||||
this.props.setRules(userRules.replace(`${blockingRule}`, ''));
|
||||
this.props.addSuccessToast(`${t('Rule removed from the custom filtering rules')}: ${blockingRule}`);
|
||||
this.props.addSuccessToast(`${t('rule_removed_from_custom_filtering_toast')}: ${blockingRule}`);
|
||||
} else if (!userRules.match(preparedUnblockingRule)) {
|
||||
this.props.setRules(`${userRules}${lineEnding}${unblockingRule}\n`);
|
||||
this.props.addSuccessToast(`${t('Rule added to the custom filtering rules')}: ${unblockingRule}`);
|
||||
this.props.addSuccessToast(`${t('rule_added_to_custom_filtering_toast')}: ${unblockingRule}`);
|
||||
}
|
||||
|
||||
this.props.getFilteringStatus();
|
||||
@@ -68,7 +68,7 @@ class Logs extends Component {
|
||||
|
||||
renderBlockingButton(isFiltered, domain) {
|
||||
const buttonClass = isFiltered ? 'btn-outline-secondary' : 'btn-outline-danger';
|
||||
const buttonText = isFiltered ? 'Unblock' : 'Block';
|
||||
const buttonText = isFiltered ? 'ublock_btn' : 'block_btn';
|
||||
|
||||
return (
|
||||
<div className="logs__action">
|
||||
@@ -86,13 +86,13 @@ class Logs extends Component {
|
||||
renderLogs(logs) {
|
||||
const { t } = this.props;
|
||||
const columns = [{
|
||||
Header: t('Time'),
|
||||
Header: t('time_table_header'),
|
||||
accessor: 'time',
|
||||
maxWidth: 110,
|
||||
filterable: false,
|
||||
Cell: ({ value }) => (<div className="logs__row"><span className="logs__text" title={value}>{formatTime(value)}</span></div>),
|
||||
}, {
|
||||
Header: t('Domain name'),
|
||||
Header: t('domain_name_table_header'),
|
||||
accessor: 'domain',
|
||||
Cell: (row) => {
|
||||
const response = row.value;
|
||||
@@ -108,11 +108,11 @@ class Logs extends Component {
|
||||
);
|
||||
},
|
||||
}, {
|
||||
Header: t('Type'),
|
||||
Header: t('type_table_header'),
|
||||
accessor: 'type',
|
||||
maxWidth: 60,
|
||||
}, {
|
||||
Header: t('Response'),
|
||||
Header: t('response_table_header'),
|
||||
accessor: 'response',
|
||||
Cell: (row) => {
|
||||
const responses = row.value;
|
||||
@@ -126,7 +126,7 @@ class Logs extends Component {
|
||||
|
||||
if (reason === 'FilteredBlackList' || reason === 'NotFilteredWhiteList') {
|
||||
if (filterId === 0) {
|
||||
filterName = 'Custom filtering rules';
|
||||
filterName = 'custom_filter_rules';
|
||||
} else {
|
||||
const filterItem = Object.keys(filters)
|
||||
.filter(key => filters[key].id === filterId);
|
||||
@@ -159,7 +159,7 @@ class Logs extends Component {
|
||||
}
|
||||
return (
|
||||
<div className="logs__row">
|
||||
<span><Trans>Empty</Trans></span>
|
||||
<span><Trans>empty_response_status</Trans></span>
|
||||
{this.renderTooltip(isFiltered, rule, filterName)}
|
||||
</div>
|
||||
);
|
||||
@@ -177,8 +177,8 @@ class Logs extends Component {
|
||||
className="form-control"
|
||||
value={filter ? filter.value : 'all'}
|
||||
>
|
||||
<option value="all">{ t('Show all') }</option>
|
||||
<option value="filtered">{ t('Show filtered') }</option>
|
||||
<option value="all">{ t('show_all_filter_type') }</option>
|
||||
<option value="filtered">{ t('show_filtered_type') }</option>
|
||||
</select>,
|
||||
}, {
|
||||
Header: t('Client'),
|
||||
@@ -210,13 +210,13 @@ class Logs extends Component {
|
||||
defaultPageSize={50}
|
||||
minRows={7}
|
||||
// Text
|
||||
previousText={ t('Previous') }
|
||||
nextText={ t('Next') }
|
||||
loadingText={ t('Loading...') }
|
||||
pageText={ t('Page') }
|
||||
ofText={ t('of') }
|
||||
rowsText={ t('rows') }
|
||||
noDataText={ t('No logs found') }
|
||||
previousText={ t('previous_btn') }
|
||||
nextText={ t('next_btn') }
|
||||
loadingText={ t('loading_table_status') }
|
||||
pageText={ t('page_table_footer_text') }
|
||||
ofText={ t('of_table_footer_text') }
|
||||
rowsText={ t('rows_table_footer_text') }
|
||||
noDataText={ t('no_logs_found') }
|
||||
defaultFilterMethod={(filter, row) => {
|
||||
const id = filter.pivotId || filter.id;
|
||||
return row[id] !== undefined ?
|
||||
@@ -269,17 +269,17 @@ class Logs extends Component {
|
||||
className="btn btn-gray btn-sm mr-2"
|
||||
type="submit"
|
||||
onClick={() => this.props.toggleLogStatus(queryLogEnabled)}
|
||||
><Trans>Disable log</Trans></button>
|
||||
><Trans>disabled_log_btn</Trans></button>
|
||||
<button
|
||||
className="btn btn-primary btn-sm mr-2"
|
||||
type="submit"
|
||||
onClick={this.handleDownloadButton}
|
||||
><Trans>Download log file</Trans></button>
|
||||
><Trans>download_log_file_btn</Trans></button>
|
||||
<button
|
||||
className="btn btn-outline-primary btn-sm"
|
||||
type="submit"
|
||||
onClick={this.getLogs}
|
||||
><Trans>Refresh</Trans></button>
|
||||
><Trans>refresh_btn</Trans></button>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
@@ -289,7 +289,7 @@ class Logs extends Component {
|
||||
className="btn btn-success btn-sm mr-2"
|
||||
type="submit"
|
||||
onClick={() => this.props.toggleLogStatus(queryLogEnabled)}
|
||||
><Trans>Enable log</Trans></button>
|
||||
><Trans>enabled_log_btn</Trans></button>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ class Logs extends Component {
|
||||
const { queryLogEnabled } = dashboard;
|
||||
return (
|
||||
<Fragment>
|
||||
<PageTitle title={ t('Query Log') } subtitle={ t('Last 5000 DNS queries') }>
|
||||
<PageTitle title={ t('query_log') } subtitle={ t('last_5000_dns_queries') }>
|
||||
<div className="page-title__actions">
|
||||
{this.renderButtons(queryLogEnabled)}
|
||||
</div>
|
||||
|
||||
@@ -28,8 +28,8 @@ class Upstream extends Component {
|
||||
|
||||
return (
|
||||
<Card
|
||||
title={ t('Upstream DNS servers') }
|
||||
subtitle={ t('If you keep this field empty, AdGuard Home will use <a href="https://1.1.1.1/" target="_blank">Cloudflare DNS</a> as an upstream. Use tls:// prefix for DNS over TLS servers.') }
|
||||
title={ t('upstream_dns') }
|
||||
subtitle={ t('upstream_dns_hint') }
|
||||
bodyType="card-body box-body--settings"
|
||||
>
|
||||
<div className="row">
|
||||
@@ -46,14 +46,14 @@ class Upstream extends Component {
|
||||
type="button"
|
||||
onClick={this.handleTest}
|
||||
>
|
||||
<Trans>Test upstreams</Trans>
|
||||
<Trans>test_upstream_btn</Trans>
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-success btn-standart"
|
||||
type="submit"
|
||||
onClick={this.handleSubmit}
|
||||
>
|
||||
<Trans>Apply</Trans>
|
||||
<Trans>apply_btn</Trans>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -12,23 +12,23 @@ class Settings extends Component {
|
||||
settings = {
|
||||
filtering: {
|
||||
enabled: false,
|
||||
title: 'Block domains using filters and hosts files',
|
||||
subtitle: 'You can setup blocking rules in the <a href="#filters">Filters</a> settings.',
|
||||
title: 'block_domain_use_filters_and_hosts',
|
||||
subtitle: 'filters_block_toggle_hint',
|
||||
},
|
||||
safebrowsing: {
|
||||
enabled: false,
|
||||
title: 'Use AdGuard browsing security web service',
|
||||
subtitle: 'AdGuard Home will check if domain is blacklisted by the browsing security web service. It will use privacy-friendly lookup API to perform the check: only a short prefix of the domain name SHA256 hash is sent to the server.',
|
||||
title: 'use_adguard_browsing_sec',
|
||||
subtitle: 'use_adguard_browsing_sec_hint',
|
||||
},
|
||||
parental: {
|
||||
enabled: false,
|
||||
title: 'Use AdGuard parental control web service',
|
||||
subtitle: 'AdGuard Home will check if domain contains adult materials. It uses the same privacy-friendly API as the browsing security web service.',
|
||||
title: 'use_adguard_parental',
|
||||
subtitle: 'use_adguard_parental_hint',
|
||||
},
|
||||
safesearch: {
|
||||
enabled: false,
|
||||
title: 'Enforce safe search',
|
||||
subtitle: 'AdGuard Home can enforce safe search in the following search engines: Google, Bing, Yandex.',
|
||||
title: 'enforce_safe_search',
|
||||
subtitle: 'enforce_save_search_hint',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ class Settings extends Component {
|
||||
if (this.props.dashboard.upstreamDns.length > 0) {
|
||||
this.props.testUpstream(this.props.dashboard.upstreamDns);
|
||||
} else {
|
||||
this.props.addErrorToast({ error: this.props.t('No servers specified') });
|
||||
this.props.addErrorToast({ error: this.props.t('no_servers_specified') });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ class Settings extends Component {
|
||||
});
|
||||
}
|
||||
return (
|
||||
<div><Trans>No settings</Trans></div>
|
||||
<div><Trans>no_settings</Trans></div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -74,13 +74,13 @@ class Settings extends Component {
|
||||
const { upstreamDns } = this.props.dashboard;
|
||||
return (
|
||||
<Fragment>
|
||||
<PageTitle title={ t('Settings') } />
|
||||
<PageTitle title={ t('settings') } />
|
||||
{settings.processing && <Loading />}
|
||||
{!settings.processing &&
|
||||
<div className="content">
|
||||
<div className="row">
|
||||
<div className="col-md-12">
|
||||
<Card title={ t('General settings') } bodyType="card-body box-body--settings">
|
||||
<Card title={ t('general_settings') } bodyType="card-body box-body--settings">
|
||||
<div className="form">
|
||||
{this.renderSettings(settings.settingsList)}
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Trans, withNamespaces } from 'react-i18next';
|
||||
import { REPOSITORY } from '../../helpers/constants';
|
||||
import i18n from '../../i18n';
|
||||
import i18n, { languages } from '../../i18n';
|
||||
|
||||
class Footer extends Component {
|
||||
getYear = () => {
|
||||
@@ -9,8 +9,8 @@ class Footer extends Component {
|
||||
return today.getFullYear();
|
||||
};
|
||||
|
||||
changeLanguage = () => {
|
||||
i18n.changeLanguage(i18n.language === 'en' ? 'vi' : 'en');
|
||||
changeLanguage = (event) => {
|
||||
i18n.changeLanguage(event.target.value);
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -23,22 +23,24 @@ class Footer extends Component {
|
||||
<div className="col-auto">
|
||||
Copyright © {this.getYear()} <a href="https://adguard.com/">AdGuard</a>
|
||||
</div>
|
||||
<div className="col-auto">
|
||||
<select className="form-control" value={i18n.language} onChange={this.changeLanguage}>
|
||||
{ languages.map(language => <option
|
||||
key={language.key} value={language.key}>
|
||||
{language.name}
|
||||
</option>) }
|
||||
</select>
|
||||
</div>
|
||||
<div className="col-auto">
|
||||
<ul className="list-inline text-center mb-0">
|
||||
<li className="list-inline-item">
|
||||
<a href={REPOSITORY.URL} target="_blank" rel="noopener noreferrer"><Trans>Homepage</Trans></a>
|
||||
<a href={REPOSITORY.URL} target="_blank" rel="noopener noreferrer"><Trans>homepage</Trans></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div className="col-auto">
|
||||
<button className="btn btn-outline-info btn-sm" onClick={this.changeLanguage}
|
||||
title={i18n.language === 'en' ? 'Chuyển sang Tiếng Việt' : 'Change to English'}>
|
||||
{i18n.language === 'en' ? 'English' : 'Tiếng Việt'}
|
||||
</button>
|
||||
</div>
|
||||
<div className="col-auto">
|
||||
<a href={`${REPOSITORY.URL}/issues/new`} className="btn btn-outline-primary btn-sm" target="_blank" rel="noopener noreferrer">
|
||||
<Trans>Report an issue</Trans>
|
||||
<Trans>report_an_issue</Trans>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -71,8 +71,8 @@ class Modal extends Component {
|
||||
if (!this.props.isFilterAdded) {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<input type="text" className={inputNameClass} placeholder={ this.props.t('Enter name') } onChange={this.handleNameChange} />
|
||||
<input type="text" className={inputUrlClass} placeholder={ this.props.t('Enter URL') } onChange={this.handleUrlChange} />
|
||||
<input type="text" className={inputNameClass} placeholder={ this.props.t('enter_name_hint') } onChange={this.handleNameChange} />
|
||||
<input type="text" className={inputUrlClass} placeholder={ this.props.t('enter_url_hint') } onChange={this.handleUrlChange} />
|
||||
{inputDescription &&
|
||||
<div className="description">
|
||||
{inputDescription}
|
||||
@@ -111,8 +111,8 @@ class Modal extends Component {
|
||||
{
|
||||
!this.props.isFilterAdded &&
|
||||
<div className="modal-footer">
|
||||
<button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>Cancel</Trans></button>
|
||||
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>Add filter</Trans></button>
|
||||
<button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>cancel_btn</Trans></button>
|
||||
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>add_filter_btn</Trans></button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -14,13 +14,13 @@ class Popover extends Component {
|
||||
|
||||
const source = (
|
||||
<div className="popover__list-item">
|
||||
<Trans>Source</Trans>: <a className="popover__link" target="_blank" rel="noopener noreferrer" href={sourceData.url}><strong>{sourceData.name}</strong></a>
|
||||
<Trans>source_label</Trans>: <a className="popover__link" target="_blank" rel="noopener noreferrer" href={sourceData.url}><strong>{sourceData.name}</strong></a>
|
||||
</div>
|
||||
);
|
||||
|
||||
const tracker = (
|
||||
<div className="popover__list-item">
|
||||
<Trans>Name</Trans>: <a className="popover__link" target="_blank" rel="noopener noreferrer" href={data.url}><strong>{data.name}</strong></a>
|
||||
<Trans>name_table_header</Trans>: <a className="popover__link" target="_blank" rel="noopener noreferrer" href={data.url}><strong>{data.name}</strong></a>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -34,11 +34,12 @@ class Popover extends Component {
|
||||
<div className="popover__body">
|
||||
<div className="popover__list">
|
||||
<div className="popover__list-title">
|
||||
<Trans>Found in the known domains database.</Trans>
|
||||
<Trans>found_in_known_domain_db</Trans>
|
||||
</div>
|
||||
{tracker}
|
||||
<div className="popover__list-item">
|
||||
<Trans>Category</Trans>: <strong><Trans>{categoryName}</Trans></strong>
|
||||
<Trans>category_label</Trans>: <strong>
|
||||
<Trans>{categoryName}</Trans></strong>
|
||||
</div>
|
||||
{source}
|
||||
</div>
|
||||
|
||||
@@ -14,10 +14,10 @@ class PopoverFilter extends Component {
|
||||
<div className="popover__body popover__body--filter">
|
||||
<div className="popover__list">
|
||||
<div className="popover__list-item popover__list-item--nowrap">
|
||||
<Trans>Rule</Trans>: <strong>{this.props.rule}</strong>
|
||||
<Trans>rule_label</Trans>: <strong>{this.props.rule}</strong>
|
||||
</div>
|
||||
{this.props.filter && <div className="popover__list-item popover__list-item--nowrap">
|
||||
<Trans>Filter</Trans>: <strong>{this.props.filter}</strong>
|
||||
<Trans>filter_label</Trans>: <strong>{this.props.filter}</strong>
|
||||
</div>}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user