Skip to content
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

Human-readable "name" has i18n problem - rely on "title"/"titles" in Thing instead? #630

Closed
mmccool opened this issue May 7, 2019 · 19 comments
Labels
i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. Needs review Issue was fixed, but is still open for post-merge reviews

Comments

@mmccool
Copy link
Contributor

mmccool commented May 7, 2019

If the default language is changed, for example as part of HTTP negotiation returning text for title and description using an alternative language, then the interpretation (and potentially display, eg in a web dashboard) of "name" and "support" (in case the value of "support" is a person's name, for example) will get broken if "name" and "support" are written using a language with a text direction opposite to that of the (new) default language.

I think we need an alternative mechanism for specifying a language explicitly for "name" and "support" that overrides the default language, since the idea is that these strings are immutable and should always be displayed the same way, including language and text direction.

I suggest adding an optional "supportLanguage" name/value to the Thing object. This would would have a BCP47 language tag as a value (potentially with a script subtag, as needed to specify the direction unambiguously) to specify the language for "name" and "support". This would override any default language specified by any other means for those two strings only, whether the default language was specified using @language or through protocol negotiation.

It would be optional, however, and if not present the values of "name" and "support" would be interpreted according to the default language.

In the interest of time, I will prepare a PR based on top of my text direction PR, then we can discuss.

@mmccool
Copy link
Contributor Author

mmccool commented May 7, 2019

Other ways to deal with this:

  1. Allow a nested context for "name" and "support". This is more JSON-LD-ish. However this is tricky since there is no convenient object scope to add it to. It's also a bit obnoxious and verbose.
  2. Allow the values of "name" and "support" to be either strings OR MultiLanguage objects with explicit language tags, eg. "name": { "en": "My Thing" }. However, this has the problem that MultiLanguage implies there could be more than one entry, so technically, we would really want a new class like SingleLanguage (perhaps called StringWithLanguage) that is like MultiLanguage but with a cardinality of exactly 1).
  3. Always interpret "name" and "support" using the first-strong rule, ignoring the default language. This is fragile and has the problem that it's not optional.

I'll create a PR for now based on adding "supportLanguage" but we can discuss these other options here.

@mmccool
Copy link
Contributor Author

mmccool commented May 7, 2019

PR available: mmccool#8.
This is currently set up as a modification of PR #620.

@sebastiankb
Copy link
Contributor

name should be kind of identifier and there should be no language variations.
I understand the purpose to provide language information for the support term. We should rethink to type the support term as anyURL again and use scheme like mailto. What do you think?

@mkovatsc
Copy link
Contributor

mkovatsc commented May 7, 2019

This feels like classic overengineering to me.

I would define the "name" field as a (non-unique) identifier in the default language.
Restricting supprot to anyURI is also good, as people can still be given as mailto URI.

@mkovatsc mkovatsc added the Needs discussion more discussion is needed before getting to a solution label May 7, 2019
@mmccool
Copy link
Contributor Author

mmccool commented May 7, 2019

Yes, but the point is the default language can change due to content negotiation, which will screw up rendering. Anyhow, I've just prepared a PR and we can decide to use it or not. But it's a potential problem that could easily arise in multilanguage contexts. And we can fix it. Or not.

@mkovatsc
Copy link
Contributor

mkovatsc commented May 7, 2019

Oh darn, got it! When dynamically generating a TD for a certain language, that language might be different from the name chosen...

@sebastiankb
Copy link
Contributor

we should drop name and introduce title (mandatory) and titles

I know it is big change

@mkovatsc
Copy link
Contributor

mkovatsc commented May 7, 2019

we should drop name and introduce title (mandatory) and titles

Yes, a big chance at this point, but I also think we need to, as it is basically an i18n issue.

We stuck to name because we thought it is just a "simple string" that can be used as informal identifier. Yet we also have the strong expectation, that this name will be used in UIs. This has a clear i18n requirement. title and titles address this this requirement.

Introducing names does not make sense to me, as name loses its informal identifier aspect (there being only one string). Hence lets use title/titles.

Making title mandatory solves the issue that there must always be a string for the Thing to use in UIs.

Having titles enables dynamic TD generators to serialize a correct title string for the negotiated default language.

@mkovatsc mkovatsc added the bug label May 7, 2019
@mkovatsc
Copy link
Contributor

mkovatsc commented May 7, 2019

@mmccool , can we agree on dropping the supportLanguage feature and rename this issue to reflect the issue with a non-internationalized name?

@mmccool
Copy link
Contributor Author

mmccool commented May 7, 2019

Sure, can drop supportLanguage; using title/titles seems like a good solution to me, as well as making "support" an anyURI. I can include both those changes in my PR, but I'll have to do it tomorrow (it's very late in the evening here and I'll screw it up if I do it now).

I will update the title of this issue.

@mmccool mmccool changed the title Add supportLanguage to define language for "name" and "support" The values of "name" and "support" can break under language negotiation (default language changes) May 7, 2019
@mmccool mmccool changed the title The values of "name" and "support" can break under language negotiation (default language changes) The values of "name" and "support" can be interpreted with the wrong text direction under language negotiation (default language changes) May 7, 2019
@mmccool
Copy link
Contributor Author

mmccool commented May 7, 2019

Title changed. Sorry it's so long, I'm out of brain cells right now.

@mmccool
Copy link
Contributor Author

mmccool commented May 7, 2019

Created this, too: #633. This makes support an anyURI.

@mkovatsc
Copy link
Contributor

mkovatsc commented May 7, 2019

Can we collect +1s for going for title (mandatory) and titles (optional) in Thing?

I am in favor (see #630 (comment))

@mmccool
Copy link
Contributor Author

mmccool commented May 7, 2019

Re title/titles in Thing: +1, in favor. Also, to repeat myself, +1 for support being an anyURI.

@egekorkan
Copy link
Contributor

title/titles in Thing: +1

@mkovatsc mkovatsc changed the title The values of "name" and "support" can be interpreted with the wrong text direction under language negotiation (default language changes) Human-readable "name" has i18n problem - rely on "title"/"titles" in Thing instead? May 7, 2019
@takuki
Copy link
Contributor

takuki commented May 7, 2019

+1 regarding renaming "name" to "title" plus "titles", and also +1 for changing type of "support" to anyURI.

@mkovatsc
Copy link
Contributor

mkovatsc commented May 7, 2019

FYI: We are not renaming, we are kicking name with its identifier definition and allow title and titles as they exist already now also in Thing.

sebastiankb added a commit to sebastiankb/wot-thing-description that referenced this issue May 7, 2019
sebastiankb added a commit that referenced this issue May 7, 2019
Address issue #630 (remove name from Thing level, add title + titles, support is typed to anyURI)
@sebastiankb sebastiankb added Needs review Issue was fixed, but is still open for post-merge reviews and removed Needs discussion more discussion is needed before getting to a solution PR available bug labels May 7, 2019
takuki added a commit that referenced this issue May 8, 2019
"titles" in Thing class is optional (for issue #630)
@takuki
Copy link
Contributor

takuki commented May 8, 2019

I just made changes so that "titles" is now optional while "title" stays mandatory.
Please take a look at here.

@mkovatsc
Copy link
Contributor

mkovatsc commented May 9, 2019

We had this one open as long as possible for the group to review and comment. Since no concerns were raised, I am closing this issue now.

Note that this is not an issue opened by the I18N WG.

@mkovatsc mkovatsc closed this as completed May 9, 2019
@mkovatsc mkovatsc added the i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. label May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. Needs review Issue was fixed, but is still open for post-merge reviews
Projects
None yet
Development

No branches or pull requests

5 participants