Skip to content

Commit

Permalink
Localization for goaccess settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dshook committed Nov 1, 2024
1 parent b57edb4 commit 7e3450a
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/containers/monitoring/GoAccessInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class GoAccessInfo extends ApiComponent<
<b>
{localize(
'goaccess.logs_location',
'Access logs are available on each app details page'
'View access logs on the app details page'
)}
</b>
</p>
Expand Down
92 changes: 72 additions & 20 deletions src/containers/monitoring/GoAccessSettingsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,71 @@ export default class GoAccessSettingsForm extends Component<
}

rotationFrequencyOptions = [
{ value: '0 0 * * 0', label: 'Weekly' },
{ value: '0 0 1 * *', label: 'Monthly' },
{ value: '0 0 1 */2 *', label: 'Every 2 Months' },
{ value: '0 0 1 */4 *', label: 'Every 4 Months' },
{ value: CUSTOM, label: 'Custom' },
{
value: '0 0 * * 0',
label: localize('goaccess_settings.weekly', 'Weekly'),
},
{
value: '0 0 1 * *',
label: localize('goaccess_settings.monthly', 'Monthly'),
},
{
value: '0 0 1 */2 *',
label: localize(
'goaccess_settings.every_2_months',
'Every 2 Months'
),
},
{
value: '0 0 1 */4 *',
label: localize(
'goaccess_settings.every_4_months',
'Every 4 Months'
),
},
{
value: CUSTOM,
label: localize('goaccess_settings.custom', 'Custom'),
},
]

catchupFrequencyOptions = [
{ value: '* * * * *', label: 'Every Minute' },
{ value: '*/10 * * * *', label: 'Every 10 Minutes' },
{ value: '0 * * * *', label: 'Every Hour' },
{ value: '0 */6 * * *', label: 'Every 6 Hours' },
{ value: '0 0 * * *', label: 'Every Day' },
{ value: CUSTOM, label: 'Custom' },
{
value: '* * * * *',
label: localize('goaccess_settings.every_minute', 'Every Minute'),
},
{
value: '*/10 * * * *',
label: localize(
'goaccess_settings.every_10_minute',
'Every 10 Minutes'
),
},
{
value: '0 * * * *',
label: localize('goaccess_settings.every_hour', 'Every Hour'),
},
{
value: '0 0 * * *',
label: localize('goaccess_settings.every_day', 'Every Day'),
},
{
value: CUSTOM,
label: localize('goaccess_settings.custom', 'Custom'),
},
]

logRetentionOptions = [
{ value: '-1', label: 'Indefinitely' },
{ value: '30', label: '30 Days' },
{ value: '183', label: '6 Months' },
{ value: '365', label: 'One Year' },
{ value: CUSTOM, label: 'Custom' },
{
value: '-1',
label: localize('goaccess_settings.indefinite', 'Indefinitely'),
},
{ value: '180', label: '180' },
{ value: '365', label: '365' },
{
value: CUSTOM,
label: localize('goaccess_settings.custom', 'Custom'),
},
]

updateRotationFrequency(selectValue?: string, customValue?: string) {
Expand Down Expand Up @@ -172,7 +215,10 @@ export default class GoAccessSettingsForm extends Component<
{this.state.rotationFreqSelect === CUSTOM && (
<Input
style={{ width: 200 }}
placeholder="Valid Crontab Expression"
placeholder={localize(
'goaccess_settings.crontab_placeholder',
'Valid Crontab Expression'
)}
value={this.state.rotationFreqCustom}
required
onChange={(e) =>
Expand Down Expand Up @@ -202,7 +248,10 @@ export default class GoAccessSettingsForm extends Component<
{this.state.catchupFreqSelect === CUSTOM && (
<Input
style={{ width: 200 }}
placeholder="Valid Crontab Expression"
placeholder={localize(
'goaccess_settings.crontab_placeholder',
'Valid Crontab Expression'
)}
value={this.state.catchupFreqCustom}
required
onChange={(e) =>
Expand All @@ -218,7 +267,7 @@ export default class GoAccessSettingsForm extends Component<
<Form.Item
label={localize(
'goaccess_settings.log_retention',
'Log Retention Days'
'Log and Report Retention Days'
)}
>
<Select
Expand All @@ -233,7 +282,10 @@ export default class GoAccessSettingsForm extends Component<
<Input
type="number"
style={{ width: 200 }}
placeholder="365"
placeholder={localize(
'goaccess_settings.log_retention_placeholder',
'Number of days'
)}
required
value={this.state.logRetentionCustom}
onChange={(e) =>
Expand Down
17 changes: 17 additions & 0 deletions src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,26 @@
"goaccess.link": "GoAccess website",
"goaccess.start_goaccess": "Start GoAccess",
"goaccess.stop_goaccess": "Stop GoAccess",
"goaccess.logs_location": "View access logs on the app details page",
"goaccess.update": "Update GoAccess",
"goaccess.started": "GoAccess is started and updated!",
"goaccess.stopped": "GoAccess has stopped",
"goaccess_settings.custom": "Custom",
"goaccess_settings.every_minute": "Every Minute",
"goaccess_settings.every_10_minute": "Every 10 Minutes",
"goaccess_settings.every_hour": "Every Hour",
"goaccess_settings.every_day": "Every Day",
"goaccess_settings.weekly": "Weekly",
"goaccess_settings.monthly": "Monthly",
"goaccess_settings.every_2_months": "Every 2 Months",
"goaccess_settings.every_4_months": "Every 4 Months",
"goaccess_settings.indefinite": "Indefinitely",
"goaccess_settings.goaccess_settings": "GoAccess Settings",
"goaccess_settings.rotation_frequency": "Log Rotation and Report Generation Frequency",
"goaccess_settings.catchup_frequency": "Catch Up Report Processing Frequency",
"goaccess_settings.log_retention": "Log and Report Retention Days",
"goaccess_settings.crontab_placeholder": "Valid Crontab Expression",
"goaccess_settings.log_retention_placeholder": "Number of days",
"load_balancer_stats.active_connections": "Active Connections",
"load_balancer_stats.active_requests": "Active Requests",
"load_balancer_stats.reading_requests": "reading",
Expand Down

0 comments on commit 7e3450a

Please sign in to comment.