]> Untitled Git - lemmy-ui.git/commitdiff
Add translations
authorabias <abias1122@gmail.com>
Tue, 23 May 2023 23:31:33 +0000 (19:31 -0400)
committerabias <abias1122@gmail.com>
Tue, 23 May 2023 23:31:33 +0000 (19:31 -0400)
src/shared/components/home/rate-limit-form.tsx

index d4b68beb7fa47255bf70c2880b906561fecdd172..8f2a1a81603d6e51b4c1f90b1552f1f31fd9fdfc 100644 (file)
@@ -18,7 +18,6 @@ const rateLimitTypes = [
 interface RateLimitsProps {
   handleRateLimit: FormEventHandler<HTMLInputElement>;
   handleRateLimitPerSecond: FormEventHandler<HTMLInputElement>;
-  rateLimitLabel: string;
   rateLimitValue?: number;
   rateLimitPerSecondValue?: number;
 }
@@ -49,14 +48,13 @@ interface RateLimitFormState {
 function RateLimits({
   handleRateLimit,
   handleRateLimitPerSecond,
-  rateLimitLabel,
   rateLimitPerSecondValue,
   rateLimitValue,
 }: RateLimitsProps) {
   return (
     <div className="form-group row">
       <label className="col-12 col-form-label" htmlFor="rate-limit">
-        {rateLimitLabel}
+        {i18n.t("rate_limit")}
       </label>
       <input
         type="number"
@@ -171,11 +169,11 @@ export default class RateLimitsForm extends Component<
   render() {
     return (
       <form onSubmit={linkEvent(this, submitRateLimitForm)}>
-        <h5>Rate Limit Options</h5>
+        <h5>{i18n.t("rate_limit_header")}</h5>
         <Tabs
           tabs={rateLimitTypes.map(rateLimitType => ({
             key: rateLimitType,
-            label: rateLimitType,
+            label: i18n.t(`rate_limit_${rateLimitType}`),
             getNode: () => (
               <RateLimits
                 handleRateLimit={linkEvent(
@@ -186,7 +184,6 @@ export default class RateLimitsForm extends Component<
                   { rateLimitType, ctx: this },
                   handlePerSecondChange
                 )}
-                rateLimitLabel={i18n.t(`rate_limit_${rateLimitType}`)}
                 rateLimitValue={this.state.form[rateLimitType]}
                 rateLimitPerSecondValue={
                   this.state.form[`${rateLimitType}_per_second`]