Skip to content

Commit bf4bd2b

Browse files
committed
feat(rateLimit): enhance rate limit control and localization support
- Added localization entries for rate limit settings in multiple languages, including labels and descriptions.
1 parent 1dbf9b9 commit bf4bd2b

File tree

15 files changed

+61
-5
lines changed

15 files changed

+61
-5
lines changed

webview-ui/src/components/settings/__tests__/RateLimitControl.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render, fireEvent } from "@testing-library/react"
1+
import { render, fireEvent, waitFor } from "@testing-library/react"
22
import { RateLimitControl } from "../RateLimitControl"
33

44
// Mock the translation hook
@@ -17,17 +17,17 @@ describe("RateLimitControl", () => {
1717
expect(slider.value).toBe("10")
1818
})
1919

20-
it("calls onChange when the slider value changes", () => {
20+
it("calls onChange when the slider value changes", async () => {
2121
const onChange = jest.fn()
2222
const { getByRole } = render(<RateLimitControl value={10} onChange={onChange} />)
2323

2424
const slider = getByRole("slider") as HTMLInputElement
2525
fireEvent.change(slider, { target: { value: "20" } })
2626

2727
// The onChange is debounced, so we need to wait for it to be called
28-
setTimeout(() => {
28+
await waitFor(() => {
2929
expect(onChange).toHaveBeenCalledWith(20)
30-
}, 100)
30+
})
3131
})
3232

3333
it("updates the displayed value when the slider changes", () => {

webview-ui/src/i18n/locales/ca/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,11 @@
328328
},
329329
"enableStreaming": "Habilitar streaming",
330330
"useAzure": "Utilitzar Azure",
331-
"azureApiVersion": "Establir versió de l'API d'Azure"
331+
"azureApiVersion": "Establir versió de l'API d'Azure",
332+
"rateLimit": {
333+
"label": "Límit de freqüència",
334+
"description": "Temps mínim entre sol·licituds d'API."
335+
}
332336
},
333337
"modelPicker": {
334338
"automaticFetch": "L'extensió obté automàticament la llista més recent de models disponibles a <serviceLink>{{serviceName}}</serviceLink>. Si no esteu segur de quin model triar, Roo Code funciona millor amb <defaultModelLink>{{defaultModelId}}</defaultModelLink>. També podeu cercar \"free\" per a opcions gratuïtes actualment disponibles."

webview-ui/src/i18n/locales/de/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@
325325
"enableStreaming": "Streaming aktivieren",
326326
"useAzure": "Azure verwenden",
327327
"azureApiVersion": "Azure API-Version festlegen",
328+
"rateLimit": {
329+
"label": "Ratenbegrenzung",
330+
"description": "Minimale Zeit zwischen API-Anfragen."
331+
},
328332
"gemini": {
329333
"freeRequests": "* Kostenlos bis zu {{count}} Anfragen pro Minute. Danach hängt die Abrechnung von der Prompt-Größe ab.",
330334
"pricingDetails": "Weitere Informationen finden Sie in den Preisdetails."

webview-ui/src/i18n/locales/es/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@
325325
"enableStreaming": "Habilitar streaming",
326326
"useAzure": "Usar Azure",
327327
"azureApiVersion": "Establecer versión de API de Azure",
328+
"rateLimit": {
329+
"label": "Límite de tasa",
330+
"description": "Tiempo mínimo entre solicitudes de API."
331+
},
328332
"gemini": {
329333
"freeRequests": "* Gratis hasta {{count}} solicitudes por minuto. Después de eso, la facturación depende del tamaño del prompt.",
330334
"pricingDetails": "Para más información, consulte los detalles de precios."

webview-ui/src/i18n/locales/fr/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@
325325
"enableStreaming": "Activer le streaming",
326326
"useAzure": "Utiliser Azure",
327327
"azureApiVersion": "Définir la version de l'API Azure",
328+
"rateLimit": {
329+
"label": "Limite de débit",
330+
"description": "Temps minimum entre les requêtes API."
331+
},
328332
"gemini": {
329333
"freeRequests": "* Gratuit jusqu'à {{count}} requêtes par minute. Après cela, la facturation dépend de la taille du prompt.",
330334
"pricingDetails": "Pour plus d'informations, voir les détails de tarification."

webview-ui/src/i18n/locales/hi/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@
325325
"enableStreaming": "स्ट्रीमिंग सक्षम करें",
326326
"useAzure": "Azure का उपयोग करें",
327327
"azureApiVersion": "Azure API संस्करण सेट करें",
328+
"rateLimit": {
329+
"label": "दर सीमा",
330+
"description": "API अनुरोधों के बीच न्यूनतम समय।"
331+
},
328332
"gemini": {
329333
"freeRequests": "* प्रति मिनट {{count}} अनुरोधों तक मुफ्त। उसके बाद, बिलिंग प्रॉम्प्ट आकार पर निर्भर करती है।",
330334
"pricingDetails": "अधिक जानकारी के लिए, मूल्य निर्धारण विवरण देखें।"

webview-ui/src/i18n/locales/it/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@
325325
"enableStreaming": "Abilita streaming",
326326
"useAzure": "Usa Azure",
327327
"azureApiVersion": "Imposta versione API Azure",
328+
"rateLimit": {
329+
"label": "Limite di frequenza",
330+
"description": "Tempo minimo tra le richieste API."
331+
},
328332
"gemini": {
329333
"freeRequests": "* Gratuito fino a {{count}} richieste al minuto. Dopo, la fatturazione dipende dalla dimensione del prompt.",
330334
"pricingDetails": "Per maggiori informazioni, vedi i dettagli sui prezzi."

webview-ui/src/i18n/locales/ja/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@
325325
"enableStreaming": "ストリーミングを有効化",
326326
"useAzure": "Azureを使用",
327327
"azureApiVersion": "Azure APIバージョンを設定",
328+
"rateLimit": {
329+
"label": "レート制限",
330+
"description": "APIリクエスト間の最小時間。"
331+
},
328332
"gemini": {
329333
"freeRequests": "* 1分間あたり{{count}}リクエストまで無料。それ以降は、プロンプトサイズに応じて課金されます。",
330334
"pricingDetails": "詳細は価格情報をご覧ください。"

webview-ui/src/i18n/locales/ko/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@
325325
"enableStreaming": "스트리밍 활성화",
326326
"useAzure": "Azure 사용",
327327
"azureApiVersion": "Azure API 버전 설정",
328+
"rateLimit": {
329+
"label": "속도 제한",
330+
"description": "API 요청 간 최소 시간."
331+
},
328332
"gemini": {
329333
"freeRequests": "* 분당 {{count}}개의 요청까지 무료. 이후에는 프롬프트 크기에 따라 요금이 부과됩니다.",
330334
"pricingDetails": "자세한 내용은 가격 정보를 참조하세요."

webview-ui/src/i18n/locales/pl/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@
325325
"enableStreaming": "Włącz strumieniowanie",
326326
"useAzure": "Użyj Azure",
327327
"azureApiVersion": "Ustaw wersję API Azure",
328+
"rateLimit": {
329+
"label": "Limit szybkości",
330+
"description": "Minimalny czas między żądaniami API."
331+
},
328332
"gemini": {
329333
"freeRequests": "* Darmowe do {{count}} zapytań na minutę. Po tym, rozliczanie zależy od rozmiaru podpowiedzi.",
330334
"pricingDetails": "Więcej informacji znajdziesz w szczegółach cennika."

0 commit comments

Comments
 (0)