Skip to content

Commit

Permalink
🌐 style: fix i18n of model list fetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Apr 10, 2024
1 parent adcce07 commit 67ed8c2
Show file tree
Hide file tree
Showing 19 changed files with 156 additions and 20 deletions.
9 changes: 8 additions & 1 deletion locales/ar/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,17 @@
}
}
},
"fetcher": {
"fetch": "احصل على قائمة النماذج",
"fetching": "جاري الحصول على قائمة النماذج...",
"latestTime": "آخر تحديث: {{time}}",
"noLatestTime": "لم يتم الحصول على قائمة بعد"
},
"modelList": {
"desc": "اختيار النموذج الذي سيتم عرضه في الجلسة، سيتم عرض النموذج المحدد في قائمة النماذج",
"placeholder": "الرجاء اختيار نموذج من القائمة",
"title": "قائمة النماذج"
"title": "قائمة النماذج",
"total": "متاح {{count}} نموذج"
},
"waitingForMore": "يتم <1>التخطيط لتوفير</1> المزيد من النماذج، ترقبوا المزيد ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/bg-BG/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,17 @@
}
}
},
"fetcher": {
"fetch": "Изтегляне на списъка с модели",
"fetching": "Изтегляне на списъка с модели...",
"latestTime": "Последно актуализирано: {{time}}",
"noLatestTime": "В момента няма наличен списък"
},
"modelList": {
"desc": "Изберете модел, който да се показва по време на разговор. Избраният модел ще бъде показан в списъка с модели.",
"placeholder": "Моля, изберете модел от списъка",
"title": "Списък с модели"
"title": "Списък с модели",
"total": "Общо {{count}} налични модела"
},
"waitingForMore": "Още модели са <1>планирани да бъдат добавени</1>, очаквайте ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/de-DE/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1>, bitte freuen Sie sich auf weitere Updates ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/en-US/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1>, stay tuned ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/es-ES/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1>, ¡estén atentos! ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/fr-FR/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1>, restez à l'écoute ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/it-IT/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 </1>, resta sintonizzato ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/ja-JP/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,17 @@
}
}
},
"fetcher": {
"fetch": "モデルリストを取得する",
"fetching": "モデルリストを取得中...",
"latestTime": "最終更新時間:{{time}}",
"noLatestTime": "リストを取得していません"
},
"modelList": {
"desc": "セッションで表示するモデルを選択します。選択したモデルはモデルリストに表示されます",
"placeholder": "モデルをリストから選択してください",
"title": "モデルリスト"
"title": "モデルリスト",
"total": "合計 {{count}} 個のモデルが利用可能です"
},
"waitingForMore": "さらに多くのモデルが <1>計画されています</1>。お楽しみに ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/ko-KR/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,17 @@
}
}
},
"fetcher": {
"fetch": "모델 목록 가져오기",
"fetching": "모델 목록을 가져오는 중...",
"latestTime": "마지막 업데이트 시간: {{time}}",
"noLatestTime": "목록을 아직 가져오지 않았습니다"
},
"modelList": {
"desc": "대화에서 표시할 모델을 선택하세요. 선택한 모델은 모델 목록에 표시됩니다",
"placeholder": "모델을 선택하세요",
"title": "모델 목록"
"title": "모델 목록",
"total": "총 {{count}} 개 모델 사용 가능"
},
"waitingForMore": "<1>계획에 따라 더 많은 모델이 추가될 예정</1>이니 기대해 주세요 ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/nl-NL/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1>, dus blijf op de hoogte ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/pl-PL/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1>, prosimy o cierpliwość ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/pt-BR/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1>, aguarde ansiosamente ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/ru-RU/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,17 @@
}
}
},
"fetcher": {
"fetch": "Получить список моделей",
"fetching": "Идет получение списка моделей...",
"latestTime": "Последнее обновление: {{time}}",
"noLatestTime": "Список пока не получен"
},
"modelList": {
"desc": "Выберите модель для отображения в сеансе, выбранная модель будет отображаться в списке моделей",
"placeholder": "Выберите модель из списка",
"title": "Список моделей"
"title": "Список моделей",
"total": "Всего доступно {{count}} моделей"
},
"waitingForMore": "Больше моделей доступно в <1>плане подключения</1>, ожидайте ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/tr-TR/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/vi-VN/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -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</1>, hãy chờ đợi ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/zh-CN/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,17 @@
}
}
},
"fetcher": {
"fetch": "获取模型列表",
"fetching": "正在获取模型列表...",
"latestTime": "上次更新时间:{{time}}",
"noLatestTime": "暂未获取列表"
},
"modelList": {
"desc": "选择在会话中展示的模型,选择的模型会在模型列表中展示",
"placeholder": "请从列表中选择模型",
"title": "模型列表"
"title": "模型列表",
"total": "共 {{count}} 个模型可用"
},
"waitingForMore": "更多模型正在 <1>计划接入</1> 中,敬请期待 ✨"
},
Expand Down
9 changes: 8 additions & 1 deletion locales/zh-TW/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,17 @@
}
}
},
"fetcher": {
"fetch": "獲取模型列表",
"fetching": "正在獲取模型列表...",
"latestTime": "上次更新時間:{{time}}",
"noLatestTime": "暫未獲取列表"
},
"modelList": {
"desc": "選擇在會話中展示的模型,選擇的模型會在模型列表中展示",
"placeholder": "請從列表中選擇模型",
"title": "模型列表"
"title": "模型列表",
"total": "共 {{count}} 個模型可用"
},
"waitingForMore": "更多模型正在 <1>計劃接入</1> 中,敬請期待 ✨"
},
Expand Down
16 changes: 13 additions & 3 deletions src/app/settings/llm/components/ProviderModelList/ModelFetcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -30,6 +31,7 @@ interface ModelFetcherProps {

const ModelFetcher = memo<ModelFetcherProps>(({ provider }) => {
const { styles } = useStyles();
const { t } = useTranslation('setting');
const [useFetchProviderModelList] = useGlobalStore((s) => [
s.useFetchProviderModelList,
s.setModelProviderConfig,
Expand All @@ -47,8 +49,16 @@ const ModelFetcher = memo<ModelFetcherProps>(({ provider }) => {
return (
<Typography.Text style={{ fontSize: 12 }} type={'secondary'}>
<Flexbox align={'center'} gap={0} horizontal justify={'space-between'}>
<div>{totalModels} 个模型可用</div>
<Tooltip title={`上次更新时间:${dayjs(latestFetchTime).format('MM-DD HH:mm:ss')}`}>
<div>{t('llm.modelList.total', { count: totalModels })}</div>
<Tooltip
title={
latestFetchTime
? t('llm.fetcher.latestTime', {
time: dayjs(latestFetchTime).format('YYYY-MM-DD HH:mm:ss'),
})
: t('llm.fetcher.noLatestTime')
}
>
<Flexbox
align={'center'}
className={styles.hover}
Expand All @@ -61,7 +71,7 @@ const ModelFetcher = memo<ModelFetcherProps>(({ provider }) => {
size={'small'}
spin={isValidating}
/>
<div>{isValidating ? '正在获取模型列表...' : '获取模型列表'}</div>
<div>{isValidating ? t('llm.fetcher.fetching') : t('llm.fetcher.fetch')}</div>
</Flexbox>
</Tooltip>
</Flexbox>
Expand Down
7 changes: 7 additions & 0 deletions src/locales/default/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,17 @@ export default {
},
},
},
fetcher: {
fetch: '获取模型列表',
fetching: '正在获取模型列表...',
latestTime: '上次更新时间:{{time}}',
noLatestTime: '暂未获取列表',
},
modelList: {
desc: '选择在会话中展示的模型,选择的模型会在模型列表中展示',
placeholder: '请从列表中选择模型',
title: '模型列表',
total: '共 {{count}} 个模型可用',
},
waitingForMore: '更多模型正在 <1>计划接入</1> 中,敬请期待 ✨',
},
Expand Down

0 comments on commit 67ed8c2

Please sign in to comment.