arvid-e пре 2 месеци
родитељ
комит
0933a6cb35

+ 10 - 0
apps/app/public/static/locales/en_US/admin.json

@@ -442,6 +442,16 @@
       "tag_names": "Tag names",
       "tag_attributes": "Tag attributes",
       "import_recommended": "Import recommended {{target}}"
+    },
+    "content-disposition_header": "Content-Disposition Mime Type Settings",
+    "content-disposition_options": {
+      "add_header": "Add Mime Types",
+      "note": "Note: Adding a mime type will automatically remove it from the other list.",
+      "inline_header": "Inline Mime Types",
+      "attachment_header": "Attachment Mime Types",
+      "inline_button": "Inline",
+      "attachment_button": "Attachment",
+      "remove_button": "Remove"
     }
   },
   "customize_settings": {

+ 10 - 0
apps/app/public/static/locales/fr_FR/admin.json

@@ -442,6 +442,16 @@
       "tag_names": "Nom de tags",
       "tag_attributes": "Attributs de tags",
       "import_recommended": "Importer {{target}}"
+    },
+    "content-disposition_header": "Paramètres des types MIME Content-Disposition",
+    "content-disposition_options": {
+      "add_header": "Ajouter des types MIME",
+      "note": "Note : L'ajout d'un type MIME le supprimera automatiquement de l'autre liste.",
+      "inline_header": "Types MIME Inline",
+      "attachment_header": "Types MIME en pièce jointe",
+      "inline_button": "Inline",
+      "attachment_button": "Pièce jointe",
+      "remove_button": "Supprimer"
     }
   },
   "customize_settings": {

+ 9 - 0
apps/app/public/static/locales/ja_JP/admin.json

@@ -451,6 +451,15 @@
       "tag_names": "タグ名",
       "tag_attributes": "タグ属性",
       "import_recommended": "{{target}} のおすすめをインポート"
+    },
+    "content-disposition_options": {
+      "add_header": "マイムタイプを追加する",
+      "note": "注意: マイムタイプを追加すると、もう一方のリストからは自動的に削除されます。",
+      "inline_header": "インライン マイムタイプ",
+      "attachment_header": "添付ファイル マイムタイプ",
+      "inline_button": "インライン",
+      "attachment_button": "添付ファイル",
+      "remove_button": "削除"
     }
   },
   "customize_settings": {

+ 10 - 0
apps/app/public/static/locales/ko_KR/admin.json

@@ -442,6 +442,16 @@
       "tag_names": "태그 이름",
       "tag_attributes": "태그 속성",
       "import_recommended": "권장 {{target}} 가져오기"
+    },
+    "content-disposition_header": "Content-Disposition 마임 타입(MIME Type) 설정",
+    "content-disposition_options": {
+      "add_header": "마임 타입 추가",
+      "note": "참고: 마임 타입을 추가하면 다른 리스트에서 자동으로 제거됩니다.",
+      "inline_header": "인라인(Inline) 마임 타입",
+      "attachment_header": "파일 첨부(Attachment) 마임 타입",
+      "inline_button": "인라인",
+      "attachment_button": "파일 첨부",
+      "remove_button": "삭제"
     }
   },
   "customize_settings": {

+ 10 - 0
apps/app/public/static/locales/zh_CN/admin.json

@@ -451,6 +451,16 @@
       "tag_names": "标记名",
       "tag_attributes": "标记属性",
       "import_recommended": "导入建议 {{target}}"
+    },
+    "content-disposition_header": "Content-Disposition MIME 类型设置",
+    "content-disposition_options": {
+      "add_header": "添加 MIME 类型",
+      "note": "注意:添加 MIME 类型将自动从另一个列表中将其删除。",
+      "inline_header": "内联 (Inline) MIME 类型",
+      "attachment_header": "附件 (Attachment) MIME 类型",
+      "inline_button": "内联",
+      "attachment_button": "附件",
+      "remove_button": "移除"
     }
   },
   "customize_settings": {

+ 11 - 8
apps/app/src/client/components/Admin/MarkdownSetting/ContentDispositionSettings.tsx

@@ -2,6 +2,8 @@ import React, {
   useState, useCallback, useEffect, useMemo,
 } from 'react';
 
+import { useTranslation } from 'next-i18next';
+
 import { useContentDisposition, type ContentDispositionSettings } from '../../../services/AdminContentDispositionSettings';
 import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
 
@@ -13,6 +15,7 @@ const removeMimeTypeFromArray = (array: string[], mimeType: string): string[] =>
 );
 
 const ContentDispositionSettings: React.FC = () => {
+  const { t } = useTranslation('admin');
 
   const {
     currentSettings,
@@ -113,13 +116,13 @@ const ContentDispositionSettings: React.FC = () => {
   return (
     <div className="row">
       <div className="col-12">
-        <h2 className="pb-2">Content-Disposition Mime Type Settings</h2>
+        <h2 className="pb-2">{t('markdown_settings.content-disposition_header')}</h2>
 
         {/* INPUT SECTION */}
         <div className="card shadow-sm mb-4">
           <div className="card-body">
             <div className="form-group">
-              <label className="form-label fw-bold">Add New Mime Type</label>
+              <label className="form-label fw-bold">{t('markdown_settings.content-disposition_options.add_header')}</label>
               <div className="d-flex align-items-center gap-2">
                 <input
                   type="text"
@@ -146,7 +149,7 @@ const ContentDispositionSettings: React.FC = () => {
                 </button>
               </div>
               <small className="form-text text-muted mt-2 d-block">
-                Note: Adding a mime type will <strong>automatically remove it</strong> from the other list.
+                {t('markdown_settings.content-disposition_options.note')}
               </small>
             </div>
           </div>
@@ -160,7 +163,7 @@ const ContentDispositionSettings: React.FC = () => {
           {/* INLINE LIST COLUMN */}
           <div className="col-md-6 col-sm-12 align-self-start">
             <div className="card">
-              <div className="card-header"><span className="fw-bold">Inline Mime Types</span></div>
+              <div className="card-header"><span className="fw-bold">{t('markdown_settings.content-disposition_options.inline_header')}</span></div>
               <div className="card-body">
                 <ul className="list-group list-group-flush">
                   {renderInlineMimeTypes.length === 0 && <li className="list-group-item text-muted">No inline types set.</li>}
@@ -168,12 +171,12 @@ const ContentDispositionSettings: React.FC = () => {
                     <li key={mimeType} className="list-group-item d-flex justify-content-between align-items-center">
                       <code>{mimeType}</code>
                       <button
-                        type="button" // Fixes the lint error
+                        type="button"
                         className="btn btn-sm btn-outline-danger"
                         onClick={() => handleRemove(mimeType, 'inline')}
                         disabled={isUpdating}
                       >
-                        Remove
+                        {t('markdown_settings.content-disposition_options.remove_button')}
                       </button>
                     </li>
                   ))}
@@ -185,7 +188,7 @@ const ContentDispositionSettings: React.FC = () => {
           {/* ATTACHMENT LIST COLUMN */}
           <div className="col-md-6 col-sm-12 align-self-start">
             <div className="card">
-              <div className="card-header"><span className="fw-bold">Attachment Mime Types</span></div>
+              <div className="card-header"><span className="fw-bold">{t('markdown_settings.content-disposition_options.attachment_header')}</span></div>
               <div className="card-body">
                 <ul className="list-group list-group-flush">
                   {renderAttachmentMimeTypes.length === 0 && <li className="list-group-item text-muted">No attachment types set.</li>}
@@ -198,7 +201,7 @@ const ContentDispositionSettings: React.FC = () => {
                         onClick={() => handleRemove(mimeType, 'attachment')}
                         disabled={isUpdating}
                       >
-                        Remove
+                        {t('markdown_settings.content-disposition_options.remove_button')}
                       </button>
                     </li>
                   ))}