Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support localization for Nav components #688

Merged
merged 31 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1deba34
init localization
NoahDragon Jun 27, 2023
1870606
Merge https://github.com/danny-avila/LibreChat
NoahDragon Jun 27, 2023
c0c5b2a
Update defaul to en
NoahDragon Jun 27, 2023
00c612c
Merge branch 'main' of https://github.com/danny-avila/LibreChat into …
NoahDragon Jun 27, 2023
773418a
Fix merge issue and import path.
NoahDragon Jun 27, 2023
b313db7
Set default to en
NoahDragon Jun 27, 2023
6c8f47c
Merge branch 'main' of https://github.com/NoahDragon/LibreChat into main
NoahDragon Jun 27, 2023
b2b4a2d
Change jsx to tsx
NoahDragon Jun 27, 2023
cc619b8
Merge branch 'main' of https://github.com/danny-avila/LibreChat into …
NoahDragon Jun 27, 2023
78cb0b3
Merge main http://github.com/danny-avila/LibreChat
NoahDragon Jul 7, 2023
67da8a2
Update the password max length string.
NoahDragon Jul 7, 2023
98df1cd
Merge branch 'main' into main
NoahDragon Jul 7, 2023
fe7199e
Remove languageContext as using the recoil instead.
NoahDragon Jul 11, 2023
4f68b55
Merge branch 'main' of https://github.com/danny-avila/LibreChat into …
NoahDragon Jul 11, 2023
f73e592
Merge branch 'main' of https://github.com/NoahDragon/LibreChat into main
NoahDragon Jul 11, 2023
ad5aba4
Merge branch 'main' of https://github.com/danny-avila/LibreChat into …
NoahDragon Jul 12, 2023
62ad300
Add localization to component endpoints pages
NoahDragon Jul 19, 2023
69035c5
Revert default to en after testing.
NoahDragon Jul 19, 2023
c5f9da2
Merge branch 'main' of https://github.com/danny-avila/LibreChat into …
NoahDragon Jul 19, 2023
b7a413d
Update LoginForm.tsx
NoahDragon Jul 19, 2023
02eb6a7
Fix translation.
NoahDragon Jul 19, 2023
d72c1d5
Merge branch 'main' of https://github.com/NoahDragon/LibreChat into main
NoahDragon Jul 19, 2023
b048a17
Merge branch 'main' into main
NoahDragon Jul 22, 2023
abcfb76
Merge branch 'main' into main
NoahDragon Jul 22, 2023
28d86ad
Make lint happy
NoahDragon Jul 22, 2023
babc542
Merge branch 'main' of https://github.com/danny-avila/LibreChat into …
NoahDragon Jul 23, 2023
44cdb0e
Merge (#1)
NoahDragon Jul 23, 2023
861f849
Translate Nav pages
NoahDragon Jul 23, 2023
695c35b
Merge branch 'main' of https://github.com/NoahDragon/LibreChat into main
NoahDragon Jul 23, 2023
10aa6f2
Fix npm test
NoahDragon Jul 23, 2023
dd2264a
Merge branch 'main' into main
NoahDragon Jul 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' of https://github.com/danny-avila/LibreChat into …
…main
  • Loading branch information
NoahDragon committed Jul 19, 2023
commit c5f9da253d6818f18c391e4621fd1fa05ad94e6c
6 changes: 3 additions & 3 deletions client/src/components/Endpoints/Google/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function Settings(props) {
<HoverCardTrigger className="grid w-full items-center gap-2">
<div className="flex justify-between">
<Label htmlFor="top-p-int" className="text-left text-sm font-medium">
{localize(lang, 'com_endpoint_top_p')} <small className="opacity-40">({localize(lang, 'com_endpoint_default')}: 0.95)</small>
{localize(lang, 'com_endpoint_top_p')} <small className="opacity-40">({localize(lang, 'com_endpoint_default_with_num', 0.95)})</small>
</Label>
<InputNumber
id="top-p-int"
Expand Down Expand Up @@ -182,7 +182,7 @@ function Settings(props) {
<HoverCardTrigger className="grid w-full items-center gap-2">
<div className="flex justify-between">
<Label htmlFor="top-k-int" className="text-left text-sm font-medium">
{localize(lang, 'com_endpoint_top_k')} <small className="opacity-40">({localize(lang, 'com_endpoint_default')}: 40)</small>
{localize(lang, 'com_endpoint_top_k')} <small className="opacity-40">({localize(lang, 'com_endpoint_default_with_num', 40)})</small>
</Label>
<InputNumber
id="top-k-int"
Expand Down Expand Up @@ -221,7 +221,7 @@ function Settings(props) {
<HoverCardTrigger className="grid w-full items-center gap-2">
<div className="flex justify-between">
<Label htmlFor="max-tokens-int" className="text-left text-sm font-medium">
{localize(lang, 'com_endpoint_max_ooutput_tokens')} <small className="opacity-40">(({localize(lang, 'com_endpoint_default')}: 1024)</small>
{localize(lang, 'com_endpoint_max_output_tokens')} <small className="opacity-40">({localize(lang, 'com_endpoint_default_with_num', 1024)})</small>
</Label>
<InputNumber
id="max-tokens-int"
Expand Down
4 changes: 0 additions & 4 deletions client/src/components/Endpoints/OpenAI/OptionHover.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ const types = {
};

function OptionHover({ type, side }) {
// const options = {};
// if (type === 'pres') {
// options.sideOffset = 45;
// }
const lang = useRecoilValue(store.lang);

return (
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Endpoints/OpenAI/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function Settings(props) {
<Label htmlFor="temp-int" className="text-left text-sm font-medium">
{localize(lang, 'com_endpoint_temperature')}{' '}
<small className="opacity-40">
({localize(lang, 'com_endpoint_default')}: {isOpenAI ? '1' : '0'})
({localize(lang, 'com_endpoint_default_with_num', isOpenAI ? '1' : '0')})
</small>
</Label>
<InputNumber
Expand Down
6 changes: 4 additions & 2 deletions client/src/components/Endpoints/Plugins/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ function Settings(props) {
<>
<div className="grid w-full items-center gap-2">
<Label htmlFor="chatGptLabel" className="text-left text-sm font-medium">
{localize(lang, 'com_endpoint_custom_name')} <small className="opacity-40">({localize(lang, 'com_endpoint_default_empty')} | {localize(lang, 'com_endpoint_disabled_with_tools')})</small>
{localize(lang, 'com_endpoint_custom_name')}{' '}
<small className="opacity-40">({localize(lang, 'com_endpoint_default_empty')} | {localize(lang, 'com_endpoint_disabled_with_tools')})</small>
</Label>
<Input
id="chatGptLabel"
Expand All @@ -90,7 +91,8 @@ function Settings(props) {
</div>
<div className="grid w-full items-center gap-2">
<Label htmlFor="promptPrefix" className="text-left text-sm font-medium">
{localize(lang, 'com_endpoint_prompt_prefix')} <small className="opacity-40">({localize(lang, 'com_endpoint_default_empty')} | {localize(lang, 'com_endpoint_disabled_with_tools')})</small>
{localize(lang, 'com_endpoint_prompt_prefix')}{' '}
<small className="opacity-40">({localize(lang, 'com_endpoint_default_empty')} | {localize(lang, 'com_endpoint_disabled_with_tools')})</small>
</Label>
<TextareaAutosize
id="promptPrefix"
Expand Down
2 changes: 1 addition & 1 deletion client/src/localization/Translation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ export const localize = (langCode: string, phraseKey: string, ...values: string[

// Fall back logic to cover untranslated phrases
return English[phraseKey].format(...values);
};
};
6 changes: 3 additions & 3 deletions client/src/localization/languages/Eng.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,22 @@ export default {
com_endpoint_default: 'default',
com_endpoint_top_p: 'Top P',
com_endpoint_top_k: 'Top K',
com_endpoint_max_ooutput_tokens: 'Max Output Tokens',
com_endpoint_max_output_tokens: 'Max Output Tokens',
com_endpoint_openai_temp: 'Higher values = more random, while lower values = more focused and deterministic. We recommend altering this or Top P but not both.',
com_endpoint_openai_max: "The max tokens to generate. The total length of input tokens and generated tokens is limited by the model's context length.",
com_endpoint_openai_topp: 'An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We recommend altering this or temperature but not both.',
com_endpoint_openai_freq: "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.",
com_endpoint_openai_pres: "Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.",
com_endpoint_openai_custom_name_placeholder: 'Set a custom name for ChatGPT',
com_endpoint_openai_prompt_prefix_placeholder: "Set custom instructions. Defaults to: 'You are ChatGPT, a large language model trained by OpenAI.'",
com_endpoint_openai_prompt_prefix_placeholder: 'Set custom instructions to include in System Message. Default: none',
com_endpoint_frequency_penalty: 'Frequency Penalty',
com_endpoint_presence_penalty: 'Presence Penalty',
com_endpoint_plug_use_functions: 'Use Functions',
com_endpoint_plug_skip_completion: 'Skip Completion',
com_endpoint_disabled_with_tools: 'disabled with tools',
com_endpoint_disabled_with_tools_placeholder: 'Disabled with Tools Selected',
com_endpoint_plug_set_custom_name_for_gpt_placeholder: 'Set a custom name for ChatGPT.',
com_endpoint_plug_set_custom_instructions_for_gpt_placeholder: "Set custom instructions. Defaults to: 'You are ChatGPT, a large language model trained by OpenAI.'",
com_endpoint_plug_set_custom_instructions_for_gpt_placeholder: "Set custom instructions to include in System Message. Default: none",
com_endpoint_set_custom_name: 'Set a custom name, in case you can find this preset',
com_endpoint_preset_name: 'Preset Name',
com_endpoint: 'Endpoint',
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.