Is there some kind of Auto-i18n where the function sends a request to a server if there is no localization available? The server could in turn request a translation from a service and add it to the localization files
This does exist, there are a few translation-as-a-service companies that offer more or less what you want. It's not exactly as you are describing, but I have a pipeline setup for an app I built that will extract and machine translate strings at build time. It would be pretty trivial to just do the extraction part and send off the files to whatever endpoint you want (being a human or a machine translating in the end), if you wanted to "roll your own".
Comments
Is there some kind of Auto-i18n where the function sends a request to a server if there is no localization available? The server could in turn request a translation from a service and add it to the localization files
This does exist, there are a few translation-as-a-service companies that offer more or less what you want. It's not exactly as you are describing, but I have a pipeline setup for an app I built that will extract and machine translate strings at build time. It would be pretty trivial to just do the extraction part and send off the files to whatever endpoint you want (being a human or a machine translating in the end), if you wanted to "roll your own".
I believe the library mentioned in the article (i18next) provides the necessary hooks to do this. See ‘saveMissing’ option [1].
Though you need a backend to save this and manage translations. The maintainer of that library, locize, business model is to provide such a service.
[1] https://www.i18next.com/how-to/extracting-translations
There’s a really nice babel plugin as well that can do the extraction.