In-Experience Text Chat Translations

I never faced any Right to Left issues as I’m Right Handed, I recently learned the Hebrew Alefbet and Hebrew is an Right to Left language but that was only because Arabic is my second language, also English already has a ton of dialects with the most notable being the American and the British dialects. Many countries including the UAE also use the Saudi Dialect

Here is an example of the word “Color”:

American: Color
British: Colour

1 Like

Understanding Modern Standard Arabic allows individuals to communicate effectively across the Arab world. While dialects may vary significantly at times, people can generally comprehend and communicate well by utilizing Modern Standard Arabic as a common means of communication

Difference between british and American dialects is no where close the difference between Egyptian or saudi dialect when compared to Moroccon dialect lol

2 Likes

A small explaination about arabic dialects lol

3 Likes

not gonna lie you’re 100% true, but in the british dialect, they sort of change the sound of the letter “T” to be pronounced like ʔ [IPA Symbol], but is oftentimes reference as an apostrophe when written, pretty much like how Uzbek Latin writes ü as o‘ and ğ as g‘, and some roads I see writes ع as 'a, but some people use 3 since it has a similar shape to an 3

anyways let’s stop going off-topic in an announcement and stay on-topic

It’s probably translating more format terms and not words like “skibidi toilet” or “Fanum tax” or “Ohio gyat rizzler”

2 Likes

Nice update, glad the translation is optional.

For multilinguals, can we get an option to choose multiple languages to exclude them from translation?

I don’t see why the “show original message” button should be hidden by default. I think all translated messages should be marked as such so as to avoid any misunderstandings in case the translation isn’t 100% accurate.

1 Like

Support for custom chat systems is needed

This feature has actually been really helpful already. I’ve talked to people speaking languages I don’t know, and it’s proven to be pretty great so far. Not sure how accurate it is, but it’s enough that I don’t have to Google translate everything they’re saying.

Edit: elaborated on a couple things

This is a great addition to TextChatService, but there are 2 reasons why I have not implemented this service into my game yet. The first and biggest reason is a lack of default text channel tabs UI, especially a tab for private messages between 2 players. Another smaller reason is the lack of an ability for the player to dynamically resize the chatting window in-game like the legacy chat. I think once these two features are supported in the new TextChatService, I will definitely start using it.

1 Like

It absolutely is. You cannot offer an engine to developers and limit their customizability abilities like this. If I want to be able to customize the chat however I want, I should be able to. If I want to add a, for example, profile icons to the chat, I should be able to.

LegacyChatService will always be superior to TextChatService in terms of customization and freedom. And it should be.

I’ve turned it on and it doesn’t seem to do anything at all. All the russian text is still russian, polish is still polish, german is still german, turkish is still turkish etc. I don’t see ANY difference with it enabled compared to it being disabled.

Edit: Wait it HAS to be the new chat for it to work? There is like 3 million games that still have the old chat. This doesn’t seem usefull if the older chat doesn’t support it.
image
image

There is no plans to support the old chat as that is no longer updated by Roblox. The game requires to have the new chat for it to work.

Good news! I have played a bit in the LegacyChat, and there is new code for chat translation! I even got it to work (through a kind of sketchy workaround, basically strait up replacing messageObj.Message with the translated version). I’ll look into it deeper to figure out how to properly get it to work

@metatablecatmaid
@Emp_or
@Rick007110
@nvckx
:wink:

EDIT

This is how to get it working

This variable has to be overwritten (since it’s disabled)

