The Gettext functions are based on work by the GNU Translation Project. They aim to make it easier to write programs that send messages to users in their preferred language.
The Gettext functions rely on translation tables. These are usually given either .po or .mo extensions and are collected into directories. There is a global area for these files, but you can override that directory using bindtextdomain. The Gettext functions were added to PHP by Alex Plotnick.
string bindtextdomain(string domain, string directory)
The bintextdomain function sets the path for a domain.
string dcgettext(string domain, string message, int category)
The dcgettext function allows you to override the current domain for a single message lookup, and it also allows you to specify a category. The gettext manual questions the usefulness of this function.
string dgettext(string domain, string message)
The dgettext function allows you to override the current domain for a single message lookup.
string gettext(string message) string _(string message)
The Gettext function attempts to return a translated string. The message argument is used as both the key to the translation table and the default text if a translation is not found. The underscore character is an alias for the gettext function to help reduce cluttering your code.
string textdomain(string domain)
The textdomain function sets the domain to search within when calls are made to gettext. Thedomain is usually the name of your application. The previous domain is returned. If you just ant to get the current setting, pass an empty string. The default domain is called messages.
PHP Related Interview Questions
|PHP Interview Questions||MySQL Interview Questions|
|PHP+MySQL Interview Questions||Drupal Interview Questions|
|MYSQL DBA Interview Questions||PHP5 Interview Questions|
|WordPress Interview Questions||Joomla Interview Questions|
|CakePHP Interview Questions||CodeIgniter Interview Questions|
|PHP7 Interview Questions|
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.