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

canXYZ() naming maybe implies boolean return values #19

Closed
domenic opened this issue Sep 17, 2024 · 0 comments
Closed

canXYZ() naming maybe implies boolean return values #19

domenic opened this issue Sep 17, 2024 · 0 comments

Comments

@domenic
Copy link
Collaborator

domenic commented Sep 17, 2024

In addition to the discussions in #7 and #12 about these methods, a simpler problem is that most people expect that a method starting with "can" to return a boolean value.

Maybe if we went in the direction of #7, "can" would still be an OK prefix. But probably we should pick something different, e.g. languageAvailable() / languagePairAvailable().

@domenic domenic closed this as completed in 2363b60 Oct 9, 2024
domenic added a commit to webmachinelearning/writing-assistance-apis that referenced this issue Oct 9, 2024
* Rename from supportsInputLanguage() to languageAvailable(), to match the language detection API. Closes #7. (See also webmachinelearning/translation-api#19.)
* Consolidate the various supportsXYZ() methods into a single createOptionsAvailable() method. This avoids the issue noted in webmachinelearning/translation-api#19, aligns us with the "available" suffix, and most importantly, lets a browser signal that it doesn't support certain combinations. (For example, Chrome right now doesn't support some combinations for the writer API.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant