-
Notifications
You must be signed in to change notification settings - Fork 6
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
Availability values "no", "readily", and "after-download" might be unclear to non-native speakers #12
Comments
In general JavaScript enums are not internationalized, so this issue is a bit surprising. E.g. other platform enums that are similar are enum DocumentReadyState { "loading", "interactive", "complete" };
enum CanPlayTypeResult { "" /* empty string */, "maybe", "probably" };
enum TextTrackMode { "disabled", "hidden", "showing" }; I don't recall any requests to internationalize these, or other, JavaScript enums. As you note, a true boolean is not possible here. Given that, I think it would be pretty surprising to use the string And I think I don't think I understand the relevance of ITS. It seems to be an XML vocabulary, not a JavaScript API? |
I probably titled this wrong. By "internationalized" here, I do not mean "localized into different languages". What I'm trying to get at by bikeshedding the value names (and let's stipulate that I am bikeshedding) is... Users of JS APIs are generally software developers and thus have some familiarity with English. However, fluency varies greatly. To ensure the users understand an API, enum values should be chosen that do not depend on English idiom, humor, or other interpretation. In this case, I think the term In your list of examples, most of them are fine, given that the specific definition of each enum term is likely to be in the spec and the terms are relatively distinct (knowing something about the Web platform, I can guess what they means). I cited ITS because it describes attributes related to translation that are commonly used in this space--but also because we took some of the features of ITS and incorporated them into HTML, notably the <p translate=yes>Do not translate HTML keywords like <span translate=no lang="zxx">span</span>.</p> So my thinking was "if |
canTranslate
values no
, readily
and afterDownload
are not internationalized?
Various locations in the readme, including:
https://github.com/WICG/translation-api/blob/main/README.md#for-a-known-source-language
The value for
canTranslate()
uses English keywords or phrases and some of these ("readily" and "afterDownload") are somewhat idiomatic. The justification for not making this method return boolean type valuestrue
andfalse
is that there is a third valueafterDownload
and that using the boolean keywords would be inconsistent with JS practice (for a variety of reasons).I would still probably prefer something more like
true
/false
/download
or perhapsyes
/no
/downloadRequired
. The valuesyes
andno
might be consistent with values for the not-exactly-related attributetranslate
in ITS.The text was updated successfully, but these errors were encountered: