Search code examples
iosgoogle-translateurl-scheme

iOS translation apps url schemes


I'm trying to enable translating some text in my app. I want user to be able to launch whichever translation tool they use on their device (Google Translate or iTranslate) and see the translation without having to type it. For this, I'm using the url schemes:

googletranslate://
itranslate://

Now, I need to pass the query to those apps. I know how to do this for iTranslate:

itranslate://translate?from=auto&to=en&text=<encoded_string>

This is cool, now I would like to know how to do the same for Google Translate. It needs to automatically detect the language and translate it to english.


Solution

  • It is not currently possible to prefill UI elements in the Google Translate iOS application when opening it from googletranslate:// URLs. The contents of the URL after googletranslate:// appear to be completely ignored. So the most you can get from using these links at the moment is opening the iOS application.

    If this does get implemented at some point in the future, one can test by opening a link like googletranslate://example%20text/?param=value&from=zh_TW. I would strongly recommend that you let your voice be heard on the Google Translate product forum by requesting this feature.

    In the meantime, you may want to consider using Translation API to provide translations within your application. This can be achieved using the REST API.