|
The purpose of these tests is to verify that strings that should be processed
with gettext have been. Not every string needs to be processed in this way,
since some strings will not be sent to the user and other strings should not be translated.
What the Tests Do and Do Not Check
Quoted strings that do not have gettext on a line are flagged.
When checking for lines that should use gettext, lines that
have the word gettext are flagged too.
Certain lines of code--lines that, in most cases, should not
be translated--are skipped. Other lines that should not be
translated must be judged on a case-by-case basis. Filters or other
means can be used to omit these lines from results files. You
can analyze the results file and make decisions. In any
case, the scripts are customizable.
The scripts do not flag these strings with a potential error if gettext is not present:
-
NOGETTEXT or NOI18N - this means that the
line should not have gettext
-
Commented lines if comment all on same line or multiple lines
-
only formatting strings such as "%s%4d%lxn" or strings with non alphanumerics
or strings with just "n".
-
getopt statements
-
Simple file mode "r+" "rw"
-
#include
-
#pragma ident
-
a blank string like " "
-
"..", /"." ,"../" ,"./" that relate to directory paths
The items in this next list are usually not translated; a
filtering program run after the test script could rule
these out if desired.
-
names of devices like /dev/xxx
-
directory paths
-
filenames
-
exec and spawn arguments
-
certain strcmp, strcat arguments
-
certain sprintf arguments if building a string that will not be translated
-
environment variables
-
words in resource lists that will not be translated
-
library routines, system calls, UNIX, and shell commands
-
routines that pass strings that are not to be translated
-
any messages not sent to the user
-
strings that have just special characters such as : or - that will not be translated
-
many #defined strings
Samples and Scripts
NOTE: Please remember that these are sample scripts and
tools that
may need customization for the syntax, naming conventions, and
locations of the your product's message files.
Many of the scripts are working versions that change
dynamically to reflect changes in developing products; they may
contain comments and alternate lines.
-
This is the actual test (perl
script).
-
This is an example of a script that calls the test - modify this for your environment. Include all necessary source code
locations and file suffixes.
-
This is a sample of a results file after
having run the test on a group of files - note that each line indicates a potential error; as
stated above it may not be an actual error. Lines with
no errors noted means that no potential errors were
found in that file.
-
Here is a sample filter that can be used
to post process the results. Modify it for your environment to include strings that are not messaged with gettext that are
not meant to be.
|
|