(You can have a look into vector tiles like from MapTiler or their open source project openmaptiles.org)
I just found this example (has nothing to do with openmaptiles as far I can see): https://js.protomaps.com/examples/multi_language.html
But you are right as this approach does not scale well in regard to using it for all languages out there. So a vector tile stack is a better approach for just switching languages.
(You can have a look into vector tiles like from MapTiler or their open source project openmaptiles.org)
I just found this example (has nothing to do with openmaptiles as far I can see): https://js.protomaps.com/examples/multi_language.html