mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-03 14:32:56 +03:00
Convert i18n resource to key type
This commit is contained in:
parent
beab9a1be0
commit
d47a23269d
22 changed files with 389 additions and 366 deletions
client/src/components/Logs
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue