File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33var winston = require . main . require ( 'winston' ) ;
44var meta = require . main . require ( './src/meta' ) ;
55
6+ var translator = module . parent . require ( '../public/src/modules/translator' ) ;
7+
68var toRegExp = require ( './lib/toRegExp' ) ;
79var parseContent = require ( './lib/parseContent' ) ;
810
@@ -95,11 +97,15 @@ var Beep = {
9597
9698 var titleMatch = postTitle && postTitle . match ( Beep . illegal_words ) ;
9799 if ( titleMatch ) {
98- return callback ( new Error ( 'You may not use the word "' + titleMatch [ 0 ] + '" in your title.' ) ) ;
100+ return translator . translate ( '[[beep:titleMatch.error, ' + titleMatch [ 0 ] + ']]' , function ( translated ) {
101+ callback ( new Error ( translated ) ) ;
102+ } ) ;
99103 }
100104 var contentMatch = postContent && postContent . match ( Beep . illegal_words ) ;
101105 if ( contentMatch ) {
102- return callback ( new Error ( 'You may not use the word "' + contentMatch [ 0 ] + '" in your post.' ) ) ;
106+ return translator . translate ( '[[beep:contentMatch.error, ' + contentMatch [ 0 ] + ']]' , function ( translated ) {
107+ callback ( new Error ( translated ) ) ;
108+ } ) ;
103109 }
104110
105111 callback ( null , data ) ;
@@ -147,7 +153,9 @@ var Beep = {
147153 } ) ;
148154
149155 if ( match ) {
150- return callback ( new Error ( 'You may not use the word "' + match [ 0 ] + '" in your tags.' ) ) ;
156+ return translator . translate ( '[[beep:tagMatch.error, ' + match [ 0 ] + ']]' , function ( translated ) {
157+ callback ( new Error ( translated ) ) ;
158+ } ) ;
151159 }
152160
153161 data . tags = data . tags . map ( function ( tag ) {
Original file line number Diff line number Diff line change 1+ {
2+ "titleMatch.error" : " You may not use the word \" %1\" in your title." ,
3+ "contentMatch.error" : " You may not use the word \" %1\" in your post." ,
4+ "tagMatch.error" : " You may not use the word \" %1\" in your tags."
5+ }
Original file line number Diff line number Diff line change 1+ {
2+ "titleMatch.error" : " Non puoi usare la parola \" %1\" nel titolo." ,
3+ "contentMatch.error" : " Non puoi usare la parola \" %1\" ne post." ,
4+ "tagMatch.error" : " Non puoi usare la parola \" %1\" nei tags."
5+ }
Original file line number Diff line number Diff line change 2727 { "hook" : " filter:config.get" , "method" : " appendConfig" },
2828
2929 { "hook" : " filter:messaging.getTeaser" , "method" : " messaging.getTeaser" }
30- ]
30+ ],
31+ "languages" : " languages" ,
32+ "defaultLang" : " en_GB"
3133}
You can’t perform that action at this time.
0 commit comments