End of "locale-language-add-edit"
End of "locale-languages-negotiation"
End of "locale-translate-overview"
End of "locale-translate-seek"
End of "locale-translate-import"
End of "locale-translate-export"
End of "locale-translate-edit"
End of "locale-translate-delete"
End of "locale-api-add"
End of "locale-api-export"
End of "locale-api-seek"
End of "locale-api-languages-predefined"
_locale_batch_build | ( | $ | files, | |
$ | finished = NULL , |
|||
$ | components = array() | |||
) |
Build a locale batch from an array of files.
$files | Array of files to import | |
$finished | Optional finished callback for the batch. | |
$components | Optional list of component names the batch covers. Used in the installer. |
Definition at line 2508 of file locale.inc.
References get_t().
Referenced by locale_batch_by_component(), and locale_batch_by_language().
_locale_batch_import | ( | $ | filepath, | |
&$ | context | |||
) |
Perform interface translation import as a batch step.
$filepath | Path to a file to import. | |
$results | Contains a list of files imported. |
Definition at line 2541 of file locale.inc.
References _locale_import_read_po().
_locale_batch_language_finished | ( | $ | success, | |
$ | results | |||
) |
Finished callback of language addition locale import batch. Inform the user of translation files imported.
Definition at line 2565 of file locale.inc.
References $results, drupal_set_message(), and format_plural().
_locale_batch_system_finished | ( | $ | success, | |
$ | results | |||
) |
Finished callback of system page locale import batch. Inform the user of translation files imported.
Definition at line 2555 of file locale.inc.
References $results, drupal_set_message(), and format_plural().
_locale_export_get_strings | ( | $ | language = NULL , |
|
$ | group = 'default' | |||
) |
Generates 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.
$language | Language object to generate the output for, or NULL if generating translation template. | |
$group | Text group to export PO file from (eg. 'default' for interface translations) |
Definition at line 1686 of file locale.inc.
References $result, db_fetch_object(), db_query(), and language.
Referenced by locale_translate_export_po_form_submit().
_locale_export_po | ( | $ | language = NULL , |
|
$ | output = NULL | |||
) |
Write a generated PO or POT file to the output.
$language | Language object to generate the output for, or NULL if generating translation template. | |
$output | The PO(T) file to output as a string. See _locale_export_generate_po() on how it can be generated. |
Definition at line 1815 of file locale.inc.
References $output, name, print, and watchdog().
Referenced by locale_translate_export_po_form_submit().
_locale_export_po_generate | ( | $ | language = NULL , |
|
$ | strings = array() , |
|||
$ | header = NULL | |||
) |
Generates the PO(T) file contents for given strings.
$language | Language object to generate the output for, or NULL if generating translation template. | |
$strings | Array of strings to export. See _locale_export_get_strings() on how it should be formatted. | |
$header | The header portion to use for the output file. Defaults are provided for PO and POT files. |
Definition at line 1726 of file locale.inc.
References $header, $output, _locale_export_remove_plural(), _locale_export_string(), and variable_get().
Referenced by locale_translate_export_po_form_submit().
_locale_export_remove_plural | ( | $ | entry | ) |
Removes plural index information from a string
Definition at line 1899 of file locale.inc.
Referenced by _locale_export_po_generate().
_locale_export_string | ( | $ | str | ) |
Print out a string on multiple lines
Definition at line 1835 of file locale.inc.
References _locale_export_wrap().
Referenced by _locale_export_po_generate().
_locale_export_wrap | ( | $ | str, | |
$ | len | |||
) |
Custom word wrapping for Portable Object (Template) files.
Definition at line 1871 of file locale.inc.
Referenced by _locale_export_string().
_locale_get_predefined_list | ( | ) |
Some of the common languages with their English and native names
Based on ISO 639 and
Definition at line 2237 of file locale.inc.
Referenced by _locale_prepare_predefined_list(), install_select_locale_form(), locale_add_language(), locale_languages_predefined_form_submit(), locale_languages_predefined_form_validate(), and locale_translate_import_form_submit().
_locale_import_append_plural | ( | $ | entry, | |
$ | key | |||
) |
Modify a string to contain proper count indices
This is a callback function used via array_map()
$entry | An array element | |
$key | Index of the array element |
Definition at line 1556 of file locale.inc.
_locale_import_message | ( | $ | message, | |
$ | file, | |||
$ | lineno = NULL | |||
) |
Sets an error message occurred during locale file parsing.
$message | The message to be translated | |
$file | Drupal file object corresponding to the PO file to import | |
$lineno | An optional line number argument |
Definition at line 1166 of file locale.inc.
References drupal_set_message(), and get_t().
Referenced by _locale_import_read_po().
_locale_import_one_string | ( | $ | op, | |
$ | value = NULL , |
|||
$ | mode = NULL , |
|||
$ | lang = NULL , |
|||
$ | file = NULL , |
|||
$ | group = 'default' | |||
) |
Imports a string into the database
$op | Operation to perform: 'db-store', 'db-report', 'mem-store' or 'mem-report' | |
$value | Details of the string stored | |
$mode | Should existing translations be replaced LOCALE_IMPORT_KEEP or LOCALE_IMPORT_OVERWRITE | |
$lang | Language to store the string in | |
$file | Object representation of file being imported, only required when op is 'db-store' | |
$group | Text group to import PO file into (eg. 'default' for interface translations) |
Definition at line 1191 of file locale.inc.
References $header, $op, $value, _locale_import_one_string_db(), _locale_import_parse_header(), _locale_import_parse_plural_forms(), _locale_import_shorten_comments(), and db_query().
Referenced by _locale_import_po(), _locale_import_read_po(), and st().
_locale_import_one_string_db | ( | &$ | report, | |
$ | langcode, | |||
$ | source, | |||
$ | translation, | |||
$ | textgroup, | |||
$ | location, | |||
$ | mode, | |||
$ | plid = NULL , |
|||
$ | plural = NULL | |||
) |
Import one string into the database.
$report | Report array summarizing the number of changes done in the form: array(inserts, updates, deletes). | |
$langcode | Language code to import string into. | |
$source | Source string. | |
$translation | Translation to language specified in $langcode. | |
$textgroup | Name of textgroup to store translation in. | |
$location | Location value to save with source string. | |
$mode | Import mode to use, LOCALE_IMPORT_KEEP or LOCALE_IMPORT_OVERWRITE. | |
$plid | Optional plural ID to use. | |
$plural | Optional plural value to use. |
Definition at line 1283 of file locale.inc.
References db_query(), and db_result().
Referenced by _locale_import_one_string().
_locale_import_parse_arithmetic | ( | $ | string | ) |
Parses and sanitizes an arithmetic formula into a PHP expression
While parsing, we ensure, that the operators have the right precedence and associativity.
$string | A string containing the arithmetic formula |
Definition at line 1393 of file locale.inc.
References $op, and _locale_import_tokenize_formula().
Referenced by _locale_import_parse_plural_forms().
_locale_import_parse_header | ( | $ | header | ) |
Parses a Gettext Portable Object file header
$header | A string containing the complete header |
Definition at line 1327 of file locale.inc.
References $header.
Referenced by _locale_import_one_string().
_locale_import_parse_plural_forms | ( | $ | pluralforms, | |
$ | filename | |||
) |
Parses a Plural-Forms entry from a Gettext Portable Object file header
$pluralforms | A string containing the Plural-Forms entry | |
$filename | A string containing the filename |
Definition at line 1350 of file locale.inc.
References _locale_import_parse_arithmetic(), drupal_set_message(), and t().
Referenced by _locale_import_one_string().
_locale_import_parse_quoted | ( | $ | string | ) |
Parses a string in quotes
$string | A string specified with enclosing quotes |
Definition at line 1597 of file locale.inc.
Referenced by _locale_import_read_po().
_locale_import_po | ( | $ | file, | |
$ | langcode, | |||
$ | mode, | |||
$ | group = NULL | |||
) |
Parses Gettext Portable Object file information and inserts into database
$file | Drupal file object corresponding to the PO file to import | |
$langcode | Language code | |
$mode | Should existing translations be replaced LOCALE_IMPORT_KEEP or LOCALE_IMPORT_OVERWRITE | |
$group | Text group to import PO file into (eg. 'default' for interface translations) |
Definition at line 968 of file locale.inc.
References $status, _locale_import_one_string(), _locale_import_read_po(), _locale_invalidate_js(), cache_clear_all(), db_fetch_object(), db_query(), drupal_set_message(), menu_rebuild(), t(), and watchdog().
Referenced by locale_translate_import_form_submit().
_locale_import_read_po | ( | $ | op, | |
$ | file, | |||
$ | mode = NULL , |
|||
$ | lang = NULL , |
|||
$ | group = 'default' | |||
) |
Parses Gettext Portable Object file into an array
$op | Storage operation type: db-store or mem-store | |
$file | Drupal file object corresponding to the PO file to import | |
$mode | Should existing translations be replaced LOCALE_IMPORT_KEEP or LOCALE_IMPORT_OVERWRITE | |
$lang | Language code | |
$group | Text group to import PO file into (eg. 'default' for interface translations) |
Definition at line 1020 of file locale.inc.
References $op, _locale_import_message(), _locale_import_one_string(), and _locale_import_parse_quoted().
Referenced by _locale_batch_import(), _locale_import_po(), and st().
_locale_import_shorten_comments | ( | $ | comment | ) |
Generate a short, one string version of the passed comment array
$comment | An array of strings containing a comment |
Definition at line 1575 of file locale.inc.
Referenced by _locale_import_one_string().
_locale_import_tokenize_formula | ( | $ | formula | ) |
Backward compatible implementation of token_get_all() for formula parsing
$string | A string containing the arithmetic formula |
Definition at line 1490 of file locale.inc.
Referenced by _locale_import_parse_arithmetic().
_locale_invalidate_js | ( | $ | langcode = NULL |
) |
Force the JavaScript translation file(s) to be refreshed.
This function sets a refresh flag for a specified language, or all languages except English, if none specified. JavaScript translation files are rebuilt (with locale_update_js_files()) the next time a request is served in that language.
$langcode | The language code for which the file needs to be refreshed. |
Definition at line 2036 of file locale.inc.
References language_list(), variable_get(), and variable_set().
Referenced by _locale_import_po(), locale_add_language(), locale_translate_delete(), and locale_translate_edit_form_submit().
_locale_languages_common_controls | ( | &$ | form, | |
$ | language = NULL | |||
) |
Common elements of the language addition and editing form.
$form | A parent form item (or empty array) to add items below. | |
$language | Language object to edit. |
Definition at line 225 of file locale.inc.
References language, name, and t().
Referenced by locale_languages_custom_form(), and locale_languages_edit_form().
_locale_prepare_predefined_list | ( | ) |
Prepares the language code list for a select form item with only the unsupported ones
Definition at line 2211 of file locale.inc.
References $value, _locale_get_predefined_list(), language_list(), and t().
Referenced by locale_languages_predefined_form(), and locale_translate_import_form().
_locale_rebuild_js | ( | $ | langcode = NULL |
) |
(Re-)Creates the JavaScript translation file for a language.
$language | The language, the translation file should be (re)created for. |
Definition at line 2062 of file locale.inc.
References $result, $status, db_fetch_object(), db_query(), drupal_to_js(), file_check_directory(), file_create_path(), file_delete(), file_save_data(), language, language_default(), language_list(), name, t(), variable_get(), variable_set(), and watchdog().
Referenced by locale_languages_delete_form_submit().
_locale_translate_language_list | ( | $ | translation, | |
$ | limit_language | |||
) |
List languages in search result table
Definition at line 2184 of file locale.inc.
References $output, drupal_add_css(), drupal_get_path(), and language_list().
Referenced by _locale_translate_seek().
_locale_translate_seek | ( | ) |
Perform a string search and display results in a table
Definition at line 1914 of file locale.inc.
References $header, $output, $pager, $result, $value, _locale_translate_language_list(), _locale_translate_seek_query(), check_plain(), db_fetch_object(), l(), module_invoke_all(), pager_query(), t(), theme(), and truncate_utf8().
Referenced by locale_translate_seek_screen().
_locale_translate_seek_query | ( | ) |
Build array out of search criteria specified in request variables
Definition at line 2009 of file locale.inc.
Referenced by _locale_translate_seek(), and locale_translate_seek_form().
locale_add_language | ( | $ | langcode, | |
$ | name = NULL , |
|||
$ | native = NULL , |
|||
$ | direction = LANGUAGE_LTR , |
|||
$ | domain = '' , |
|||
$ | prefix = '' , |
|||
$ | enabled = TRUE , |
|||
$ | default = FALSE | |||
) |
API function to add a language.
$langcode | Language code. | |
$name | English name of the language | |
$native | Native name of the language | |
$direction | LANGUAGE_LTR or LANGUAGE_RTL | |
$domain | Optional custom domain name with protocol, without trailing slash (eg. ). | |
$prefix | Optional path prefix for the language. Defaults to the language code if omitted. | |
$enabled | Optionally TRUE to enable the language when created or FALSE to disable. | |
$default | Optionally set this language to be the default. |
Definition at line 916 of file locale.inc.
References $name, _locale_get_predefined_list(), _locale_invalidate_js(), db_query(), variable_get(), variable_set(), and watchdog().
Referenced by install_tasks(), locale_languages_predefined_form_submit(), and locale_translate_import_form_submit().
locale_batch_by_component | ( | $ | components, | |
$ | finished = '_locale_batch_system_finished' | |||
) |
Prepare a batch to run when installing modules or enabling themes. This batch will import translations for the newly added components in all the languages already set up on the site.
$components | An array of component (theme and/or module) names to import translations for. | |
$finished | Optional finished callback for the batch. |
Definition at line 2474 of file locale.inc.
References $result, _locale_batch_build(), db_fetch_object(), db_query(), file_scan_directory(), language_list(), and name.
locale_batch_by_language | ( | $ | langcode, | |
$ | finished = NULL , |
|||
$ | skip = array() | |||
) |
Prepare a batch to import translations for all enabled modules in a given language.
$langcode | Language code to import translations for. | |
$finished | Optional finished callback for the batch. | |
$skip | Array of component names to skip. Used in the installer for the second pass import, when most components are already imported. |
Definition at line 2442 of file locale.inc.
References $result, _locale_batch_build(), db_fetch_object(), db_placeholders(), db_query(), and file_scan_directory().
Referenced by install_tasks(), and locale_languages_predefined_form_submit().
locale_languages_add_screen | ( | ) |
User interface for the language addition screen.
Definition at line 147 of file locale.inc.
References $output, and drupal_get_form().
locale_languages_configure_form | ( | ) |
Setting for language negotiation options
Definition at line 447 of file locale.inc.
References t(), and variable_get().
locale_languages_configure_form_submit | ( | $ | form, | |
&$ | form_state | |||
) |
Submit function for language negotiation settings.
Definition at line 469 of file locale.inc.
References drupal_set_message(), t(), and variable_set().
locale_languages_custom_form | ( | ) |
Custom language addition form.
Definition at line 176 of file locale.inc.
References _locale_languages_common_controls(), and t().
locale_languages_delete_form | ( | &$ | form_state, | |
$ | langcode | |||
) |
User interface for the language deletion confirmation screen.
Definition at line 385 of file locale.inc.
References drupal_goto(), drupal_not_found(), drupal_set_message(), language_default(), language_list(), name, and t().
locale_languages_delete_form_submit | ( | $ | form, | |
&$ | form_state | |||
) |
Process language deletion submissions.
Definition at line 413 of file locale.inc.
References _locale_rebuild_js(), cache_clear_all(), db_query(), drupal_set_message(), language_list(), name, t(), and watchdog().
locale_languages_edit_form | ( | &$ | form_state, | |
$ | langcode | |||
) |
Editing screen for a particular language.
$langcode | Language code of the language to edit. |
Definition at line 200 of file locale.inc.
References _locale_languages_common_controls(), db_fetch_object(), db_query(), drupal_not_found(), and t().
locale_languages_edit_form_submit | ( | $ | form, | |
&$ | form_state | |||
) |
Process the language editing form submission.
Definition at line 358 of file locale.inc.
References db_query(), language, language_default(), and variable_set().
locale_languages_edit_form_validate | ( | $ | form, | |
&$ | form_state | |||
) |
Validate the language editing form. Reused for custom language addition too.
Definition at line 340 of file locale.inc.
References db_fetch_object(), db_query(), form_set_error(), language, language_default(), and t().
Referenced by locale_languages_predefined_form_validate().
locale_languages_overview_form | ( | ) |
User interface for the language overview screen.
Definition at line 34 of file locale.inc.
References check_plain(), language_default(), language_list(), name, and t().
locale_languages_overview_form_submit | ( | $ | form, | |
&$ | form_state | |||
) |
Process language overview form submissions, updating existing languages.
Definition at line 103 of file locale.inc.
References cache_clear_all(), db_query(), drupal_set_message(), language, language_default(), language_list(), t(), and variable_set().
locale_languages_predefined_form | ( | ) |
Predefined language setup form.
Definition at line 156 of file locale.inc.
References _locale_prepare_predefined_list(), and t().
locale_languages_predefined_form_submit | ( | $ | form, | |
&$ | form_state | |||
) |
Process the language addition form submission.
Definition at line 313 of file locale.inc.
References _locale_get_predefined_list(), batch_set(), drupal_set_message(), locale_add_language(), locale_batch_by_language(), t(), and url().
locale_languages_predefined_form_validate | ( | $ | form, | |
&$ | form_state | |||
) |
Validate the language addition form.
Definition at line 290 of file locale.inc.
References _locale_get_predefined_list(), db_query(), db_result(), form_set_error(), locale_languages_edit_form_validate(), and t().
locale_translate_delete | ( | $ | lid | ) |
Delete a language string.
Definition at line 876 of file locale.inc.
References _locale_invalidate_js(), cache_clear_all(), db_query(), drupal_goto(), drupal_set_message(), and t().
locale_translate_edit_form | ( | &$ | form_state, | |
$ | lid | |||
) |
User interface for string editing.
Definition at line 772 of file locale.inc.
References $result, check_plain(), db_fetch_object(), db_query(), drupal_goto(), drupal_set_message(), language_default(), language_list(), name, and t().
locale_translate_edit_form_submit | ( | $ | form, | |
&$ | form_state | |||
) |
Process string editing form submissions. Saves all translations of one string submitted from a form.
Definition at line 834 of file locale.inc.
References $value, _locale_invalidate_js(), cache_clear_all(), db_query(), db_result(), drupal_set_message(), and t().
locale_translate_export_po_form | ( | &$ | form_state, | |
$ | names | |||
) |
Form to export PO files for the languages provided.
$names | An associate array with localized language names |
Definition at line 707 of file locale.inc.
References module_invoke_all(), and t().
locale_translate_export_po_form_submit | ( | $ | form, | |
&$ | form_state | |||
) |
Process a translation (or template) export form submission.
Definition at line 751 of file locale.inc.
References _locale_export_get_strings(), _locale_export_po(), _locale_export_po_generate(), and language_list().
locale_translate_export_pot_form | ( | ) |
Translation template export form.
Definition at line 729 of file locale.inc.
References module_invoke_all(), and t().
locale_translate_export_screen | ( | ) |
User interface for the translation export screen.
Definition at line 688 of file locale.inc.
References $output, and drupal_get_form().
locale_translate_import_form | ( | ) |
User interface for the translation import screen.
Definition at line 593 of file locale.inc.
References _locale_prepare_predefined_list(), module_invoke_all(), and t().
locale_translate_import_form_submit | ( | $ | form, | |
&$ | form_state | |||
) |
Process the locale import form submission.
Definition at line 648 of file locale.inc.
References _locale_get_predefined_list(), _locale_import_po(), drupal_set_message(), file_save_upload(), language_list(), locale_add_language(), t(), and watchdog().
locale_translate_overview_screen | ( | ) |
Overview screen for translations.
Definition at line 487 of file locale.inc.
References $name, db_fetch_object(), db_query(), language_list(), module_invoke_all(), name, t(), and theme().
locale_translate_seek_form | ( | ) |
User interface for the string search screen.
Definition at line 540 of file locale.inc.
References _locale_translate_seek_query(), module_invoke_all(), and t().
locale_translate_seek_screen | ( | ) |
String search screen.
Definition at line 531 of file locale.inc.
References $output, _locale_translate_seek(), and drupal_get_form().