Closed marcoscaceres closed 5 years ago
@marcoscaceres can I try this ?
@marcoscaceres That's a WebExtensions API but ReSpec is not an extension 😅
Oh whoops... totally missed that. I was wondering how I'd missed that API... would have been a "too good to be true" addition to the web :)
@marcoscaceres can we use this: https://www.npmjs.com/package/languagedetect ?
@CodHeK I don't think we want to add a 200+ KiB dependency. Condition: It should be small enough.
@saschanaz could you please help me find where the WebIDL attributes and operation identfiers
are ?
@CodHeK Here, but what are you going to do?
@saschanaz I am just trying to understand what the issue is about and see if we could do anything ...
@saschanaz what are the attributes/identifier here which need to be checked for the language ?
@CodHeK data.name
should be checked there as that presents IDL identifiers. I think data.name
is enough.
I think this might be impossible to do reliably... @CodHeK, before looking at code, check if it's even possible at all without an actual real dictionary. I just don't think it is, because, for example:
attribute Laser laser;
So we would need some kind of dictionary lookup.... unless there is some actual Dictionary API on the web we would use, but that seems a bit extreme.
I got two packages, typo-js
(83kb) and check-word
(3kb) they both seem pretty lightweight, we could use them I guess .
ok, 83kb is way too massive... and looks like check-word doesn't give us the precision :(
https://github.com/S0c5/node-check-word/blob/master/index.js#L8
check-word
is not 3 KiB as its dictionaries are already 37 MiB.
it has the whole dictionary. That's awesome :) lol..
I think I'm going to close this.
See this Twitter thread: https://twitter.com/marcosc/status/1093151940769341440?s=20
In W3C docs/specs, we should check WebIDL attributes and operation identfiers are in US English.
I wonder if there is some way of doing it? Need to research.