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

Creating a new localization rule set for vale #788

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
5 changes: 5 additions & 0 deletions .vale/fixtures/Localization/AdjectivesWithNouns/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `CommonlyMisusedWords` rule
Chandralekha-RedHat marked this conversation as resolved.
Show resolved Hide resolved
StylesPath = ../../../styles
MinAlertLevel = warning
[*.adoc]
Localization.TermsWarnings = YES
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
the following
the previous
14 changes: 14 additions & 0 deletions .vale/fixtures/Localization/AdjectivesWithNouns/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
the following steps
the following functions
the following procedure
the following chapter
the following table
the following image
the following section
the previous steps
the previous functions
the previous procedure
the previous chapter
the previous table
the previous image
the previous section
5 changes: 5 additions & 0 deletions .vale/fixtures/Localization/CommonlyMisusedWords/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `CommonlyMisusedWords` rule
StylesPath = ../../../styles
MinAlertLevel = warning
[*.adoc]
Localization.TermsWarnings = YES
10 changes: 10 additions & 0 deletions .vale/fixtures/Localization/CommonlyMisusedWords/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
The product allows you to
This product allows you to
The product allows
This product allows
The interface allows
The UI allows
The application allows
This feature allows you to


Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
might
enable
abbreviation
can
cannot
Red Hat allows you to
Red Hat allows

5 changes: 5 additions & 0 deletions .vale/fixtures/Localization/Modals/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `Modals` rule
StylesPath = ../../../styles
MinAlertLevel = warning
[*.adoc]
Localization.TermsWarnings = YES
8 changes: 8 additions & 0 deletions .vale/fixtures/Localization/Modals/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
should
could
would
will
supposed to
ought to be
may
shall
5 changes: 5 additions & 0 deletions .vale/fixtures/Localization/Modals/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
might
can
cannot
must

5 changes: 5 additions & 0 deletions .vale/fixtures/Localization/PhrasalVerbs/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `CommonlyMisusedWords` rule
Chandralekha-RedHat marked this conversation as resolved.
Show resolved Hide resolved
StylesPath = ../../../styles
MinAlertLevel = warning
[*.adoc]
Localization.TermsWarnings = YES
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Localization.TermsWarnings = YES
Localization.PhrasalVerbs = YES

17 changes: 17 additions & 0 deletions .vale/fixtures/Localization/PhrasalVerbs/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
carry out
allow for
carry on
count on
end up
get at
click on
call up
find out
print out
start up
switch on
tap on
fill in
fill out
picks up
gives up
8 changes: 8 additions & 0 deletions .vale/fixtures/Localization/PhrasalVerbs/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
do
allow
enable
continue
depend
result
imply
click
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `WordswithMultipleMeanings` rule
StylesPath = ../../../styles
MinAlertLevel = warning
[*.adoc]
Localization.TermsWarnings = YES
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Localization.TermsWarnings = YES
Localization.WordswithMultipleMeanings = YES

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
as
at once
once
while
since
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
after
reachlekha marked this conversation as resolved.
Show resolved Hide resolved
one time
because
during
at the same time
as soon as
as much as
as long as

9 changes: 9 additions & 0 deletions .vale/fixtures/RedHat/SelfReferentialText/testinvalid.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ This section describes something.
Follow the steps in this section to configure something.
This subsection describes something.
Follow the steps in this subsection to configure something.
The following module describes something.
The previous module describes something.
This is a module.
These are modules.
Those are modules.
Theirs module.
Hers module.
His module.

11 changes: 11 additions & 0 deletions .vale/styles/Localization/AdjectivesWithNouns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
extends: sequence
message: "Always use 'following' as an adjective before a noun for clarity and grammatical correctness. For example, use 'Complete the following steps' instead of 'Complete the following'."
Chandralekha-RedHat marked this conversation as resolved.
Show resolved Hide resolved
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/using/
level: warning
action:
name: edit
tokens:
- the following
- the previous

17 changes: 17 additions & 0 deletions .vale/styles/Localization/CommonlyMisusedWords.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
extends: substitution
ignorecase: true
level: warning
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/termswarnings/
message: 'Only use allow if you are talking about permission. For ability, use enable.'
Chandralekha-RedHat marked this conversation as resolved.
Show resolved Hide resolved
# source: https://github.com/redhat-documentation/vale-at-red-hat/issues/515
tokens:
- The product allows you to
- This product allows you to
- The product allows
- This product allows
- The interface allows
- The UI allows
- The application allows
- This feature allows you to

15 changes: 15 additions & 0 deletions .vale/styles/Localization/Modals.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
extends: existence
ignorecase: true
level: warning
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/termswarnings/
message: "Avoid using modals like 'should', 'may', or 'will' because they can introduce uncertainty."
# source: https://github.com/redhat-documentation/vale-at-red-hat/issues/515
tokens:
- should
- could
- would
- will
- supposed to be
- ought to be

25 changes: 25 additions & 0 deletions .vale/styles/Localization/PhrasalVerbs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment for this rule - as it is laid out below, there will be a huge amount of false positives for this rule. Need to reduce the false positives to make this useful.

extends: substitution
reachlekha marked this conversation as resolved.
Show resolved Hide resolved
ignorecase: true
level: warning
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/termswarnings/
message: "Avoid using phrasal verbs. Consider using '%s' rather than '%s'."
scope: sentence
action:
name: replace
swap:
# Start each error message with "Do not use ..."
# Error messages must be single quoted.
Comment on lines +11 to +12

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get this comment.

It seems related to the error message,not the swap section

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aireilly Could you please help clarify this rule?

carry out: do
allow for: allow|enable
carry on: continue
count on: depend
end up: result
get at: imply
click on: click
find out: find
print out: print
start up | switch on: start
tap on: tap
picks up: takes
fill in: complete
14 changes: 14 additions & 0 deletions .vale/styles/Localization/WordswithMultipleMeanings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
extends: existence
ignorecase: true
level: warning
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/termswarnings/
message: "Avoid words that have multiple meanings. For example, instead of words like "as" or "since" which have multiple meanings, use "because"."
# source: https://github.com/redhat-documentation/vale-at-red-hat/issues/515
tokens:
- as
- at once
- once
- while
- since

Loading