Manual Pages for UNIX Darwin command on man genstrings
MyWebUniversity

Manual Pages for UNIX Darwin command on man genstrings

genstrings(1) BSD General Commands Manual genstrings(1)

NAME

ggeennssttrriinnggss - generate string table from source code

SYNOPSIS

ggeennssttrriinnggss [-jj] [-aa] [-ss ] [-sskkiippTTaabbllee

]

[-nnooPPoossiittiioonnaallPPaarraammeetteerrss] [-bbiiggEEnnddiiaann | -lliittttlleeEEnnddiiaann] [-uu]

[-mmaaccRRoommaann] [-qq] [-oo ] file

...

DESCRIPTION

The ggeennssttrriinnggss utility generates a ..ssttrriinnggss 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 to a file named Localizable.strings. 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 -jj 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). * Format Strings and Positional Parameters: Keys and values of string file entries can include formatting characters.

For value strings with multiple formatting arguments, positional parame-

ters are generated. These allow the order of arguments to be changed as

needed by each localization (e.g. "File %1$@ contains %2$d bytes." could

become "%2$d bytes are contained in file %1$@." in another localization).

* Encoding:

By default, genstrings will read UTF-8 encoded source files and source

files with no non-ASCII characters. Mac Roman encoded files that contain

non-ASCII characters will not be read successfully unless the -mmaaccRRoommaann

compatibility flag is used. Developers are strongly encouraged to move

to UTF-8 as the encoding for source files as the -mmaaccRRoommaann option may be

removed in future versions.

Embedded non-ASCII characters in UTF-8 files, as well as non-ASCII char-

acters specified by the escape sequences \uxxxx and \Uxxxxxxxx are read

automatically by genstrings. The -uu option and genstrings-specific

escape sequence are also supported.

Generated .strings files are UTF-16 encoded. Host endianness is used

unless the -bbiiggEEnnddiiaann or -lliittttlleeEEnnddiiaann option is specified. The endian

options do not affect .strings files being appended to with the -aa

option. The byte order of the existing file is maintained. OOPPTTIIOONNSS

-aa 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.

-ss routine

Substitutes routine for NSLocalizedString. For example, -ss MMyyLLooccaall-

SSttrriinngg will catch calls to MyLocalString and MyLocalStringFromTable.

-sskkiippTTaabbllee Table

Causes genstrings to skip over the file for Table. Note that any

entries in this table will not be generated.

-nnooPPoossiittiioonnaallPPaarraammeetteerrss

Turns off generation of positional parameters.

-uu 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".

Note that non-ASCII characters can now be handled automatically with-

out this option. See 'Encoding' section above for details.

-mmaaccRRoommaann

For compatibility, read source files using Mac Roman encoding. See 'Encoding' section above for details.

-qq Turns off multiple key/value pairs warning

-oo outputDir

Specifies what directory the tables should be created in. Mac OS X May 7, 2007 Mac OS X




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™