mirror of https://github.com/zlatinb/muwire
externalize comment length warning
parent
08f0f8400d
commit
3a1eafb203
|
@ -14,6 +14,8 @@ import com.muwire.core.Core
|
||||||
import com.muwire.core.files.UICommentEvent
|
import com.muwire.core.files.UICommentEvent
|
||||||
import com.muwire.core.util.DataUtil
|
import com.muwire.core.util.DataUtil
|
||||||
|
|
||||||
|
import static com.muwire.gui.Translator.trans
|
||||||
|
|
||||||
@ArtifactProviderFor(GriffonController)
|
@ArtifactProviderFor(GriffonController)
|
||||||
class AddCommentController {
|
class AddCommentController {
|
||||||
@MVCMember @Nonnull
|
@MVCMember @Nonnull
|
||||||
|
@ -27,8 +29,8 @@ class AddCommentController {
|
||||||
void save() {
|
void save() {
|
||||||
String comment = view.textarea.getText()
|
String comment = view.textarea.getText()
|
||||||
if (comment.length() > Constants.MAX_COMMENT_LENGTH ) {
|
if (comment.length() > Constants.MAX_COMMENT_LENGTH ) {
|
||||||
JOptionPane.showMessageDialog(null, "Your comment is too long - ${comment.length()} bytes. The maximum size is $Constants.MAX_COMMENT_LENGTH bytes",
|
JOptionPane.showMessageDialog(null, trans("ADD_COMMENT_TOO_LONG_BODY", comment.length(), Constants.MAX_COMMENT_LENGTH),
|
||||||
"Comment Too Long", JOptionPane.WARNING_MESSAGE)
|
trans("ADD_COMMENT_TOO_LONG"), JOptionPane.WARNING_MESSAGE)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (comment.trim().length() == 0)
|
if (comment.trim().length() == 0)
|
||||||
|
|
|
@ -422,6 +422,8 @@ CLEAR_HITS=Clear Hits
|
||||||
## Add comment frame
|
## Add comment frame
|
||||||
ADD_COMMENT_MULTIPLE=Add comment to multiple files
|
ADD_COMMENT_MULTIPLE=Add comment to multiple files
|
||||||
ADD_COMMENT_SINGLE=Add comment to {0}
|
ADD_COMMENT_SINGLE=Add comment to {0}
|
||||||
|
ADD_COMMENT_TOO_LONG=Comment too long
|
||||||
|
ADD_COMMENT_TOO_LONG_BODY=Your comment is too long - {0} characters. The maximum length is {1} characters.
|
||||||
|
|
||||||
## Browse dialog
|
## Browse dialog
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue