Просмотр исходного кода

Add translation for buttons and emtpy mime types message

arvid-e 2 месяцев назад
Родитель
Сommit
a80c38f928

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

@@ -451,6 +451,8 @@
       "attachment_header": "Attachment Mime Types",
       "inline_button": "Inline",
       "attachment_button": "Attachment",
+      "no_inline": "No inline types set.",
+      "no_attachment": "No attachment types set.",
       "remove_button": "Remove"
     }
   },

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

@@ -451,6 +451,8 @@
       "attachment_header": "Types MIME en pièce jointe",
       "inline_button": "Inline",
       "attachment_button": "Pièce jointe",
+      "no_inline": "Aucun type inline défini.",
+      "no_attachment": "Aucun type de pièce jointe défini.",
       "remove_button": "Supprimer"
     }
   },

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

@@ -452,12 +452,15 @@
       "tag_attributes": "タグ属性",
       "import_recommended": "{{target}} のおすすめをインポート"
     },
+    "content-disposition_header": "Content-Disposition マイムタイプ設定",
     "content-disposition_options": {
       "add_header": "マイムタイプを追加する",
       "note": "注意: マイムタイプを追加すると、もう一方のリストからは自動的に削除されます。",
       "inline_header": "インライン マイムタイプ",
       "attachment_header": "添付ファイル マイムタイプ",
       "inline_button": "インライン",
+      "no_inline": "設定済みのインラインタイプはありません。",
+      "no_attachment": "設定済みの添付ファイルタイプはありません。",
       "attachment_button": "添付ファイル",
       "remove_button": "削除"
     }

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

@@ -451,6 +451,8 @@
       "attachment_header": "파일 첨부(Attachment) 마임 타입",
       "inline_button": "인라인",
       "attachment_button": "파일 첨부",
+      "no_inline": "설정된 인라인 타입이 없습니다.",
+      "no_attachment": "설정된 파일 첨부 타입이 없습니다.",
       "remove_button": "삭제"
     }
   },

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

@@ -460,6 +460,8 @@
       "attachment_header": "附件 (Attachment) MIME 类型",
       "inline_button": "内联",
       "attachment_button": "附件",
+      "no_inline": "未设置内联类型。",
+      "no_attachment": "未设置附件类型。",
       "remove_button": "移除"
     }
   },

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

@@ -129,23 +129,23 @@ const ContentDispositionSettings: React.FC = () => {
                   className="form-control"
                   value={currentInput}
                   onChange={e => setCurrentInput(e.target.value)}
-                  placeholder="e.g., image/png"
+                  placeholder="e.g. image/png"
                 />
                 <button
-                  className="btn btn-primary px-3"
+                  className="btn btn-primary px-3 flex-shrink-0"
                   type="button"
                   onClick={handleSetInline}
                   disabled={!currentInput.trim() || isUpdating}
                 >
-                  Inline
+                  {t('markdown_settings.content-disposition_options.inline_button')}
                 </button>
                 <button
-                  className="btn btn-primary text-white px-3"
+                  className="btn btn-primary text-white px-3 flex-shrink-0"
                   type="button"
                   onClick={handleSetAttachment}
                   disabled={!currentInput.trim() || isUpdating}
                 >
-                  Attachment
+                  {t('markdown_settings.content-disposition_options.attachment_button')}
                 </button>
               </div>
               <small className="form-text text-muted mt-2 d-block">
@@ -163,16 +163,24 @@ 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">{t('markdown_settings.content-disposition_options.inline_header')}</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>}
+                  {renderInlineMimeTypes.length === 0 && (
+                    <li className="list-group-item text-muted">
+                      {t('markdown_settings.content-disposition_options.no_inline')}
+                    </li>
+                  )}
                   {renderInlineMimeTypes.map((mimeType: string) => (
                     <li key={mimeType} className="list-group-item d-flex justify-content-between align-items-center">
                       <code>{mimeType}</code>
                       <button
                         type="button"
-                        className="btn btn-sm btn-outline-danger"
+                        className="btn btn-sm btn-outline-danger rounded-3"
                         onClick={() => handleRemove(mimeType, 'inline')}
                         disabled={isUpdating}
                       >
@@ -188,16 +196,24 @@ 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">{t('markdown_settings.content-disposition_options.attachment_header')}</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>}
+                  {renderAttachmentMimeTypes.length === 0 && (
+                    <li className="list-group-item text-muted">
+                      {t('markdown_settings.content-disposition_options.no_attachment')}
+                    </li>
+                  )}
                   {renderAttachmentMimeTypes.map((mimeType: string) => (
                     <li key={mimeType} className="list-group-item d-flex justify-content-between align-items-center">
                       <code>{mimeType}</code>
                       <button
                         type="button"
-                        className="btn btn-sm btn-outline-danger"
+                        className="btn btn-sm btn-outline-danger rounded-3"
                         onClick={() => handleRemove(mimeType, 'attachment')}
                         disabled={isUpdating}
                       >