{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/specberus/issues/160","labels_url":"https://api.github.com/repos/w3c/specberus/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/w3c/specberus/issues/160/comments","events_url":"https://api.github.com/repos/w3c/specberus/issues/160/events","html_url":"https://github.com/w3c/specberus/pull/160","id":60482702,"number":160,"title":"i18n UI messages, and start showing explanations for rules from the old checker","user":{"login":"tripu","id":1016538,"avatar_url":"https://avatars.githubusercontent.com/u/1016538?v=3","gravatar_id":"","url":"https://api.github.com/users/tripu","html_url":"https://github.com/tripu","followers_url":"https://api.github.com/users/tripu/followers","following_url":"https://api.github.com/users/tripu/following{/other_user}","gists_url":"https://api.github.com/users/tripu/gists{/gist_id}","starred_url":"https://api.github.com/users/tripu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tripu/subscriptions","organizations_url":"https://api.github.com/users/tripu/orgs","repos_url":"https://api.github.com/users/tripu/repos","events_url":"https://api.github.com/users/tripu/events{/privacy}","received_events_url":"https://api.github.com/users/tripu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/w3c/specberus/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"deniak","id":1696128,"avatar_url":"https://avatars.githubusercontent.com/u/1696128?v=3","gravatar_id":"","url":"https://api.github.com/users/deniak","html_url":"https://github.com/deniak","followers_url":"https://api.github.com/users/deniak/followers","following_url":"https://api.github.com/users/deniak/following{/other_user}","gists_url":"https://api.github.com/users/deniak/gists{/gist_id}","starred_url":"https://api.github.com/users/deniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deniak/subscriptions","organizations_url":"https://api.github.com/users/deniak/orgs","repos_url":"https://api.github.com/users/deniak/repos","events_url":"https://api.github.com/users/deniak/events{/privacy}","received_events_url":"https://api.github.com/users/deniak/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-03-10T11:04:26Z","updated_at":"2015-03-13T12:16:50Z","closed_at":"2015-03-13T02:40:44Z","pull_request":{"url":"https://api.github.com/repos/w3c/specberus/pulls/160","html_url":"https://github.com/w3c/specberus/pull/160","diff_url":"https://github.com/w3c/specberus/pull/160.diff","patch_url":"https://github.com/w3c/specberus/pull/160.patch"},"body":"Changes, in a nutshell (a *large* nutshell):\r\n\r\n* The same UI messages that were in `l10n.js` are now duplicated in two languages: `l10n-en_GB.js` and `l10n-es_ES.js`.\r\n* &hellip;which are identical right now (both are in English), except for the values of these two keys: `heuristic.group.candidate` and `heuristic.group.not-found`, which are translated into Spanish (for testing purposes).\r\n* Added a field `lang` to the general configuration in `validator.js` (set to `en_GB`).\r\n* Tweaked slightly @deniak's `rules.json` so that now, instead of being a huge array, it's a huge object. And the IDs of profiles (`WD`, `REC`, etc) are the keys in that object.\r\n* &hellip;and that is to be able to maintain a new file of *selectors*, `l10n-selectors.js`. This file associates each *ID of a user message* (the same we have in `l10n-en_GB.js`) with *the JS selector that will retrieve the user-friendly, verbose description of a rule*. These *selectors* are applied to `rules.json` calling `eval()` (yes, `eval()`!). These user-friendly descriptions are the ones you see in [the old pubrules checker](http://www.w3.org/2005/07/pubrules).\r\n* And this new verbose explanation about a rule is shown in Specberus' UI now.\r\n* Added 3 new tests to make sure that all values in `l10n-selectors.js` resolve correctly to strings in `rules.json`. This is to make the whole thing a bit more robust&nbsp;&mdash;&nbsp;writing selectors like this, and passing them along to `eval()` would be error-prone otherwise.\r\n\r\nWork that is pending, and improvements:\r\n\r\n* @deniak's program to generate `rules.json` ideally should produce this version (a large object, instead of a large array).\r\n* Continue writing *selectors* for all rules (there are only 6 now).\r\n* At some point, translate messages to other languages? (this isn't even discussed, and has no priority whatsoever at the moment).\r\n* Switching between different languages (if ever we support several) should be done on the UI, by the user (not hard-coding the locale in `validator.js`).\r\n* Get rid of `eval()`; do it better.\r\n* Right now, `l10n-selectors.js` assumes that the profile is `WD`. When we start supporting other types of docs in Echidna, we'll have to refactor this, so that the profile is a parameter.\r\n* Come up with a better way to maintain rules, *selectors* and messages!"},"comment":{"url":"https://api.github.com/repos/w3c/specberus/issues/comments/78944756","html_url":"https://github.com/w3c/specberus/pull/160#issuecomment-78944756","issue_url":"https://api.github.com/repos/w3c/specberus/issues/160","id":78944756,"user":{"login":"astorije","id":113730,"avatar_url":"https://avatars.githubusercontent.com/u/113730?v=3","gravatar_id":"","url":"https://api.github.com/users/astorije","html_url":"https://github.com/astorije","followers_url":"https://api.github.com/users/astorije/followers","following_url":"https://api.github.com/users/astorije/following{/other_user}","gists_url":"https://api.github.com/users/astorije/gists{/gist_id}","starred_url":"https://api.github.com/users/astorije/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astorije/subscriptions","organizations_url":"https://api.github.com/users/astorije/orgs","repos_url":"https://api.github.com/users/astorije/repos","events_url":"https://api.github.com/users/astorije/events{/privacy}","received_events_url":"https://api.github.com/users/astorije/received_events","type":"User","site_admin":false},"created_at":"2015-03-13T12:16:50Z","updated_at":"2015-03-13T12:16:50Z","body":"I'm a bit unclear: does this PR add any feature? Spanish support, even if poor, seems one. If so, maybe this should have triggered version `1.1.0` instead of `1.0.2` but I agree it's borderline here.\r\n\r\nHowever... urgh to `eval()`! I didn't think this PR would make it to master until it's being removed :-("}}