-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Multi language support #214
Conversation
"language" seems to be reserved on some systems for the actual system language
@AlexHTW I can help with the Turkish language |
I noticed that I didn't add the "Tokens used: xx (xx prompt, xx completion)" part to the translations, because it is the only general bot message coming from another class. Should I add it? Then I would need to add the |
@muhammed540 |
@AlexHTW Send me the texts and I will translate them. Then add it to your own files. |
@muhammed540 great, here are the texts
Edit:
Thanks for your help! |
Great work @AlexHTW!
Sure! Maybe you could reuse the same Maybe these could be localized as well?
Also, one last minor thing, maybe you could add a small section in the README explaining how to contribute with new translations! 🚀 |
Hey @n3d1117 , thanks for the feedback!
Yes, of course 🤦, thanks for the hint!
Ah, I didn't realize they are also send in the bot. Will add them, @muhammed540 Please also translate those 🇹🇷
Yes, of course, I am really looking forward to language additions from other people! |
Works for me! Thanks |
|
@muhammed540 Thank you very much! Is it possible to rephrase this text: "Bu ay OpenAI hesabınız $ harcadı" with the $-amount at the end? Because the dollar amount is inserted after the phrase in the code. Or does it sound okay if you say "Bu ay OpenAI hesabınız $ harcadı 10"? |
New sentence: |
@AlexHTW "sohbet jetonu" -> "sohbet token'i" "Yazıya çevirme" -> "Yazıya çevirilmiş hali" "Yeniden gönderilecek bir şeyiniz yok" -> "Yeniden gönderilecek bir şey yok" "dakika ve" -> "dakika" (The word "and -> ve" is meaningless) |
@muhammed540
does that also mean: Here is the complete set of turkish translations, looking good now? "tr": {
"help_description":"Yardım mesajını göster",
"reset_description":"Konuşmayı sıfırla. İsteğe bağlı olarak botun nasıl davranacağını belirleyin (Örneğin: /reset Sen yardımcı bir asistansın)",
"image_description":"Verilen komuta göre görüntü üret (Örneğin /image kedi)",
"stats_description":"Mevcut kullanım istatistiklerinizi alın",
"resend_description":"En son mesajı yeniden gönder",
"chat_description":"Bot ile sohbet edin!",
"disallowed":"Üzgünüz, bu botu kullanmanıza izin verilmiyor. Botun kaynak koduna göz atmak isterseniz: https://github.com/n3d1117/chatgpt-telegram-bot",
"budget_limit":"Üzgünüz, kullanım limitinize ulaştınız.",
"help_text":["Ben bir ChatGPT botuyum, konuş benimle!", "Bana bir sesli mesaj veya dosya gönderin, sizin için yazıya çevireyim", "Açık kaynak kodu: https://github.com/n3d1117/chatgpt-telegram-bot"],
"stats_conversation":["Güncel sohbet", "sohbet mesajı", "sohbet token'i"],
"usage_today":"Bugünkü kullanım:",
"usage_month":"Bu ayki kullanım:",
"stats_tokens":"sohbet token'i kullanıldı.",
"stats_images":"görüntüler oluşturuldu.",
"stats_transcribe":["dakika", "saniye sesten yazıya çeviri yapıldı."],
"stats_total":"💰 Bu kullanımların toplam maliyeti $",
"stats_budget":"Için kalan bütçeniz",
"monthly":"bu ay",
"daily":"bugün",
"all-time":"",
"stats_openai":"Bu ay OpenAI hesabınıza kesilen fatura tutarı: $",
"resend_failed":"Yeniden gönderilecek bir şey yok",
"reset_done":"Tamamlandı!",
"image_no_prompt":"Lütfen komut giriniz (Örneğin /image kedi)",
"image_fail":"Görüntü oluşturulamadı",
"media_download_fail":["Ses dosyası indirilemedi", "Dosyanın çok büyük olmadığından emin olun. (maksimum 20MB)"],
"media_type_fail":"Desteklenmeyen dosya türü",
"transcript":"Yazıya çevirilmiş hali",
"answer":"Cevap",
"transcribe_fail":"Metnin yazıya çevirme işlemi yapılamadı",
"chat_fail":"Yanıt alınamadı",
"prompt":"Komut",
"completion":"Tamamlama",
"openai_rate_limit":"OpenAI maksimum istek limiti aşıldı",
"openai_invalid":"OpenAI Geçersiz istek",
"error":"Bir hata oluştu",
"try_again":"Lütfen birazdan tekrar deneyiniz"
}
|
No, Keep it old. But I found another bug. "Metnin yazıya çevirme işlemi yapılamadı" -> "Sesin yazıya çevirilme işlemi yapılamadı" |
Hey @n3d1117, |
This PR implements a language setting for the general bot messages with translations for german and russian, as suggested in #193.
Text fragments from bot messages are stored for different languages in the
translations.json
file using descriptive keys.The bot messages in
telegram_bot.py
have been replaced by function calls pulling the desired language option of a text fragment. I decided to store text fragments without variables or formatting for better decoupling and easier addition of new languages. However, maybe it obscures the actual output in the code.The language can be set in the .env variable
LANGUAGE
using the ISO 639-1 code (en
,de
,ru
). With a possible addition of user settings it can hopefully be easily set per user in the future.I think this feature will be a useful addition to many (myself included). However, it probably complicates maintainability and the addition of new bot messages. Looking forward to your thoughts on this @n3d1117.
@C0la149 Can you check out this PR, test it and maybe give feedback on the russian translations?
todo: