-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How does locale get inside an XRSession? #1393
Comments
The main question is what would be localized? XR sessions themselves do not really contain any localizeable content. They contain graphics, supplied by the app developer, who can choose to localize inside the rendered content. The main localizeable content one may encounter within an XR session are permissions prompts, and "trusted UI" like the blurred menu when you temporarily exit XR, which are both typically controlled by the browser chrome. I don't think it is a Web norm for pagecontent to dictacte the localization of browser chrome, and I also don't think devices currently allow browsers that type of control. (There's also a significant security issue with giving page content any control over the presentation of "trusted UI") |
How does the app developer know what localization to use for the rendered content? Is there no affordance for the request to include that information? I get that the XR experience is "all just pixels", but some of those pixels might form shapes that are text or culturally appropriate images. As an app developer, how do I find out what locale to use to localize that content? How do I find out what locale the host site would like me to use?
Page content and browser chrome integrate together in some places. There are active discussions about better integrating e.g. I wouldn't say that this is control either, but a way of providing a hint: "hey, it would be nice if the session were localized in French, because this page is in French". Otherwise, is everything in |
Same as how webapp developers know what localization to use for their website? Either explicit settings from the user, or This is not a new problem.
I don't understand, the "host site" and "app developer" are the same codebase. An XRSession is driven by This question is roughly equivalent to the question of "how does an HTML I think you might have a misunderstanding of how XR sessions work.
Yes, however these are discussions about specific controls. There are no such "specific" controls provided by the browser in XR sessions. There may be icons/etc for trusted UI, and then there's the trusted UI itself, but trusted UI is more equivalent to browser context menus than date pickers: you absolutely do not want to give content control over that, and the standard doesn't really dictate what goes in these menus to any level of specificity such that it could be localized. Fundamentally, what is the thing being localized? Within an XR session, here's what can happen that's potentially localizeable:
What are you imagining as localizeable content here? Footnotes
|
Right. So every application developer is free to include a way for the locale to be passed in to an XRSession, but there is no affordance provided by XRSession to make this consisent.
I'm not claiming it is a new problem. I'm asking how it should happen. Suppose I have a page in French with a button to launch an XR experience. How do I (as the invoker writing the Web page) tell my XRSession to use the French localization? Sure, I'm the developer of the session too, but do I really have to invent my own mechanism for that?
Agreed. I'm asking if XR should or already does provide a way for XR app developers to get this consistently vs. rolling their own. Accept-Language or navigator.language are not the same thing as the page language.
No argument with these.
Probably not, but I want to make allowances in case I am wrong. I have read one specification one time and so am aware I probably have blind spots. |
Why must it be consistent? What benefit is derived from such consistency? Why is this one piece of information privileged in such a way that it needs a special conduit into the session, when there already is a generic conduit for any and all information the session needs to render its content? Let's say I'm writing an XR game. I'll probably want to know the locale. I'll also probably want to know the user's name, and their avatar preferences, among many many other pieces of game information. All of this is going to be communicated at session startup somehow, probably passed in as a structured bag of game config/state. Why is locale special? Isn't it counterproductive to ask developers to pull that out of their game config?
I don't understand why there is a "mechanism" here at all. It's just passing information around, in ways standard to Javascript. I feel like this is equivalent to asking asking "how do I, as the invoker writing my web page, tell a function I am invoking to use the French localization"? There is no reason for there to be a consistent specced answer for that, and of course there currently isn't. There is no such specified mechanism for canvas, or requestAnimationFrame, or fullscreen, or any other API that behaves somewhat like XRSession. Why is XRSession special here?
I understand they are not the same. There is no current specced "consistent" way of talking about page language, developers always roll their own, and that's quite understandable since page language may need to be set locally, or on the server side, or using other signals. There may be some potential for an i18n standard that allows pages to talk about page language more consistently (
In that case, I'd like to understand how in your eyes XRSession is different from WebGL content on In fact, I'd go as far as saying that given that XRSession uses WebGL under the hood; if the thing you are asking for is indeed something that should exist (which I am still far from convinced on), it is actively bad architecture for WebXR to be the spec to design it in. Put differently: I think it is extremely weird for WebXR to be the first place this question is asked, and I think us working on this problem will lead to an extremely bad solution if it is in fact a real problem. |
A simple answer to my question appears to be: app developers are expected to define locale inputs for their application as needed.
The usual answer to this is: for most runtime environments, the locale is expected to be contextual. Wiring it up contextually saves every developer everywhere from having to think about it and ensure that the information is present. Unlike some values that can be read off the runtime (default timezone, to pick an example) or which are application specific (user name might be an example), the locale can be sourced from different contexts ( If WebXR disagrees, just say so and resolve the issue. I asked the question not to prosecute a specific worldview but to honestly find out if you'd thought about the problem and had an answer. Also happy to meet with you folks at TPAC if there is interest in a high-bandwidth timeboxed conversation. |
Yes, that's accurate.
Given the framing, I still feel like I'm missing something here. Locale can be sourced from different contexts, but the current consensus of the Web Platform appears to be that that is intentional design to leave that choice up to the application developer. As I said before, nothing on the Web is consistent about this now, how does consistency introduced here but nowhere else lead to anything useful?
I remain confused as to what this means. What does this wire to on the other end, given that application locale may source from navigator.language, client-side settings, or server-side heuristics/settings, at the app developer's choice? Perhaps you could sketch an example setup where an application does this?
I'm not going to be at TPAC but happy to discuss this over a call. It's more that I'm finding the question here somewhat baffling because it is the first time I have seen this type of thing expected of a Web API, and I work in internationalization. There's a mismatch of expectations here and I'd like to understand where it comes from. I've asked a bunch of questions in my previous comment above to try and tease that appart. |
Closing the issue since the question was answered, however I'd still like to understand the mismatch. I don't want to have to wait until i18n WG review to hash this out. |
Alternatively, I believe @toji will be at TPAC and can discuss this. |
I'm attending TPAC remotely this year, sorry. |
This is part of your I18N review 😉
Let's schedule a call after TPAC then. I saw immersive on the calendar today, but was already booked (plus the power thing). |
In discussing #1391 and thinking its implications, it occurs to me that there doesn't seem to be a way for locale to be communicated/set on an XR session (or other containers, such as views or such). How does the XR session find out what language/locale the user wants for localization (or other contextual information)?
I imagine this is actually a solved problem, but there is no mention of it in this spec. Shouldn't page authors have an interface for requesting the localized experience they want, e.g. to match the page hosting or linking to the XR experience?
(Because of timing issues, I'm going to file this as a personal comment now. The I18N WG will review it later and may promote it to needs-resolution at that time.)
The text was updated successfully, but these errors were encountered: