From 67ed8c246e98fb163773a97e2b5abeaeffac8695 Mon Sep 17 00:00:00 2001 From: arvinxx Date: Thu, 11 Apr 2024 04:07:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20style:=20fix=20i18n=20of=20model?= =?UTF-8?q?=20list=20fetcher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ar/setting.json | 9 ++++++++- locales/bg-BG/setting.json | 9 ++++++++- locales/de-DE/setting.json | 9 ++++++++- locales/en-US/setting.json | 9 ++++++++- locales/es-ES/setting.json | 9 ++++++++- locales/fr-FR/setting.json | 9 ++++++++- locales/it-IT/setting.json | 9 ++++++++- locales/ja-JP/setting.json | 9 ++++++++- locales/ko-KR/setting.json | 9 ++++++++- locales/nl-NL/setting.json | 9 ++++++++- locales/pl-PL/setting.json | 9 ++++++++- locales/pt-BR/setting.json | 9 ++++++++- locales/ru-RU/setting.json | 9 ++++++++- locales/tr-TR/setting.json | 9 ++++++++- locales/vi-VN/setting.json | 9 ++++++++- locales/zh-CN/setting.json | 9 ++++++++- locales/zh-TW/setting.json | 9 ++++++++- .../ProviderModelList/ModelFetcher.tsx | 16 +++++++++++++--- src/locales/default/setting.ts | 7 +++++++ 19 files changed, 156 insertions(+), 20 deletions(-) diff --git a/locales/ar/setting.json b/locales/ar/setting.json index 1bbfb5ed9000..53aaa7b85629 100644 --- a/locales/ar/setting.json +++ b/locales/ar/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "احصل على قائمة النماذج", + "fetching": "جاري الحصول على قائمة النماذج...", + "latestTime": "آخر تحديث: {{time}}", + "noLatestTime": "لم يتم الحصول على قائمة بعد" + }, "modelList": { "desc": "اختيار النموذج الذي سيتم عرضه في الجلسة، سيتم عرض النموذج المحدد في قائمة النماذج", "placeholder": "الرجاء اختيار نموذج من القائمة", - "title": "قائمة النماذج" + "title": "قائمة النماذج", + "total": "متاح {{count}} نموذج" }, "waitingForMore": "يتم <1>التخطيط لتوفير المزيد من النماذج، ترقبوا المزيد ✨" }, diff --git a/locales/bg-BG/setting.json b/locales/bg-BG/setting.json index 030e4832623b..0b3c7925aeb9 100644 --- a/locales/bg-BG/setting.json +++ b/locales/bg-BG/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Изтегляне на списъка с модели", + "fetching": "Изтегляне на списъка с модели...", + "latestTime": "Последно актуализирано: {{time}}", + "noLatestTime": "В момента няма наличен списък" + }, "modelList": { "desc": "Изберете модел, който да се показва по време на разговор. Избраният модел ще бъде показан в списъка с модели.", "placeholder": "Моля, изберете модел от списъка", - "title": "Списък с модели" + "title": "Списък с модели", + "total": "Общо {{count}} налични модела" }, "waitingForMore": "Още модели са <1>планирани да бъдат добавени, очаквайте ✨" }, diff --git a/locales/de-DE/setting.json b/locales/de-DE/setting.json index 6b20f3d2de1e..970bd449cf24 100644 --- a/locales/de-DE/setting.json +++ b/locales/de-DE/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Modelle abrufen", + "fetching": "Modelle werden abgerufen...", + "latestTime": "Letzte Aktualisierung: {{time}}", + "noLatestTime": "Liste noch nicht abgerufen" + }, "modelList": { "desc": "Wählen Sie die Modelle aus, die in der Sitzung angezeigt werden sollen. Die ausgewählten Modelle werden in der Modellliste angezeigt.", "placeholder": "Wählen Sie ein Modell aus der Liste aus", - "title": "Modellliste" + "title": "Modellliste", + "total": "Insgesamt {{count}} Modelle verfügbar" }, "waitingForMore": "Weitere Modelle werden <1>geplant, bitte freuen Sie sich auf weitere Updates ✨" }, diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json index 1e92292a5750..a7885d69c55f 100644 --- a/locales/en-US/setting.json +++ b/locales/en-US/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Get Model List", + "fetching": "Fetching Model List...", + "latestTime": "Last Updated: {{time}}", + "noLatestTime": "No list available yet" + }, "modelList": { "desc": "Select the models to display in the session. The selected models will be displayed in the model list.", "placeholder": "Please select a model from the list", - "title": "Model List" + "title": "Model List", + "total": "{{count}} models available in total" }, "waitingForMore": "More models are <1>planned to be added, stay tuned ✨" }, diff --git a/locales/es-ES/setting.json b/locales/es-ES/setting.json index 97b3fd0f5720..3c38a4a92931 100644 --- a/locales/es-ES/setting.json +++ b/locales/es-ES/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Obtener lista de modelos", + "fetching": "Obteniendo lista de modelos...", + "latestTime": "Última actualización: {{time}}", + "noLatestTime": "Lista no disponible actualmente" + }, "modelList": { "desc": "Selecciona los modelos que se mostrarán en la conversación. Los modelos seleccionados se mostrarán en la lista de modelos.", "placeholder": "Selecciona un modelo de la lista", - "title": "Lista de modelos" + "title": "Lista de modelos", + "total": "Total de {{count}} modelos disponibles" }, "waitingForMore": "Más modelos están en <1>planificación para su incorporación, ¡estén atentos! ✨" }, diff --git a/locales/fr-FR/setting.json b/locales/fr-FR/setting.json index eb42a969be2e..7619c0696508 100644 --- a/locales/fr-FR/setting.json +++ b/locales/fr-FR/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Obtenir la liste des modèles", + "fetching": "Récupération de la liste des modèles en cours...", + "latestTime": "Dernière mise à jour : {{time}}", + "noLatestTime": "Aucune mise à jour disponible" + }, "modelList": { "desc": "Sélectionnez les modèles à afficher dans la session. Les modèles sélectionnés seront affichés dans la liste des modèles.", "placeholder": "Veuillez sélectionner un modèle dans la liste", - "title": "Liste des modèles" + "title": "Liste des modèles", + "total": "{{count}} modèles disponibles au total" }, "waitingForMore": "Plus de modèles sont en cours de <1>planification pour être ajoutés, restez à l'écoute ✨" }, diff --git a/locales/it-IT/setting.json b/locales/it-IT/setting.json index 844ce819cd7d..e4a42cea6861 100644 --- a/locales/it-IT/setting.json +++ b/locales/it-IT/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Ottenere l'elenco dei modelli", + "fetching": "Recupero dell'elenco dei modelli in corso...", + "latestTime": "Ultimo aggiornamento: {{time}}", + "noLatestTime": "Nessun elenco disponibile al momento" + }, "modelList": { "desc": "Seleziona i modelli da visualizzare durante la sessione, i modelli selezionati verranno mostrati nell'elenco dei modelli", "placeholder": "Seleziona un modello dall'elenco", - "title": "Elenco dei modelli" + "title": "Elenco dei modelli", + "total": "Totale modelli disponibili: {{count}}" }, "waitingForMore": "Altri modelli sono in fase di <1> pianificazione per l'integrazione , resta sintonizzato ✨" }, diff --git a/locales/ja-JP/setting.json b/locales/ja-JP/setting.json index 7fe15e9e422b..6a7d7b2a808f 100644 --- a/locales/ja-JP/setting.json +++ b/locales/ja-JP/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "モデルリストを取得する", + "fetching": "モデルリストを取得中...", + "latestTime": "最終更新時間:{{time}}", + "noLatestTime": "リストを取得していません" + }, "modelList": { "desc": "セッションで表示するモデルを選択します。選択したモデルはモデルリストに表示されます", "placeholder": "モデルをリストから選択してください", - "title": "モデルリスト" + "title": "モデルリスト", + "total": "合計 {{count}} 個のモデルが利用可能です" }, "waitingForMore": "さらに多くのモデルが <1>計画されています。お楽しみに ✨" }, diff --git a/locales/ko-KR/setting.json b/locales/ko-KR/setting.json index 6802c867d4cf..a7e81253c262 100644 --- a/locales/ko-KR/setting.json +++ b/locales/ko-KR/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "모델 목록 가져오기", + "fetching": "모델 목록을 가져오는 중...", + "latestTime": "마지막 업데이트 시간: {{time}}", + "noLatestTime": "목록을 아직 가져오지 않았습니다" + }, "modelList": { "desc": "대화에서 표시할 모델을 선택하세요. 선택한 모델은 모델 목록에 표시됩니다", "placeholder": "모델을 선택하세요", - "title": "모델 목록" + "title": "모델 목록", + "total": "총 {{count}} 개 모델 사용 가능" }, "waitingForMore": "<1>계획에 따라 더 많은 모델이 추가될 예정이니 기대해 주세요 ✨" }, diff --git a/locales/nl-NL/setting.json b/locales/nl-NL/setting.json index bd355d5dfcaa..bfe66d048494 100644 --- a/locales/nl-NL/setting.json +++ b/locales/nl-NL/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Haal model lijst op", + "fetching": "Model lijst wordt opgehaald...", + "latestTime": "Laatst bijgewerkt: {{time}}", + "noLatestTime": "Geen lijst beschikbaar op dit moment" + }, "modelList": { "desc": "Selecteer het model dat in de sessie moet worden weergegeven. Het geselecteerde model wordt weergegeven in de modellijst.", "placeholder": "Selecteer een model uit de lijst", - "title": "Modellijst" + "title": "Modellijst", + "total": "In totaal {{count}} modellen beschikbaar" }, "waitingForMore": "Meer modellen worden <1>gepland om te worden toegevoegd, dus blijf op de hoogte ✨" }, diff --git a/locales/pl-PL/setting.json b/locales/pl-PL/setting.json index 43d0850a3d82..9d27b562b8e3 100644 --- a/locales/pl-PL/setting.json +++ b/locales/pl-PL/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Pobierz listę modeli", + "fetching": "Trwa pobieranie listy modeli...", + "latestTime": "Ostatnia aktualizacja: {{time}}", + "noLatestTime": "Brak dostępnej listy" + }, "modelList": { "desc": "Wybierz modele do wyświetlenia w sesji. Wybrane modele będą widoczne na liście modeli", "placeholder": "Wybierz model z listy", - "title": "Lista modeli" + "title": "Lista modeli", + "total": "Razem dostępne są {{count}} modele" }, "waitingForMore": "Więcej modeli jest obecnie w <1>planach dołączenia, prosimy o cierpliwość ✨" }, diff --git a/locales/pt-BR/setting.json b/locales/pt-BR/setting.json index 73a718650f50..e8fc8f3fed41 100644 --- a/locales/pt-BR/setting.json +++ b/locales/pt-BR/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Obter lista de modelos", + "fetching": "Obtendo lista de modelos...", + "latestTime": "Última atualização: {{time}}", + "noLatestTime": "Lista não disponível" + }, "modelList": { "desc": "Escolha os modelos a serem exibidos na conversa. Os modelos selecionados serão exibidos na lista de modelos.", "placeholder": "Selecione um modelo da lista", - "title": "Lista de Modelos" + "title": "Lista de Modelos", + "total": "Total de {{count}} modelos disponíveis" }, "waitingForMore": "Mais modelos estão sendo <1>planejados para serem adicionados, aguarde ansiosamente ✨" }, diff --git a/locales/ru-RU/setting.json b/locales/ru-RU/setting.json index e4583a92c3da..f0fa555345e9 100644 --- a/locales/ru-RU/setting.json +++ b/locales/ru-RU/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Получить список моделей", + "fetching": "Идет получение списка моделей...", + "latestTime": "Последнее обновление: {{time}}", + "noLatestTime": "Список пока не получен" + }, "modelList": { "desc": "Выберите модель для отображения в сеансе, выбранная модель будет отображаться в списке моделей", "placeholder": "Выберите модель из списка", - "title": "Список моделей" + "title": "Список моделей", + "total": "Всего доступно {{count}} моделей" }, "waitingForMore": "Больше моделей доступно в <1>плане подключения, ожидайте ✨" }, diff --git a/locales/tr-TR/setting.json b/locales/tr-TR/setting.json index 1eaf6af545ab..d68750bc99e9 100644 --- a/locales/tr-TR/setting.json +++ b/locales/tr-TR/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Modelleri Al", + "fetching": "Modelleri alınıyor...", + "latestTime": "Son güncelleme zamanı: {{time}}", + "noLatestTime": "Liste henüz alınamadı" + }, "modelList": { "desc": "Görüntülenecek modeli seçin, seçilen model model listesinde görüntülenecektir", "placeholder": "Lütfen listeden bir model seçin", - "title": "Model Listesi" + "title": "Model Listesi", + "total": "Toplam {{count}} model kullanılabilir" }, "waitingForMore": "Daha fazla model eklenmesi planlanıyor ✨" }, diff --git a/locales/vi-VN/setting.json b/locales/vi-VN/setting.json index bcca03b77c35..809b40b26abf 100644 --- a/locales/vi-VN/setting.json +++ b/locales/vi-VN/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "Lấy danh sách mô hình", + "fetching": "Đang lấy danh sách mô hình...", + "latestTime": "Thời gian cập nhật lần cuối: {{time}}", + "noLatestTime": "Chưa có danh sách nào được lấy" + }, "modelList": { "desc": "Chọn mô hình hiển thị trong cuộc trò chuyện, mô hình đã chọn sẽ được hiển thị trong danh sách mô hình", "placeholder": "Vui lòng chọn mô hình từ danh sách", - "title": "Danh sách mô hình" + "title": "Danh sách mô hình", + "total": "Tổng cộng có {{count}} mô hình có sẵn" }, "waitingForMore": "Có thêm mô hình đang <1>được lên kế hoạch tích hợp, hãy chờ đợi ✨" }, diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json index a8959c38e3d9..63bf933ceda9 100644 --- a/locales/zh-CN/setting.json +++ b/locales/zh-CN/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "获取模型列表", + "fetching": "正在获取模型列表...", + "latestTime": "上次更新时间:{{time}}", + "noLatestTime": "暂未获取列表" + }, "modelList": { "desc": "选择在会话中展示的模型,选择的模型会在模型列表中展示", "placeholder": "请从列表中选择模型", - "title": "模型列表" + "title": "模型列表", + "total": "共 {{count}} 个模型可用" }, "waitingForMore": "更多模型正在 <1>计划接入 中,敬请期待 ✨" }, diff --git a/locales/zh-TW/setting.json b/locales/zh-TW/setting.json index 95fd6b47d814..324cdf144985 100644 --- a/locales/zh-TW/setting.json +++ b/locales/zh-TW/setting.json @@ -75,10 +75,17 @@ } } }, + "fetcher": { + "fetch": "獲取模型列表", + "fetching": "正在獲取模型列表...", + "latestTime": "上次更新時間:{{time}}", + "noLatestTime": "暫未獲取列表" + }, "modelList": { "desc": "選擇在會話中展示的模型,選擇的模型會在模型列表中展示", "placeholder": "請從列表中選擇模型", - "title": "模型列表" + "title": "模型列表", + "total": "共 {{count}} 個模型可用" }, "waitingForMore": "更多模型正在 <1>計劃接入 中,敬請期待 ✨" }, diff --git a/src/app/settings/llm/components/ProviderModelList/ModelFetcher.tsx b/src/app/settings/llm/components/ProviderModelList/ModelFetcher.tsx index 5d055f94405e..05cf751b6018 100644 --- a/src/app/settings/llm/components/ProviderModelList/ModelFetcher.tsx +++ b/src/app/settings/llm/components/ProviderModelList/ModelFetcher.tsx @@ -4,6 +4,7 @@ import { createStyles } from 'antd-style'; import dayjs from 'dayjs'; import { LucideLoaderCircle, LucideRefreshCcwDot } from 'lucide-react'; import { memo } from 'react'; +import { useTranslation } from 'react-i18next'; import { Flexbox } from 'react-layout-kit'; import { useGlobalStore } from '@/store/global'; @@ -30,6 +31,7 @@ interface ModelFetcherProps { const ModelFetcher = memo(({ provider }) => { const { styles } = useStyles(); + const { t } = useTranslation('setting'); const [useFetchProviderModelList] = useGlobalStore((s) => [ s.useFetchProviderModelList, s.setModelProviderConfig, @@ -47,8 +49,16 @@ const ModelFetcher = memo(({ provider }) => { return ( -
共 {totalModels} 个模型可用
- +
{t('llm.modelList.total', { count: totalModels })}
+ (({ provider }) => { size={'small'} spin={isValidating} /> -
{isValidating ? '正在获取模型列表...' : '获取模型列表'}
+
{isValidating ? t('llm.fetcher.fetching') : t('llm.fetcher.fetch')}
diff --git a/src/locales/default/setting.ts b/src/locales/default/setting.ts index 4a7310251466..a75f63161312 100644 --- a/src/locales/default/setting.ts +++ b/src/locales/default/setting.ts @@ -76,10 +76,17 @@ export default { }, }, }, + fetcher: { + fetch: '获取模型列表', + fetching: '正在获取模型列表...', + latestTime: '上次更新时间:{{time}}', + noLatestTime: '暂未获取列表', + }, modelList: { desc: '选择在会话中展示的模型,选择的模型会在模型列表中展示', placeholder: '请从列表中选择模型', title: '模型列表', + total: '共 {{count}} 个模型可用', }, waitingForMore: '更多模型正在 <1>计划接入 中,敬请期待 ✨', },