0

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.

Xan
  • 74,770
  • 16
  • 179
  • 206
ghostfly
  • 728
  • 5
  • 12
  • How is that an *extension*? What you present is a hosted app. I don't think they support `chrome.i18n`. I've edited your question. – Xan Feb 18 '15 at 12:48
  • 1
    Ok yes this particular case is for an app instead of an extension but the semantics for the webstore listing are the same: https://developer.chrome.com/webstore/i18n#details – ghostfly Feb 18 '15 at 18:59
  • Thanks for the documentation link. – Xan Feb 18 '15 at 19:05

2 Answers2

1

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.

Xan
  • 74,770
  • 16
  • 179
  • 206
  • I played with it some more and you can actually do something like `https://www.foo.com/__MSG_@@ui_locale__/endpoint` however that too is bugged since it seems to always resolve to `en_US` regardless of the language you were using when installing and via the chrome apps launcher when the default language is something other than `en_US`. – ghostfly Feb 18 '15 at 23:25
0

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

Reilly Grant
  • 5,590
  • 1
  • 13
  • 23