From f3bdb03caee33dd80a8ecaf1b195a4c81cb0f05a Mon Sep 17 00:00:00 2001 From: jialin Date: Tue, 4 Mar 2025 18:49:45 +0800 Subject: [PATCH] chore: add TODO: Translate me in locales --- src/locales/README.md | 52 ++++++++++++++--------- src/locales/ru-RU/playground.ts | 15 ++++--- src/pages/llmodels/config/llama-config.ts | 4 ++ 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/src/locales/README.md b/src/locales/README.md index e3cadb20..b4d2b64d 100644 --- a/src/locales/README.md +++ b/src/locales/README.md @@ -2,30 +2,42 @@ To add a new language configuration, follow these steps: -1. **Duplicate an Existing Language Directory** +## 1. **Duplicate an Existing Language Directory** - - Choose any existing language directory that you are familiar with, and duplicate it. - - Name the new directory according to the `lang` attribute specified in `lang-config-map.tsx`. +- Choose any existing language directory that you are familiar with, and duplicate it. +- Name the new directory according to the `lang` attribute specified in `lang-config-map.tsx`. -2. **Create a New `.ts` File in the Current Directory** +## 2. **Create a New `.ts` File in the Current Directory** - - In the `locales` directory, create a `.ts` file named to align with the new directory. - - Copy the contents of the `en-US.ts` file into this new `.ts` file. - - Update the following line to match your new language directory: - ```ts - const requireContext = require.context( - `./{new-language-directory}`, - false, - /\.ts$/ - ); - ``` +- In the `locales` directory, create a `.ts` file named to align with the new directory. +- Copy the contents of the `en-US.ts` file into this new `.ts` file. +- Update the following line to match your new language directory: + ```ts + const requireContext = require.context( + `./{new-language-directory}`, + false, + /\.ts$/ + ); + ``` -3. **Translate Each Attribute Value** +## 3. **Translate Each Attribute Value** - - Open the `.ts` file in the **new directory**. - - Translate the value of each key into your target language. +- Open the `.ts` file in the **new directory**. +- For each key-value pair: + - If a translation is available, replace the value with the translated text. + - If no translation is available yet, **replace the value with** `"TODO: Translate me"`. -4. **Finalize the Configuration** +**Example:** - - Review and ensure all translations are complete. - - Your new language configuration is now ready for use! +```ts +export default { + welcome_message: 'TODO: Translate me', + logout_button: 'TODO: Translate me' +}; +``` + +## 4. **Finalize the Configuration** + +- Review and ensure all translations are complete. +- If any translations are missing, contributors can later replace `"TODO: Translate me"` with the correct translation. +- Your new language configuration is now ready for use! diff --git a/src/locales/ru-RU/playground.ts b/src/locales/ru-RU/playground.ts index 5c7a5113..265b107f 100644 --- a/src/locales/ru-RU/playground.ts +++ b/src/locales/ru-RU/playground.ts @@ -81,16 +81,14 @@ export default { 'playground.audio.texttospeech': 'Текст в речь', 'playground.audio.speechtotext': 'Речь в текст', 'playground.audio.texttospeech.tips': 'Здесь появится сгенерированная речь', - 'playground.audio.speechtotext.tips': - 'Загрузите аудио или начните запись', + 'playground.audio.speechtotext.tips': 'Загрузите аудио или начните запись', 'playground.audio.enablemic': 'Разрешите доступ к микрофону в настройках браузера.', 'playground.audio.enablemic.doc': 'Инструкция', 'playground.audio.startrecord': 'Начать запись', 'playground.audio.stoprecord': 'Остановить запись', 'playground.audio.generating.tips': 'Здесь появится распознанный текст', - 'playground.audio.uploadfile.tips': - 'Поддерживаемые форматы: {formats}', + 'playground.audio.uploadfile.tips': 'Поддерживаемые форматы: {formats}', 'playground.input.multiplePaste': 'Пакетный ввод', 'playground.input.multiplePaste.tips': 'Многострочный текст будет автоматически разделён на отдельные записи.', @@ -127,8 +125,7 @@ export default { 'playground.documents.verify.rerank': 'Документы не могут быть пустыми.', 'playground.image.guidance.tip': 'Уровень контроля: влияет на качество и разнообразие изображений.', - 'playground.image.cfg_scale.tip': - 'Уровень соответствия промпту.', + 'playground.image.cfg_scale.tip': 'Уровень соответствия промпту.', 'playground.image.strength.tip': 'Чем выше значение — тем сильнее изменения исходного изображения.', 'playground.image.edit.tips': 'Перетащите изображение для загрузки', @@ -141,5 +138,9 @@ export default { 'playground.image.fitview': 'Подогнать размер', 'playground.chat.aithought': 'Рассуждение (CoT)', 'playground.image.mask.uploaded': 'Маска загружена', - 'playground.image.mask.upload': 'Загрузить маску' + 'playground.image.mask.upload': 'TODO: Translate me', + 'playground.params.frequency_penalty.tips': `TODO: Translate me`, + 'playground.params.presence_penalty.tips': `TODO: Translate me`, + 'playground.image.origin': 'TODO: Translate me', + 'playground.image.mask': 'TODO: Translate me' }; diff --git a/src/pages/llmodels/config/llama-config.ts b/src/pages/llmodels/config/llama-config.ts index 0a8f7d53..3359e61b 100644 --- a/src/pages/llmodels/config/llama-config.ts +++ b/src/pages/llmodels/config/llama-config.ts @@ -584,6 +584,10 @@ const options = [ { label: '--image-free-compute-memory-immediately', value: '--image-free-compute-memory-immediately' + }, + { + label: '--jinja', + value: '--jinja' } ];