I appreciate your help but I still can't get this to work.
I'm generating additional error messages based on the contents of $tags->{msg} as follows -
#Include the current tags
my $tags = GT::Template->tags;
my $error_msg=$tags->{msg};
my $language_msg = ???????;
if ($error_msg =~ /\b$language_msg\b/) {
#do something
}
#repeat for each error message
What I want to do is check the value (contents) of $tags->{msg} to see if it contains any of the error messages in my language.txt but I don't know how to make the error messages available in my custom perl module and also how to refer to them. So what i need to know is -
1/ What code to add to make the language.txt tags available?
From previous replies it would apear to be -
#Setup the language for GT::SQL.
local $GT::SQL::ERRORS->{ILLEGALVAL} = $self->_language('ADD_ILLEGALVAL');
local $GT::SQL::ERRORS->{UNIQUE} = $self->_language('ADD_UNIQUE');
local $GT::SQL::ERRORS->{NOTNULL} = $self->_language('ADD_NOTNULL');
IS THIS CORRECT?
2/ How to call up or refer to the error messages in my example -
my $language_msg = ???????;
What should the ??????? be ?
Thank you.
Simon.
I'm generating additional error messages based on the contents of $tags->{msg} as follows -
#Include the current tags
my $tags = GT::Template->tags;
my $error_msg=$tags->{msg};
my $language_msg = ???????;
if ($error_msg =~ /\b$language_msg\b/) {
#do something
}
#repeat for each error message
What I want to do is check the value (contents) of $tags->{msg} to see if it contains any of the error messages in my language.txt but I don't know how to make the error messages available in my custom perl module and also how to refer to them. So what i need to know is -
1/ What code to add to make the language.txt tags available?
From previous replies it would apear to be -
#Setup the language for GT::SQL.
local $GT::SQL::ERRORS->{ILLEGALVAL} = $self->_language('ADD_ILLEGALVAL');
local $GT::SQL::ERRORS->{UNIQUE} = $self->_language('ADD_UNIQUE');
local $GT::SQL::ERRORS->{NOTNULL} = $self->_language('ADD_NOTNULL');
IS THIS CORRECT?
2/ How to call up or refer to the error messages in my example -
my $language_msg = ???????;
What should the ??????? be ?
Thank you.
Simon.