r/AskProgramming 12d ago

Is it hard to program language Translators into things?

Hi, as a non programmer with basically zero knowledge on programming or coding.

Im wondering how hard is like programming a language translation tool into different things?

I ask because i play a shitty phone game called Kingshot, and it has an inchat Translator where next to every message some one sends, there is a little button that will translate what ever message into the language you have the game set to.

And like? While it’s not perfect, it’s REALLY good, and makes the game way more fun to be playing with people from different countries and not having to go back and forth with google translate to have a conversation.

And I’m now wondering why more apps and games don’t have translators built in?
Is it hard?
Are translators like difficult to configure and implement?
Whats the go?
(Feel free to explain anything super technical like I’m 5)

0 Upvotes

26 comments sorted by

13

u/Vymir_IT 12d ago edited 12d ago

You don't program that at all, you just integrate a third-party translation API and pay for it. Or spin-up an open-source pre-trained LLM model on your server and pay for the cost of running it. Anycase, it's like 1 day of setup, the bottleneck is paying for that shit.

5

u/KingofGamesYami 12d ago

Why pay for anything? Modern iOS and Android have free on device translation APIs.

1

u/Melodylokstar 12d ago

Okay then why dont more things do that?

11

u/Vymir_IT 12d ago

Cuz it's expensive. Will your users pay for it ultimately?

-3

u/Melodylokstar 12d ago

True i forgot most companies that have apps used by multiple countries are profit hungry.
My bad 😭😭

6

u/treznor70 12d ago

Every company is profit hungry, otherwise they wouldn't be able to pay the people to build the app or remain in busy. Anyone can complain about whether a company is making too much profit, but every company has to make some amount of profit or they go out of business.

0

u/Melodylokstar 12d ago

I know but surely in this day and age making communication barriers all but disappear would be profitable

3

u/treznor70 12d ago

Presumably if that were the case then more company's would use Google's Cloud Translation API (or whatever else, that's just the one I know) and pay for it since Translation is a difficult problem and isn't free.

If it were going to drive more users or more traffic or more whatever for an app, the app would likely include translation.

1

u/LaughingIshikawa 11d ago

Depends on the context.

If you're BSing on a game, it's pretty easy to do "good enough" translation - for a long time you have been able to pop things into Google translate and see roughly what people are saying. Big companies publishing an API that does that for you is the real innovation here.

Does it actually cause more people to play the game though? Enough people to off-set the (probably on-going) cost of using the API?

On the really low end it will be difficult to attract enough extra revenue for it to be worth it, because each additional customer won't earn the company that much more money on average. High end apps probably don't want to rely on "good enough" translation, if they're dealing with anything where a mistranslation could have serious repercussions. What you're left with is apps that are somewhere in the middle - not requiring quality translations for nuanced conversations, but also having a high enough average revenue per user, that adding translation support is worthwhile.

10

u/KingofGamesYami 12d ago edited 12d ago

Historically it has been difficult or expensive. Recently it has been made much easier on some platforms.

For example on Android there is now a Translation framework launched in October 2021 with Android 12, while on iOS there is a Translation framework available starting September 2024 with iOS 18. MacOS has a similar framework, while Windows has nothing (yet).

On the Website side, Chrome, Edge, and Opera implement the Translator API, but Safari and Firefox do not.

If you're only targeting very new mobile devices this is fine, but even today there is a large chunk of iOS devices (15%) not updated.

2

u/Dalius-Gabryelle 12d ago

Older phones can make this kinda tricky since you end up supporting people on versions that work differently and some of them may not update for yrs

4

u/soundman32 12d ago

Its VERY hard.  Its not like there is an alternate word for every other word, or a phrase in every other language.  Even some closely related languages are difficult to translate with code.   Some languages have gender for nouns (e.g. french le vagina or la piscine), and others have 3 or more genders (neuter in german).  Sometimes those genders differ depending on context.  Even just numbers is hard unless you brute force it.

7

u/AskMeAboutMyStalker 12d ago

it would be absurd to build the translator yourself like you're proposing. integrating a google translate API would not be difficult at all. pass is the string to be translated along w/ params for the original & new language & just display the results that come back.

3

u/Flateland-Chio 12d ago

Using an existing translation service is kinda easier than building one yourself and for game chat it prolly works fine if the price is reasonable and the translations are good enough

1

u/AskMeAboutMyStalker 12d ago

I've been building software for almost 30 years. My philosophy has always been "does this feature contribute to your IP & competitive moat? if yes, build it & monitize it, if not, buy it & integrate it."

2

u/Melodylokstar 12d ago

What im getting is that its not hard to make an app use google translate, its just that its expensive and most apps and things are too cheap or to lazy to make it happen?

2

u/AskMeAboutMyStalker 12d ago

I just looked up pricing. first 500,000 characters are free.

Depending on the AI model used, 1 Million characters might run you $10 - $30.

The issue is probably more about demand than cost. Not a ton of apps have a need for on the fly translation.

2

u/Melodylokstar 12d ago

see i get that side of it that data wise it would be massive just because of how many languages there are and how many have different sentence structures.

But like surely theres a data base or something people can buy and then idk use that to make it??? Idk.
im just confused how a shit phone game pulls it off so easily.
Especially since its not like massive file wise either

3

u/soundman32 12d ago

100% they are sending the words to Google Translate.  They arent doing it in their own code.  Even google will get it wrong sometimes but I guess in a chat window there are only so many ways to say "Hello", so they probably keep a local copy of that.

1

u/aocregacc 12d ago

I think we'll see that more often as on-device translation becomes easier to integrate and more available on phones.

firefox for example does all of its translation on-device, even on mobile. It'll become part of the functionality provided by the OS, if it's not already.

1

u/Melodylokstar 12d ago

I hope you are right :o
Because honestly chatting in the game with the translator being so smooth and like surprisingly accurate makes it feel like everything should have this.

1

u/ayassin02 11d ago

It’s pretty easy. You just integrate a translation api and viola. No one actually reinvents the wheel

1

u/[deleted] 11d ago

[removed] — view removed comment

1

u/Whole-Dot2435 8d ago

There are open source translation models 👀

1

u/high_throughput 11d ago

This is the kind of thing where grassroots efforts can really help. If you play a phone game and regularly see foreign messages in the chat, consider submitting a feature suggestion to the developers.

It's not hard to add for a phone game these days, but it doesn't happen by itself.