Comments (8)
I don't have the URL when I run the tests, so without further refactoring, I can't tell if the page is in English or not.
I think it would be easier to deal with this on the Webextension by not running this test if the language is different than English.
from doc-linter-rules.
I don't have the URL when I run the tests
Really? Is window.location
not accessible?
Sebastian
from doc-linter-rules.
Oh, this is a good question, it's executed in a browser so I guess it should be.
I didn't thought about that one.
from doc-linter-rules.
I can make the test pass for l10n pages but it would still be irrelevant.
So I think it would be more appropriate to not run the tests on locale pages rather than run it and see it displayed even as SUCCESS
it would still be irrelevant for the user.
It could also be interesting to make some of those tests l10n aware, but it would require a way to add the locales to the rules either with a mechanism such as Pontoon and webpack to pack the translation into the bundle or directly by adding them to the test with a PR.
from doc-linter-rules.
Sorry for the delay! My initial idea was to add the translations directly to the test. Later on we can think of a way to improve this by allowing the translations to be changed via Pontoon or something else.
Sebastian
from doc-linter-rules.
I would like to divide this issues into two separate actions to take:
- Run the tests only for relevant locales
- Make tests locale aware
For the first part, I'm thinking about adding a new type of Message IRRELEVANT
that would indicate that the test has not been run because it's irrelevant in the situation.
It would allow us to treat it easily on the WebExtensions and in any further project using the ruleset we provide.
from doc-linter-rules.
For the first part, I'm thinking about adding a new type of Message
IRRELEVANT
that would indicate that the test has not been run because it's irrelevant in the situation.
Not sure how that would work and whether that provides the best UX.
I think the best UX is to not execute and also not show those tests at all in that case.
Probably this could be done by introducing a whitelist or blacklist for locales, or both, i.e. for example a property locales
or excludeLocales
for including or excluding them.
The tests mentioned earlier are all restricted to en-US
, so those would be covered by a whitelist. Though there may also be cases, which apply to all languages except a specific (group of) language(s), for which we'd need a blacklist.
Sebastian
from doc-linter-rules.
What I had in mind was starting the test with a check for allowed locales for those tests.
if it doesn't match return an IRRELEVANT
message.
And on the webextension, to simply not display it, they would not be visible and not really run but it seems easier that to maintain one whitelist / blacklist per locale.
from doc-linter-rules.
Related Issues (15)
- Remove compat macros from whitelist HOT 1
- New rule: Test if large images are in the content HOT 1
- New rule: Test on-site links to sections to see if they exist HOT 3
- New rule: language style HOT 3
- New rule: prevent mixed content HOT 6
- Rule fix: Summary even marked as error when it's not at the top of the page
- New rule: Add test for <pre> with class 'eval'
- New rule: Check whether two spaces are used as indentation in code samples
- Add count link to avoid duplicates URL HOT 4
- Pre without class: child elements are matched
- Document properly and check with Travis the process to add a rule
- CODE_OF_CONDUCT.md file missing
- Add a README HOT 1
- Change "lib" directory name to "rules"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doc-linter-rules.