@@ -34,6 +34,9 @@ public function rules()
3434 'type ' => array (
3535 "required " ,
3636 Rule::in (['title ' , 'year ' ]),
37+ ),
38+ 'language ' => array (
39+ Rule::in (['en ' , 'fr ' , 'es ' , 'de ' , 'it ' , 'da ' , 'nl ' , 'ja ' , 'ru ' , 'pl ' , 'vi ' , 'sv ' , 'no ' , 'fi ' , 'tr ' , 'pt ' , 'nl ' , 'el ' , 'ko ' , 'hu ' ])
3740 )
3841 ];
3942
@@ -64,7 +67,8 @@ public function messages()
6467 "aka_year.required " => "The alternative year is required with type 'year'. " ,
6568 "aka_year.regex " => "The alternative year has to be a valid movie year. " ,
6669 "aka_title.required " => "The alternative title is required with type 'title' " ,
67- "aka_title.regex " => "The alternative title must be at least 3 letters long "
70+ "aka_title.regex " => "The alternative title must be at least 3 letters long " ,
71+ "language.in " => "The language must be a valid ISO639-1 code. "
6872 ];
6973 }
7074
@@ -98,6 +102,9 @@ public function rules()
98102 "sometimes " ,
99103 "required " ,
100104 Rule::in (['title ' , 'year ' , 'all ' ]),
105+ ),
106+ 'language ' => array (
107+ Rule::in (['en ' , 'fr ' , 'es ' , 'de ' , 'it ' , 'da ' , 'nl ' , 'ja ' , 'ru ' , 'pl ' , 'vi ' , 'sv ' , 'no ' , 'fi ' , 'tr ' , 'pt ' , 'nl ' , 'el ' , 'ko ' , 'hu ' ])
101108 )
102109 ];
103110
@@ -116,6 +123,7 @@ public function messages()
116123 'tmdbid.regex ' => 'The format of the tmdbid given is invalid! ' ,
117124 "type.required " => "The type of mappings to return is required. " ,
118125 "type.in " => "The type of mapping has to be on of 'title', 'year' or 'all'. " ,
126+ "language.in " => "The language must be a valid ISO639-1 code. "
119127 ];
120128 }
121129
0 commit comments