locale.inc

Version 1.258 (checked in on 2010-07-30 at 02:47:27 by dries)

Administration functions for locale.module.

Constants

NameDescription
LOCALE_IMPORT_KEEPTranslation import mode keeping existing translations and only inserting new strings.
LOCALE_IMPORT_OVERWRITETranslation import mode overwriting all existing translations if new translated version available.
LOCALE_JS_STRINGRegular expression pattern used to localize JavaScript strings.
LOCALE_LANGUAGE_NEGOTIATION_URL_DOMAINURL language negotiation: use the domain as URL language indicator.
LOCALE_LANGUAGE_NEGOTIATION_URL_PREFIXURL language negotiation: use the path prefix as URL language indicator.

Functions

NameDescription
country_get_listGet list of all predefined and custom countries.
locale_add_languageAPI function to add a language.
locale_batch_by_componentPrepare a batch to run when installing modules or enabling themes.
locale_batch_by_languagePrepare a batch to import translations for all enabled modules in a given language.
locale_date_format_saveSave locale specific date formats to the database.
locale_get_localized_date_formatSelect locale date format details from database.
locale_language_from_browserIdentify language from the Accept-language HTTP header we got.
locale_language_from_interfaceIdentifies the language from the current interface language.
locale_language_from_sessionIdentify language from a request/session parameter.
locale_language_from_urlIdentify language via URL prefix or domain.
locale_language_from_userIdentify language from the user preferences.
locale_language_switcher_sessionReturn the session language switcher block.
locale_language_switcher_urlReturn the URL language switcher block. Translation links may be provided by other modules.
locale_language_url_rewrite_sessionRewrite URLs for the Session language provider.
locale_language_url_rewrite_urlRewrite URLs for the URL language provider.
locale_string_is_safeCheck that a string is safe to be added or imported as a translation.
_locale_batch_buildBuild a locale batch from an array of files.
_locale_batch_importPerform interface translation import as a batch step.
_locale_batch_language_finishedFinished callback of language addition locale import batch. Inform the user of translation files imported.
_locale_batch_system_finishedFinished callback of system page locale import batch. Inform the user of translation files imported.
_locale_export_get_stringsGenerates a structured array of all strings with translations in $language, if given. This array can be used to generate an export of the string in the database.
_locale_export_poWrite a generated PO or POT file to the output.
_locale_export_po_generateGenerates the PO(T) file contents for given strings.
_locale_export_remove_pluralRemoves plural index information from a string
_locale_export_stringPrint out a string on multiple lines
_locale_export_wrapCustom word wrapping for Portable Object (Template) files.
_locale_import_append_pluralModify a string to contain proper count indices
_locale_import_messageSets an error message occurred during locale file parsing.
_locale_import_one_stringImports a string into the database
_locale_import_one_string_dbImport one string into the database.
_locale_import_parse_arithmeticParses and sanitizes an arithmetic formula into a PHP expression
_locale_import_parse_headerParses a Gettext Portable Object file header
_locale_import_parse_plural_formsParses a Plural-Forms entry from a Gettext Portable Object file header
_locale_import_parse_quotedParses a string in quotes
_locale_import_poParses Gettext Portable Object file information and inserts into database
_locale_import_read_poParses Gettext Portable Object file into an array
_locale_import_shorten_commentsGenerate a short, one string version of the passed comment array
_locale_import_tokenize_formulaBackward compatible implementation of token_get_all() for formula parsing
_locale_invalidate_jsForce the JavaScript translation file(s) to be refreshed.
_locale_parse_js_fileParses a JavaScript file, extracts strings wrapped in Drupal.t() and Drupal.formatPlural() and inserts them into the database.
_locale_prepare_predefined_listPrepares the language code list for a select form item with only the unsupported ones
_locale_rebuild_js(Re-)Creates the JavaScript translation file for a language.
_locale_translate_language_listList languages in search result table
_locale_translate_seekPerform a string search and display results in a table
_locale_translate_seek_queryBuild array out of search criteria specified in request variables

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options