genstrings(1) BSD General Commands Manual genstrings(1)
NAME
genstrings -- generate string table from source code
SYNOPSIS
genstrings [-j] [-a] [-s ] [-skipTable ]
[-noPositionalParameters] [-u] [-q] [-o ] file
...
DESCRIPTION
The genstrings utility generates a .strings file(s) from the C, Objec-
tive-C, or Java (.c, .m, or .java) source code file(s) given as the argu-
ment(s). A .strings file is used for localizing an application for dif-
ferent languages, as described under "Internationalization" in the Cocoa
Developer Documentation.
* C and Objective-C:
Source lines containing text of the form NSLocalizedString("key", com-
ment) or CFCopyLocalizedString("key", comment) will generate an appropri-
ate string table entry on stdout. Normally, stdout should be directed to
a file named Localizable.strings, since this is where the NXLocalString
function looks by default for its string table.
Source lines containing NSLocalizedStringFromTable("key", Table, comment)
or CFCopyLocalizedStringFromTable("key", Table, comment) will generate an
appropriate string table entry in a file named Table.strings.
Source lines with NSLocalizedStringFromTableInBundle("key", Table, bun-
dle, comment) or CFCopyLocalizedStringFromTableInBundle("key", Table,
bundle, comment) will generate an appropriate string table entry in Ta-
ble.strings.
Source lines with NSLocalizedStringWithDefaultValue("key", Table, bundle,
"value", comment) or CFCopyLocalizedStringWithDefaultValue("key", Table,
bundle, "value", comment) will generate an appropriate string table entry
in Table.strings.
* Java:
The -j option sets the expected input language to Java. In this case the
above keywords are changed to Bundle.localizedString, Bundle.localized-
StringFromTable, Bundle.localizedStringFromTableInBundle, and Bun-
dle.localizedStringWithDefaultValue (instead of the Objective-C
defaults).
OPTIONS
-a Allows the output to be appended to the old output files. However, -a
causes the results to be appended to the end of the old file and not
merged.
-s routine
Substitutes routine for NSLocalizedString. For example, -s yLocal-
String will catch calls to MyLocalString and MyLocalStringFromTable.
-skipTable Table
Causes genstrings to skip over the file for Table. Note that any
entries in this table will not be generated.
-noPositionalParameters
turns off positional parameter support.
-u Allow unicode characters in the value of strings files. Any occur-
rence of \\Uxxxx (where xxxx are four hex digits) in the source code
will be written to the strings file with its Unicode value (in terms
of \\Uxxxx) for the key, but the actual Unicode value for its value.
For Example, CFCopyLocalizedString(CFSTR("AB\\U0043D"), "Comment")
will result in the key/value pair "AB\\U0043D" = "ABCD".
-q Turns off multiple key/value pairs warning
-o outputDir
Specifies what directory the tables should be created in.
Mac OS November 13, 2002 Mac OS
Darwin Mac OS X man pages main menu
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2010 MyWebUniversity.com ™
|