suesitran / public_chat

A simple public chat for anyone to chat with Gemini
25 stars 40 forks source link

Implement a language management feature to support change application language and multi-language message translations #31

Open kido-luci opened 1 day ago

kido-luci commented 1 day ago

Feature:

- Support application language changes: users can select a language in the Application Language tab within the Language Management popup on the Login or Chat Box screen, the UI will update dynamically when the App Language value in the Language Cubit state changes. - Support multi-language message translations: users can select a language in the Message Language tab within the Language Management popup on the Chat Box screen. The list of available languages is fetched from the Restcountries API, allowing users to search by language name, code, or country name. The selected language is saved to Firestore under the user's data; if the language is new, it will be added to the Languages collection. When a user sends a new message in the public chat room, a Firebase Cloud Function triggers to translate the message into all languages in the languages collection by using Gemini ai model of Vertex AI API. The recipient receives both the original message and a translated version based on their selected language.

demo video

User data: image

Language data: image

Chat data: image