-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🌍 i18n: Add multi-language support for Terms of Service #6267
base: main
Are you sure you want to change the base?
Conversation
I have implemented this at my end, but kept it all within the yaml config, basically like this:
Your implementation is definitely more elegant and doesn't make librechat.yaml become a monster. My only concern is, how would you foresee people customising them with the new system? Would the terms folder be mounted as a docker volume? Or would they have to bake a custom image? My method lets you use the standard docker image without customisations if you wish. But if we mount the terms folder as a docker volume, the .ts file in it should probably be moved elsewhere? |
@maxesse thank you for your feedback, I thought about implementing it in the and the ToS are not updated every week right 😉 |
Yes for sure - and as far as i'm concerned it doesn't really matter, I'm happy to either bake an image or to add a folder as a volume to K8S, I only wanted to understand which direction you preferred :) |
tbh i'll be glad to take it out of the yaml, between the translated terms and the translated modelSpecs, i have a 70kb file (hence why i have those chonky section dividers, or i lose myself in it) |
I'm happy that you like it. and thanks for the heads up regarding docker images. good one 👌 |
Summary
This pull request includes significant updates to the terms and conditions functionality in the application. The changes involve refactoring the
TermsAndConditionsModal
component, integrating language-specific terms content, and updating the configuration and schema to support these changes.Refactoring and Component Updates:
client/src/components/ui/TermsAndConditionsModal.tsx
: Refactored theTermsAndConditionsModal
component to use aTermsModalProps
interface for its props. Removed theuseMemo
hook for processingmodalContent
and directly passedmodalContent
toMarkdownLite
. [1] [2] [3]Language-Specific Terms Content:
client/src/routes/Root.tsx
: Integrated thegetTermsMarkdown
function to dynamically fetch terms content based on the user's language setting using Recoil state management. [1] [2] [3]client/src/terms/termsContent.ts
: Added a new module to manage language-specific terms content and a function to retrieve the appropriate markdown content based on the user's language.Configuration and Schema Updates:
librechat.example.yaml
: Removed the inlinemodalContent
from the configuration file to support dynamic content fetching.packages/data-provider/src/config.ts
: Updated thetermsOfServiceSchema
to remove themodalContent
field, aligning with the new approach for handling terms content.Change Type
Testing
Please describe your test process and include instructions so that we can reproduce your test. If there are any important variables for your testing configuration, list them here.
Test Configuration:
Checklist