alt-art / TelegramBridge

Simple spigot plugin to make communication with groups on Telegram
https://modrinth.com/plugin/telegram-bridge
MIT License
2 stars 0 forks source link

Pre-done translations #14

Closed PystoyPlayer closed 5 months ago

PystoyPlayer commented 5 months ago

Hi again. How about to make some pre-done localizations ? For example in a /locale/ folder and put a toggle in config. Here's the Russian translation from me:

# Перевёл @pystoyplayer (tg/discord)
# Названия месяцев для команды /time
months: [ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' ]
# Типы медиа для файлов, отправляемых в чат
mediaTypes: [ 'фото', 'видео', 'документ', 'аудио', 'голосовое', 'стикер', 'контакт', 'локацию', 'опрос', 'файл' ]

# При заходе игрока на сервер
join: '%playername% присоединился к игре!'
# При выходе игрока с сервера
leave: '%playername% покинул игру!'
# Когда сдох
death: '%playername% погиб! %deathmessage%'
# Когда получил ачивку
advancement: '%playername% получил достижение «%advancement%»!'
# Когда ложится спать
sleep: '%playername% лёг спать!'

# Когда в игре кто-то отправляет сообщение
chatMessage: '[%playername%]: %message%'
# Когда в телеграме кто-то отправляет сообщение
telegramMessage: '§7[§bTelegram§7] §f[%user%] %message%'
# Когда в телеграме кто-то отправляет медиафайл 
telegramMedia: '§7[§bTelegram§7] §f[%user%] отправляет %type%.\n %caption%'
# Когда кто-то отвечает на сообщение в телеграме
telegramReply: '- §bОтвет §7%user% -\n'

# Команда /online
online: 'На сервере %count% игроков онлайн%players%'
# Команда /time
time: '%emoji% Текущее время: %time%\nДата: %month% %day% %year%'
PystoyPlayer commented 5 months ago

oh. btw, look what I've found https://modrinth.com/plugin/tgbridge

alt-art commented 5 months ago

I thought of this very good idea, I just didn't implement it because I wanted to do something more elaborate. The hypixel server for example has translation into several languages, I don't know if they use geolocation or something like that, or it's just a dedicated server just for the community of that language.

Sometimes I found out that some plugins automatically set my language, but I don't know how.

alt-art commented 5 months ago

oh. btw, look what I've found https://modrinth.com/plugin/tgbridge

Good to see some new projects being born on this niche. This make easier to think in new ideas to my plugin.

I copied someone else too because I had issues with a plugin.

I guess it's better to have more options than just one.

PystoyPlayer commented 5 months ago

I thought of this very good idea, I just didn't implement it because I wanted to do something more elaborate. The hypixel server for example has translation into several languages, I don't know if they use geolocation or something like that, or it's just a dedicated server just for the community of that language.

Sometimes I found out that some plugins automatically set my language, but I don't know how.

They probably just check your ip and use packets to change all the texts. Check this out: https://www.spigotmc.org/resources/triton-translate-your-server.30331/

alt-art commented 5 months ago

I thought of this very good idea, I just didn't implement it because I wanted to do something more elaborate. The hypixel server for example has translation into several languages, I don't know if they use geolocation or something like that, or it's just a dedicated server just for the community of that language. Sometimes I found out that some plugins automatically set my language, but I don't know how.

They probably just check your ip and use packets to change all the texts. Check this out: https://www.spigotmc.org/resources/triton-translate-your-server.30331/

This is interesting. I will do just the basic command to set the server language and one for individual players.

alt-art commented 5 months ago

In my opinion, it would be more cool if some plugin settled the player language, and it could be captured via the player NBT tag plus some real I18n grammar computation.