ghostfly
ghostfly

Reputation: 728

Localizing Chrome Hosted App Urls

I'm attempting to localize a chrome hosted app that uses the Drive SDK and it's not obvious how to route people to a custom URL based on the locale. Within manifest.json I want to put the locale in my app.launch.web_url so once a user lands on my site the correct locale is loaded. I've tried

"app": {
      "launch": {
         "web_url": "__MSG_launchUrl__"
      }
   },

and

"app": {
      "launch": {
         "web_url": "http://www.foo.com/__MSG_locale__/endpoint"
      }
   },

but the first throws an error when you try to upload it because Google isn't pulling the string from the messages.json file. The second fails because although it gets past Google's validator, it interprets __MSG_launchUrl__ as a literal string instead of a lookup variable.

On a similar note, I don't see a way to specify a locale specific url within the Google Drive SDK settings either.

Upvotes: 0

Views: 91

Answers (2)

Xan
Xan

Reputation: 77541

I guess this (the first failure) should be reported to Google as a Web Store problem.

The second method is not supported by the i18n mechanism.

Obviously, the app still needs to be tied to a single verified domain, but it should pass checks if all locales match that domain.

Upvotes: 1

Reilly Grant
Reilly Grant

Reputation: 6093

You can use the Accepts-Language header sent to the server when the app is launched to localize your application.

Upvotes: 0

Related Questions