PhpDig.net

What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.




dcgettext

Name

dcgettext — Performs a message lookup using the specified domain and category.

Synopsis

string dcgettext(text_domain, message[, . . .]);
string text_domain: Domain from which to fetch the translation
string message: Message to translate
integer . . . (optional): Category to use (such as LC_MESSAGES, LC_ALL, etc.)

Returns

The translated message, if a translation can be found; otherwise, the original message

Description

dcgettext() allows the default domain and category to be overridden for a single message lookup. If a translation for the message can be found in the given domain and category, it will be returned. Otherwise, the message will be returned.

In this context, the term category refers to the category of locale in which the message should be looked up. Valid categories include LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, and LC_ALL. Categories must be specified using their numeric values (see the following table). PHP constants that represent these values are likely to be introduced after PHP 4.0.4.

Category Numeric Value
LC_CTYPE 0
LC_NUMERIC 1
LC_TIME 2
LC_COLLATE 3
LC_MONETARY 4
LC_MESSAGES 5
LC_ALL 6


Version

PHP Version: 3.0.7+, 4+

Example

Example 454. Basic usage of dcgettext()

// Assume that several text domains have been defined and that one has been bound

// Temporarily escape the default domain and category
print dcgettext ('alternate', 'At the tone, the time will be 12:00pm', 2);



PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.