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. |
| _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. |
| _locale_batch_language_finished | ( | $ | success, | |
| $ | results | |||
| ) |
Finished callback of language addition locale import batch. Inform the user of translation files imported.
| _locale_batch_system_finished | ( | $ | success, | |
| $ | results | |||
| ) |
Finished callback of system page locale import batch. Inform the user of translation files imported.
| _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) |
| _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. |
| _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. |
| _locale_export_remove_plural | ( | $ | entry | ) |
Removes plural index information from a string
| _locale_export_string | ( | $ | str | ) |
Print out a string on multiple lines
| _locale_export_wrap | ( | $ | str, | |
| $ | len | |||
| ) |
Custom word wrapping for Portable Object (Template) files.
| _locale_get_predefined_list | ( | ) |
Some of the common languages with their English and native names
Based on ISO 639 and http://people.w3.org/rishida/names/languages.html
| _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 |
| _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 |
| _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) |
| _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. |
| _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 |
| _locale_import_parse_header | ( | $ | header | ) |
Parses a Gettext Portable Object file header
| $header | A string containing the complete header |
| _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 |
| _locale_import_parse_quoted | ( | $ | string | ) |
Parses a string in quotes
| $string | A string specified with enclosing quotes |
| _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) |
| _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) |
| _locale_import_shorten_comments | ( | $ | comment | ) |
Generate a short, one string version of the passed comment array
| $comment | An array of strings containing a comment |
| _locale_import_tokenize_formula | ( | $ | formula | ) |
Backward compatible implementation of token_get_all() for formula parsing
| $string | A string containing the arithmetic formula |
| _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. |
| _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. |
| _locale_prepare_predefined_list | ( | ) |
Prepares the language code list for a select form item with only the unsupported ones
| _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. |
| _locale_translate_language_list | ( | $ | translation, | |
| $ | limit_language | |||
| ) |
List languages in search result table
| _locale_translate_seek | ( | ) |
Perform a string search and display results in a table
| _locale_translate_seek_query | ( | ) |
Build array out of search criteria specified in request variables
| 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. http://de.example.com). | |
| $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. |
| 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. |
| 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. |
| locale_languages_add_screen | ( | ) |
User interface for the language addition screen.
| locale_languages_configure_form | ( | ) |
Setting for language negotiation options
| locale_languages_configure_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Submit function for language negotiation settings.
| locale_languages_custom_form | ( | ) |
Custom language addition form.
| locale_languages_delete_form | ( | &$ | form_state, | |
| $ | langcode | |||
| ) |
User interface for the language deletion confirmation screen.
| locale_languages_delete_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Process language deletion submissions.
| locale_languages_edit_form | ( | &$ | form_state, | |
| $ | langcode | |||
| ) |
Editing screen for a particular language.
| $langcode | Language code of the language to edit. |
| locale_languages_edit_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Process the language editing form submission.
| locale_languages_edit_form_validate | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Validate the language editing form. Reused for custom language addition too.
| locale_languages_overview_form | ( | ) |
User interface for the language overview screen.
| locale_languages_overview_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Process language overview form submissions, updating existing languages.
| locale_languages_predefined_form | ( | ) |
Predefined language setup form.
| locale_languages_predefined_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Process the language addition form submission.
| locale_languages_predefined_form_validate | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Validate the language addition form.
| locale_string_is_safe | ( | $ | string | ) |
Check that a string is safe to be added or imported as a translation.
This test can be used to detect possibly bad translation strings. It should not have any false positives. But it is only a test, not a transformation, as it destroys valid HTML. We cannot reliably filter translation strings on inport becuase some strings are irreversibly corrupted. For example, a & in the translation would get encoded to & by filter_xss() before being put in the database, and thus would be displayed incorrectly.
The allowed tag list is like filter_xss_admin(), but omitting div and img as not needed for translation and likely to cause layout issues (div) or a possible attack vector (img).
| locale_translate_delete_form | ( | &$ | form_state, | |
| $ | source | |||
| ) |
User interface for the string deletion confirmation screen.
| locale_translate_delete_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Process string deletion submissions.
| locale_translate_delete_page | ( | $ | lid | ) |
String deletion confirmation page.
| locale_translate_edit_form | ( | &$ | form_state, | |
| $ | lid | |||
| ) |
User interface for string editing.
| locale_translate_edit_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Process string editing form submissions.
Saves all translations of one string submitted from a form.
| locale_translate_edit_form_validate | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Validate string editing form submissions.
| 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 |
| locale_translate_export_po_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Process a translation (or template) export form submission.
| locale_translate_export_pot_form | ( | ) |
Translation template export form.
| locale_translate_export_screen | ( | ) |
User interface for the translation export screen.
| locale_translate_import_form | ( | ) |
User interface for the translation import screen.
| locale_translate_import_form_submit | ( | $ | form, | |
| &$ | form_state | |||
| ) |
Process the locale import form submission.
| locale_translate_overview_screen | ( | ) |
Overview screen for translations.
| locale_translate_seek_form | ( | ) |
User interface for the string search screen.
| locale_translate_seek_screen | ( | ) |
String search screen.