It has to be overwritten in these scripts

  • ChatChannels (Server module script)
  • ChatMain (Client module script)
  • ChatChannel (Under ChatMain)
  • MessageLogDisplay (Under ChatMain, optionnal? unsure what this one does)
  • DefaultChatMessage (inside ClientChatModule/MessageCreatorModules

The Speaker module also has the variable, but it does nothing

ChatMain and ChatChannel also listens for a BoolValue under ChatMain
The BoolValue must be named “ChatTranslationEnabled” and have a value of true


(It isn’t on this screenshot but yeah)

And this is the result!
image
(Ignore the custom look I gave to the chat)

It’s highly likely that UserSettings():IsUserFeatureEnabled("UserHandleChatHotKeyWithContextActionService") will be true in the future when chat translations is enabled in the settings (I tested and it was false even with the setting on). The only thing that seems like might be required in the future is the BoolValue, though it is also likely that it will be added eventually

3 Likes

It uses TextFilterTranslatedResult (which has no documentation yet) from TextService:FilterAndTranslateStringAsync().

This is how TextFilterTranslatedResult is used inside the LegacyChat (it’s translations:GetTranslationForLocale(). Locale is “en”, “fr”, … or “en-us”, “fr-ca”, …)
listOfTargetLanguages is a table containing “en”, “fr”, …


And how TextService is used:

Since the LegacyChat uses normal lua scripts inside the Chat tab (not core scripts or anything) this is probably accessible by anyone, which is amaizing :smiley:

@McDmnks, @ketrab2004, @bluebxrrybot Seems like the support is there!

1 Like

Very interesting. It would be nice if Roblox documented that method other than just provide the parameters. Player.LocaleId isn’t just “en” or “fr”, it’s “en-us”. The “en” part is the ISO 639-1 language code. The “us” part is the ISO 3166-1 Alpha 2 country code. I know about that because I had to key all that information into a MySQL database for a web application awhile back.

List of ISO 639 language codes
List of ISO 3166-1 alpha-2 country codes

Now the question becomes what is that array listOfTargetLanguages filled with?

EDIT:

I think figured out the correct process to use this.

  1. Use TextService:FilterAndTranslateStringAsync() to filter the message as normal. This returns a TextFilterTranslatedResult.
  2. Call TextFilterTranslatedResult:GetTranslationForLocale(). This returns a TextFilterResult object.
  3. Finally, use TextFilterResult:GetChatForUserAsync() to get the filtered and translated string on a per user basis.

The language table is a table of locale identifiers such as “en-us” or “fr-fr”.

EDIT:

Well, I implemented it and it doesn’t seem to be working. TextFilterTranslatedResult:GetTranslationForLocale() ALWAYS returns nil which kills it. So I’ve reverted to the non-translated version for now.

The table listOfTargetLanguages provided to FilterAndTranslateStringAsync() is not a table with “en-us” but rather “en” alone. This might be why it isn’t working for you

This is the fonction used in the legacy chat to convert it

function getLanguageCodeFromLocale(localeId)
	-- Get every match of not a "-"
	local codeMatch = string.gmatch(localeId, "[^-]+")()
	if codeMatch then
		return codeMatch
	else
		return "en"
	end
end

image

Using just “en” for GetTranslationForLocale also works, since well, it works…

But in the Speaker module, the full string is used

I actually have a table that was generated by the Roblox Assistant that has all that information in it. I’ll try this and see what it does.

EDIT:

Nope. Tried it both in Studio and in the live game. Still returns nil.

I want to point out that Player.LocaleId returns “en-us” for me so it should take that based on the code given.

EDIT 2:

I played with it a bit and I still cannot get it to work. I have never seen it work with the legacy chat. That makes me wonder if it ever worked.

1 Like

I got it to work in game, in the legacy chat, however, I tried to use TextService alone, and that doesn’t work (I tried a bunch of different things, like using “fr” alone in the table, …, and still nothing)

local TextService = game:GetService("TextService")

task.wait(5) -- The sender must be connected

TextFilterTranslatedResult = TextService:FilterAndTranslateStringAsync(
	"This message is in english",
	79690730, -- My UserId
	{"en-us","fr-ca"},
	Enum.TextFilterContext.PublicChat
)

print(TextFilterTranslatedResult:GetTranslations())
print(TextFilterTranslatedResult:GetTranslationForLocale("fr"):GetNonChatStringForBroadcastAsync())

I am wondering if either it only works in live games (though that didn’t work for you) or maybe there needs to be two players in game with their LocaleId set to “en” and “fr”, as an example

Is there a method to enable automatic activation?

I’ve noticed that when launching Roblox (using the desktop application), the setting for “Automatic Chat Translation” is consistently disabled, while the option to view untranslated messages remains enabled. However, upon enabling automatic translation and subsequently joining another game, the setting remains active. Yet, upon closing and reopening Roblox, the setting reverts to being disabled.

In studio, the setting seems to also be disabled after turning it on.

In my opinion, it would be beneficial if this feature were enabled by default or if user preferences were saved, akin to settings such as volume, graphics, and camera sensitivity for example.

Below, I’ve attached a screen recording illustrating the issue for reference.

1 Like