From e6f2fdbdde0baba333899cea65f35c33b6fcc451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E7=92=87?= <37972689+YangGuoXuan-0503@users.noreply.github.com> Date: Sat, 12 Oct 2024 10:59:06 +0800 Subject: [PATCH] fix: md translate in sdoc (#6879) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 杨国璇 --- frontend/src/_i18n/i18n-sdoc-editor.js | 4 ++-- frontend/src/_i18n/i18n-seafile-editor.js | 2 +- .../locales/cs/seafile-editor.json | 0 .../locales/de/seafile-editor.json | 0 .../locales/en/seafile-editor.json | 0 .../locales/es-AR/seafile-editor.json | 0 .../locales/es-MX/seafile-editor.json | 0 .../locales/es/seafile-editor.json | 0 .../locales/fr/seafile-editor.json | 0 .../locales/it/seafile-editor.json | 0 .../locales/ru/seafile-editor.json | 0 .../locales/zh-CN/seafile-editor.json | 0 .../locales/zh_CN/seafile-editor.json | 0 .../seafile-editor-font.css | 12 ++++++------ .../seafile-editor-font/iconfont.eot | Bin .../seafile-editor-font/iconfont.svg | 0 .../seafile-editor-font/iconfont.ttf | Bin .../seafile-editor-font/iconfont.woff | Bin .../seafile-editor-font/iconfont.woff2 | Bin seahub/templates/draft.html | 2 +- seahub/templates/markdown_file_view_react.html | 2 +- .../templates/plain_markdown_file_view_react.html | 2 +- seahub/templates/react_app.html | 2 +- seahub/templates/sdoc_file_view_react.html | 5 +++-- seahub/templates/shared_file_view_react.html | 2 +- seahub/templates/sysadmin/sysadmin_react_app.html | 2 +- seahub/templates/wiki/wiki.html | 2 +- seahub/templates/wiki/wiki_edit.html | 2 +- seahub/templates/wiki/wiki_publish.html | 2 +- 29 files changed, 21 insertions(+), 20 deletions(-) rename media/{ => seafile-editor}/locales/cs/seafile-editor.json (100%) rename media/{ => seafile-editor}/locales/de/seafile-editor.json (100%) rename media/{ => seafile-editor}/locales/en/seafile-editor.json (100%) rename media/{ => seafile-editor}/locales/es-AR/seafile-editor.json (100%) rename media/{ => seafile-editor}/locales/es-MX/seafile-editor.json (100%) rename media/{ => seafile-editor}/locales/es/seafile-editor.json (100%) rename media/{ => seafile-editor}/locales/fr/seafile-editor.json (100%) rename media/{ => seafile-editor}/locales/it/seafile-editor.json (100%) rename media/{ => seafile-editor}/locales/ru/seafile-editor.json (100%) rename media/{ => seafile-editor}/locales/zh-CN/seafile-editor.json (100%) rename media/{ => seafile-editor}/locales/zh_CN/seafile-editor.json (100%) rename media/{css/seafile-editor-font => seafile-editor}/seafile-editor-font.css (86%) rename media/{css => seafile-editor}/seafile-editor-font/iconfont.eot (100%) rename media/{css => seafile-editor}/seafile-editor-font/iconfont.svg (100%) rename media/{css => seafile-editor}/seafile-editor-font/iconfont.ttf (100%) rename media/{css => seafile-editor}/seafile-editor-font/iconfont.woff (100%) rename media/{css => seafile-editor}/seafile-editor-font/iconfont.woff2 (100%) diff --git a/frontend/src/_i18n/i18n-sdoc-editor.js b/frontend/src/_i18n/i18n-sdoc-editor.js index d846258288..86dd79f20b 100644 --- a/frontend/src/_i18n/i18n-sdoc-editor.js +++ b/frontend/src/_i18n/i18n-sdoc-editor.js @@ -13,13 +13,13 @@ i18n .init({ lng: lang, fallbackLng: 'en', - ns: ['sdoc-editor'], + ns: ['sdoc-editor', 'seafile-editor'], defaultNS: 'sdoc-editor', whitelist: ['en', 'zh-CN', 'fr', 'de', 'cs', 'es', 'es-AR', 'es-MX', 'ru'], backend: { - loadPath: mediaUrl + 'sdoc-editor/locales/{{ lng }}/{{ ns }}.json', + loadPath: mediaUrl + '{{ ns }}/locales/{{ lng }}/{{ ns }}.json', // loadPath: '/media/locales/{{lng}}/{{ns}}.json', }, diff --git a/frontend/src/_i18n/i18n-seafile-editor.js b/frontend/src/_i18n/i18n-seafile-editor.js index 05d67acb76..31589e9934 100644 --- a/frontend/src/_i18n/i18n-seafile-editor.js +++ b/frontend/src/_i18n/i18n-seafile-editor.js @@ -19,7 +19,7 @@ i18n whitelist: ['en', 'zh-CN', 'fr', 'de', 'cs', 'es', 'es-AR', 'es-MX', 'ru'], backend: { - loadPath: mediaUrl + 'locales/{{ lng }}/{{ ns }}.json', + loadPath: mediaUrl + '{{ ns }}/locales/{{ lng }}/{{ ns }}.json', // loadPath: '/media/locales/{{lng}}/{{ns}}.json', }, diff --git a/media/locales/cs/seafile-editor.json b/media/seafile-editor/locales/cs/seafile-editor.json similarity index 100% rename from media/locales/cs/seafile-editor.json rename to media/seafile-editor/locales/cs/seafile-editor.json diff --git a/media/locales/de/seafile-editor.json b/media/seafile-editor/locales/de/seafile-editor.json similarity index 100% rename from media/locales/de/seafile-editor.json rename to media/seafile-editor/locales/de/seafile-editor.json diff --git a/media/locales/en/seafile-editor.json b/media/seafile-editor/locales/en/seafile-editor.json similarity index 100% rename from media/locales/en/seafile-editor.json rename to media/seafile-editor/locales/en/seafile-editor.json diff --git a/media/locales/es-AR/seafile-editor.json b/media/seafile-editor/locales/es-AR/seafile-editor.json similarity index 100% rename from media/locales/es-AR/seafile-editor.json rename to media/seafile-editor/locales/es-AR/seafile-editor.json diff --git a/media/locales/es-MX/seafile-editor.json b/media/seafile-editor/locales/es-MX/seafile-editor.json similarity index 100% rename from media/locales/es-MX/seafile-editor.json rename to media/seafile-editor/locales/es-MX/seafile-editor.json diff --git a/media/locales/es/seafile-editor.json b/media/seafile-editor/locales/es/seafile-editor.json similarity index 100% rename from media/locales/es/seafile-editor.json rename to media/seafile-editor/locales/es/seafile-editor.json diff --git a/media/locales/fr/seafile-editor.json b/media/seafile-editor/locales/fr/seafile-editor.json similarity index 100% rename from media/locales/fr/seafile-editor.json rename to media/seafile-editor/locales/fr/seafile-editor.json diff --git a/media/locales/it/seafile-editor.json b/media/seafile-editor/locales/it/seafile-editor.json similarity index 100% rename from media/locales/it/seafile-editor.json rename to media/seafile-editor/locales/it/seafile-editor.json diff --git a/media/locales/ru/seafile-editor.json b/media/seafile-editor/locales/ru/seafile-editor.json similarity index 100% rename from media/locales/ru/seafile-editor.json rename to media/seafile-editor/locales/ru/seafile-editor.json diff --git a/media/locales/zh-CN/seafile-editor.json b/media/seafile-editor/locales/zh-CN/seafile-editor.json similarity index 100% rename from media/locales/zh-CN/seafile-editor.json rename to media/seafile-editor/locales/zh-CN/seafile-editor.json diff --git a/media/locales/zh_CN/seafile-editor.json b/media/seafile-editor/locales/zh_CN/seafile-editor.json similarity index 100% rename from media/locales/zh_CN/seafile-editor.json rename to media/seafile-editor/locales/zh_CN/seafile-editor.json diff --git a/media/css/seafile-editor-font/seafile-editor-font.css b/media/seafile-editor/seafile-editor-font.css similarity index 86% rename from media/css/seafile-editor-font/seafile-editor-font.css rename to media/seafile-editor/seafile-editor-font.css index ae283740e6..2b0059dfc1 100644 --- a/media/css/seafile-editor-font/seafile-editor-font.css +++ b/media/seafile-editor/seafile-editor-font.css @@ -1,14 +1,14 @@ @font-face { font-family: "iconfont"; /* Project id 4375832 */ - src: url('./iconfont.eot?t=1726105923189'); + src: url('./seafile-editor-font/iconfont.eot?t=1726105923189'); /* IE9 */ - src: url('./iconfont.eot?t=1726105923189#iefix') format('embedded-opentype'), + src: url('./seafile-editor-font/iconfont.eot?t=1726105923189#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('./iconfont.woff2?t=1726105923189') format('woff2'), - url('./iconfont.woff?t=1726105923189') format('woff'), - url('./iconfont.ttf?t=1726105923189') format('truetype'), - url('./iconfont.svg?t=1726105923189#iconfont') format('svg'); + url('./seafile-editor-font/iconfont.woff2?t=1726105923189') format('woff2'), + url('./seafile-editor-font/iconfont.woff?t=1726105923189') format('woff'), + url('./seafile-editor-font/iconfont.ttf?t=1726105923189') format('truetype'), + url('./seafile-editor-font/iconfont.svg?t=1726105923189#iconfont') format('svg'); } .iconfont { diff --git a/media/css/seafile-editor-font/iconfont.eot b/media/seafile-editor/seafile-editor-font/iconfont.eot similarity index 100% rename from media/css/seafile-editor-font/iconfont.eot rename to media/seafile-editor/seafile-editor-font/iconfont.eot diff --git a/media/css/seafile-editor-font/iconfont.svg b/media/seafile-editor/seafile-editor-font/iconfont.svg similarity index 100% rename from media/css/seafile-editor-font/iconfont.svg rename to media/seafile-editor/seafile-editor-font/iconfont.svg diff --git a/media/css/seafile-editor-font/iconfont.ttf b/media/seafile-editor/seafile-editor-font/iconfont.ttf similarity index 100% rename from media/css/seafile-editor-font/iconfont.ttf rename to media/seafile-editor/seafile-editor-font/iconfont.ttf diff --git a/media/css/seafile-editor-font/iconfont.woff b/media/seafile-editor/seafile-editor-font/iconfont.woff similarity index 100% rename from media/css/seafile-editor-font/iconfont.woff rename to media/seafile-editor/seafile-editor-font/iconfont.woff diff --git a/media/css/seafile-editor-font/iconfont.woff2 b/media/seafile-editor/seafile-editor-font/iconfont.woff2 similarity index 100% rename from media/css/seafile-editor-font/iconfont.woff2 rename to media/seafile-editor/seafile-editor-font/iconfont.woff2 diff --git a/seahub/templates/draft.html b/seahub/templates/draft.html index f0605a5076..34209fefce 100644 --- a/seahub/templates/draft.html +++ b/seahub/templates/draft.html @@ -2,7 +2,7 @@ {% load render_bundle from webpack_loader %} {% block extra_style %} - + {% render_bundle 'draft' 'css' %} {% endblock %} diff --git a/seahub/templates/markdown_file_view_react.html b/seahub/templates/markdown_file_view_react.html index 8e872788a0..e0a1e85c78 100644 --- a/seahub/templates/markdown_file_view_react.html +++ b/seahub/templates/markdown_file_view_react.html @@ -13,7 +13,7 @@ - + {% render_bundle 'markdownEditor' 'css' %} diff --git a/seahub/templates/plain_markdown_file_view_react.html b/seahub/templates/plain_markdown_file_view_react.html index 48883db1f0..614ca17427 100644 --- a/seahub/templates/plain_markdown_file_view_react.html +++ b/seahub/templates/plain_markdown_file_view_react.html @@ -13,7 +13,7 @@ - + {% render_bundle 'plainMarkdownEditor' 'css' %} diff --git a/seahub/templates/react_app.html b/seahub/templates/react_app.html index 342eda4a87..746b86a798 100644 --- a/seahub/templates/react_app.html +++ b/seahub/templates/react_app.html @@ -3,7 +3,7 @@ {% load seahub_tags %} {% block extra_style %} - + {% render_bundle 'app' 'css' %} {% endblock %} diff --git a/seahub/templates/sdoc_file_view_react.html b/seahub/templates/sdoc_file_view_react.html index 08d83ac898..f134406cf8 100644 --- a/seahub/templates/sdoc_file_view_react.html +++ b/seahub/templates/sdoc_file_view_react.html @@ -4,7 +4,7 @@ {% block extra_style %} - + {% render_bundle 'viewFileSdoc' 'css' %} {% endblock %} @@ -29,7 +29,8 @@ publisherNickname: '{{ publisher_nickname }}', isPublished: {% if is_published %}true{% else %}false{% endif %}, revisionCreatedAt: '{{ revision_created_at }}', revisionUpdatedAt: '{{ revision_updated_at }}', -isFreezed: {% if is_freezed %}true{% else %}false{% endif %} +isFreezed: {% if is_freezed %}true{% else %}false{% endif %}, +lang: '{{ lang }}', {% endblock %} {% block render_bundle %} diff --git a/seahub/templates/shared_file_view_react.html b/seahub/templates/shared_file_view_react.html index 55f34956eb..f53c26a5d7 100644 --- a/seahub/templates/shared_file_view_react.html +++ b/seahub/templates/shared_file_view_react.html @@ -15,7 +15,7 @@ {% block extra_style %} {% if filetype == 'Markdown' %} - + {% render_bundle 'sharedFileViewMarkdown' 'css' %} {% elif filetype == 'Text' %} {% render_bundle 'sharedFileViewText' 'css' %} diff --git a/seahub/templates/sysadmin/sysadmin_react_app.html b/seahub/templates/sysadmin/sysadmin_react_app.html index 0816a8b1bc..d68216da0d 100644 --- a/seahub/templates/sysadmin/sysadmin_react_app.html +++ b/seahub/templates/sysadmin/sysadmin_react_app.html @@ -3,7 +3,7 @@ {% load render_bundle from webpack_loader %} {% block extra_style %} - + {% endblock %} {% block extra_script %} diff --git a/seahub/templates/wiki/wiki.html b/seahub/templates/wiki/wiki.html index 64bdf2b5f5..420e59b43b 100644 --- a/seahub/templates/wiki/wiki.html +++ b/seahub/templates/wiki/wiki.html @@ -11,7 +11,7 @@ {% endblock %} {% block extra_style %} - + {% render_bundle 'wiki' 'css' %} {% endblock %} diff --git a/seahub/templates/wiki/wiki_edit.html b/seahub/templates/wiki/wiki_edit.html index 71bb737121..c57b8fd025 100644 --- a/seahub/templates/wiki/wiki_edit.html +++ b/seahub/templates/wiki/wiki_edit.html @@ -11,7 +11,7 @@ {% endblock %} {% block extra_style %} - + {% render_bundle 'wiki2' 'css' %} {% endblock %} diff --git a/seahub/templates/wiki/wiki_publish.html b/seahub/templates/wiki/wiki_publish.html index 5ad0103854..7b265d0094 100644 --- a/seahub/templates/wiki/wiki_publish.html +++ b/seahub/templates/wiki/wiki_publish.html @@ -11,7 +11,7 @@ {% endblock %} {% block extra_style %} - + {% render_bundle 'wiki2' 'css' %} {% endblock %}