Skip to content

Commit

Permalink
Merge pull request #551 from devezas/master
Browse files Browse the repository at this point in the history
Localization strings for form and messagebox
  • Loading branch information
ianharrigan authored Dec 24, 2023
2 parents 13061c2 + e55f6e2 commit 1afb2a5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions haxe/ui/_module/locale/en/form-strings.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
form.field.required=Field is required
4 changes: 4 additions & 0 deletions haxe/ui/_module/locale/en/messagebox-strings.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
messagebox.title.info=Info
messagebox.title.question=Question
messagebox.title.warning=Warning
messagebox.title.error=Error
1 change: 1 addition & 0 deletions haxe/ui/_module/locale/pt/form-strings.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
form.field.required=Campo obrigatório
4 changes: 4 additions & 0 deletions haxe/ui/_module/locale/pt/messagebox-strings.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
messagebox.title.info=Informação
messagebox.title.question=Pergunta
messagebox.title.warning=Aviso
messagebox.title.error=Erro
10 changes: 5 additions & 5 deletions haxe/ui/containers/dialogs/MessageBox.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ class MessageBox extends MessageBoxBase {
if (title == "Message") {
switch (type) {
case MessageBoxType.TYPE_INFO:
title = "Info";
title = "{{messagebox.title.info}}";
case MessageBoxType.TYPE_QUESTION:
title = "Question";
title = "{{messagebox.title.question}}";
case MessageBoxType.TYPE_WARNING:
title = "Warning";
title = "{{messagebox.title.warning}}";
case MessageBoxType.TYPE_ERROR:
title = "Error";
title = "{{messagebox.title.error}}";
case MessageBoxType.TYPE_YESNO:
title = "Question";
title = "{{messagebox.title.question}}";
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion haxe/ui/validators/RequiredValidator.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import haxe.ui.core.Component;
class RequiredValidator extends Validator {
public function new() {
super();
invalidMessage = "Field is required";
invalidMessage = "{{form.field.required}}";
invalidStyleName = "required-value";
}

Expand Down

0 comments on commit 1afb2a5

Please sign in to comment.