5
5
from wtforms .validators import InputRequired
6
6
from app .categories .x_cat .forms import AreYouUnder18Form
7
7
from app .categories .constants import DISCRIMINATION
8
+ from flask_babel import lazy_gettext as _
8
9
9
10
10
11
class DiscriminationQuestionForm (QuestionForm ):
11
12
category = DISCRIMINATION
12
13
13
14
14
15
class DiscriminationWhereForm (DiscriminationQuestionForm ):
15
- title = "Where did the discrimination happen?"
16
+ title = _ ( "Where did the discrimination happen?" )
16
17
17
18
next_step_mapping = {
18
19
"*" : "categories.discrimination.why" ,
@@ -22,31 +23,37 @@ class DiscriminationWhereForm(DiscriminationQuestionForm):
22
23
question = SelectMultipleField (
23
24
title ,
24
25
widget = CategoryCheckboxInput (
25
- show_divider = True , hint_text = "You can select more than one."
26
+ show_divider = True , hint_text = _ ( "You can select more than one." )
26
27
),
27
- validators = [InputRequired (message = "Select where the discrimination happened" )],
28
+ validators = [
29
+ InputRequired (message = _ ("Select where the discrimination happened" ))
30
+ ],
28
31
choices = [
29
- ("work" , "Work - including colleagues, employer or employment agency" ),
30
- ("school" , "School, college, university or other education setting" ),
32
+ ("work" , _ ( "Work - including colleagues, employer or employment agency" ) ),
33
+ ("school" , _ ( "School, college, university or other education setting" ) ),
31
34
(
32
35
"business" ,
33
- "Businesses or services - such as a shop, restaurant, train, hotel, bank, law firm" ,
36
+ _ (
37
+ "Businesses or services - such as a shop, restaurant, train, hotel, bank, law firm"
38
+ ),
34
39
),
35
- ("healthcare" , "Health or care - such as a hospital or care home" ),
36
- ("housing" , "Housing - such as a landlord or estate agent" ),
40
+ ("healthcare" , _ ( "Health or care - such as a hospital or care home" ) ),
41
+ ("housing" , _ ( "Housing - such as a landlord or estate agent" ) ),
37
42
(
38
43
"public" ,
39
- "Public services and authorities - such as the police, social services, council or local authority, jobcentre, government" ,
44
+ _ (
45
+ "Public services and authorities - such as the police, social services, council or local authority, jobcentre, government"
46
+ ),
40
47
),
41
- ("club" , "Clubs and associations - such as a sports club" ),
48
+ ("club" , _ ( "Clubs and associations - such as a sports club" ) ),
42
49
("" , "" ),
43
- ("notsure" , "I’m not sure" ),
50
+ ("notsure" , _ ( "I’m not sure" ) ),
44
51
],
45
52
)
46
53
47
54
48
55
class DiscriminationWhyForm (DiscriminationQuestionForm ):
49
- title = "Why were you discriminated against?"
56
+ title = _ ( "Why were you discriminated against?" )
50
57
51
58
next_step_mapping = {
52
59
"*" : "categories.discrimination.age" ,
@@ -57,37 +64,39 @@ class DiscriminationWhyForm(DiscriminationQuestionForm):
57
64
title ,
58
65
widget = CategoryCheckboxInput (
59
66
show_divider = True ,
60
- hint_text = "You can select more than one." ,
67
+ hint_text = _ ( "You can select more than one." ) ,
61
68
behaviour = "exclusive" ,
62
69
),
63
70
validators = [
64
- InputRequired (message = "Select why you were discriminated against" ),
71
+ InputRequired (message = _ ( "Select why you were discriminated against" ) ),
65
72
ExclusiveValue (
66
73
exclusive_value = "none" ,
67
- message = "Select why you were discriminated against, or select ‘None of these’" ,
74
+ message = _ (
75
+ "Select why you were discriminated against, or select ‘None of these’"
76
+ ),
68
77
),
69
78
],
70
79
choices = [
71
- ("race" , "Race, colour, ethnicity, nationality" ),
72
- ("sex" , "Sex (male or female)" ),
73
- ("disability" , "Disability, health condition, mental health condition" ),
74
- ("religion" , "Religion, belief, lack of religion" ),
75
- ("age" , "Age" ),
76
- ("pregnancy" , "Pregnancy or being a mother" ),
80
+ ("race" , _ ( "Race, colour, ethnicity, nationality" ) ),
81
+ ("sex" , _ ( "Sex (male or female)" ) ),
82
+ ("disability" , _ ( "Disability, health condition, mental health condition" ) ),
83
+ ("religion" , _ ( "Religion, belief, lack of religion" ) ),
84
+ ("age" , _ ( "Age" ) ),
85
+ ("pregnancy" , _ ( "Pregnancy or being a mother" ) ),
77
86
(
78
87
"sexualorientation" ,
79
- "Sexual orientation - gay, bisexual, other sexuality" ,
88
+ _ ( "Sexual orientation - gay, bisexual, other sexuality" ) ,
80
89
),
81
90
(
82
91
"gender" ,
83
- "Gender reassignment, being transgender, non-binary or gender-fluid" ,
92
+ _ ( "Gender reassignment, being transgender, non-binary or gender-fluid" ) ,
84
93
),
85
94
(
86
95
"marriage" ,
87
- "Married status - being married, in a civil partnership" ,
96
+ _ ( "Married status - being married, in a civil partnership" ) ,
88
97
),
89
98
("" , "" ),
90
- ("none" , "None of these" ),
99
+ ("none" , _ ( "None of these" ) ),
91
100
],
92
101
)
93
102
0 commit comments