42wim / matterbridge

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Apache License 2.0
6.55k stars 616 forks source link

Internationalization (i18n) and Localization (l10n) of generated messages #1197

Open bd808 opened 4 years ago

bd808 commented 4 years ago

Is your feature request related to a problem? Please describe.

A matterbridge I run is being used to connect various IRC, Telegram, and Discord channels together for Wikimedia communities. The initial communities we connected were related to software development and the channels used English as the primary human language. Some of the newer channels we are bridging are for wiki editing communities and these communities are typically formed around a particular human language. The majority of humans do not speak English, so when the bot says things like Forwarded from <username>: Прывітанне Сусвет in a channel where all the other messages are in Belarusian it is a bit jarring for the readers.

The example given above is generated by Btelegram.handleForwarded. I have not done any sort of exhaustive audit of the code base to find other similarly hard coded English strings. It may turn out that there are few of them.

Describe the solution you'd like

Describe alternatives you've considered

Tengo scripts could be used to hack in localization. My bot is using a tengo script to set custom remotenickformat values which localize the protocol when appropriate.

Additional context

Once the application is localizable (string templates read from message bundles of some sort rather than hardcoded), I would be more than happy to help find a translation community to help translate the English source strings into other languages. The Wikimedia movement works with the https://translatewiki.net/ (TWN) community to receive translations for many of its FOSS projects. I can provide introductions and other material support for working with TWN.

patcon commented 3 years ago

Hi! This is perhaps most easily mitigated by adding an "internationalization" mode, where all the padding words are removed and replaced with glyphs or emoji or punctuation.

E.g., Forwarded from <username>: Прывітанне Сусвет could instead be »» <username>: Прывітанне Сусвет :)