-language-overview Language overview functionality


Functions

 locale_languages_overview_form ()
 locale_languages_overview_form_submit ($form, &$form_state)
 locale_languages_add_screen ()
 locale_languages_predefined_form ()
 locale_languages_custom_form ()
 locale_languages_edit_form (&$form_state, $langcode)
 _locale_languages_common_controls (&$form, $language=NULL)
 locale_languages_predefined_form_validate ($form, &$form_state)
 locale_languages_predefined_form_submit ($form, &$form_state)
 locale_languages_edit_form_validate ($form, &$form_state)
 locale_languages_edit_form_submit ($form, &$form_state)
 locale_languages_delete_form (&$form_state, $langcode)
 locale_languages_delete_form_submit ($form, &$form_state)
 locale_languages_configure_form ()
 locale_languages_configure_form_submit ($form, &$form_state)
 locale_translate_overview_screen ()
 locale_translate_seek_screen ()
 locale_translate_seek_form ()
 locale_translate_import_form ()
 locale_translate_import_form_submit ($form, &$form_state)
 locale_translate_export_screen ()
 locale_translate_export_po_form (&$form_state, $names)
 locale_translate_export_pot_form ()
 locale_translate_export_po_form_submit ($form, &$form_state)
 locale_translate_edit_form (&$form_state, $lid)
 locale_translate_edit_form_submit ($form, &$form_state)
 locale_translate_delete ($lid)
 locale_add_language ($langcode, $name=NULL, $native=NULL, $direction=LANGUAGE_LTR, $domain= '', $prefix= '', $enabled=TRUE, $default=FALSE)
 _locale_import_po ($file, $langcode, $mode, $group=NULL)
 _locale_import_read_po ($op, $file, $mode=NULL, $lang=NULL, $group= 'default')
 _locale_import_message ($message, $file, $lineno=NULL)
 _locale_import_one_string ($op, $value=NULL, $mode=NULL, $lang=NULL, $file=NULL, $group= 'default')
 _locale_import_one_string_db (&$report, $langcode, $source, $translation, $textgroup, $location, $mode, $plid=NULL, $plural=NULL)
 _locale_import_parse_header ($header)
 _locale_import_parse_plural_forms ($pluralforms, $filename)
 _locale_import_parse_arithmetic ($string)
 _locale_import_tokenize_formula ($formula)
 _locale_import_append_plural ($entry, $key)
 _locale_import_shorten_comments ($comment)
 _locale_import_parse_quoted ($string)
 _locale_export_get_strings ($language=NULL, $group= 'default')
 _locale_export_po_generate ($language=NULL, $strings=array(), $header=NULL)
 _locale_export_po ($language=NULL, $output=NULL)
 _locale_export_string ($str)
 _locale_export_wrap ($str, $len)
 _locale_export_remove_plural ($entry)
 _locale_translate_seek ()
 _locale_translate_seek_query ()
 _locale_invalidate_js ($langcode=NULL)
 _locale_rebuild_js ($langcode=NULL)
 _locale_translate_language_list ($translation, $limit_language)
 _locale_prepare_predefined_list ()
 _locale_get_predefined_list ()
 locale_batch_by_language ($langcode, $finished=NULL, $skip=array())
 locale_batch_by_component ($components, $finished= '_locale_batch_system_finished')
 _locale_batch_build ($files, $finished=NULL, $components=array())
 _locale_batch_import ($filepath, &$context)
 _locale_batch_system_finished ($success, $results)
 _locale_batch_language_finished ($success, $results)

Detailed Description

End of "locale-language-overview"

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"


Function Documentation

_locale_batch_build ( files,
finished = NULL,
components = array() 
)

Build a locale batch from an array of files.

Parameters:
$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.
Returns:
A batch structure

Definition at line 2508 of file locale.inc.

References get_t().

Referenced by locale_batch_by_component(), and locale_batch_by_language().

Here is the call graph for this function:

_locale_batch_import ( filepath,
&$  context 
)

Perform interface translation import as a batch step.

Parameters:
$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().

Here is the call graph for this function:

_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().

Here is the call graph for this function:

_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().

Here is the call graph for this function:

_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.

Parameters:
$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().

Here is the call graph for this function:

_locale_export_po ( language = NULL,
output = NULL 
)

Write a generated PO or POT file to the output.

Parameters:
$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().

Here is the call graph for this function:

_locale_export_po_generate ( language = NULL,
strings = array(),
header = NULL 
)

Generates the PO(T) file contents for given strings.

Parameters:
$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().

Here is the call graph for this function:

_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().

Here is the call graph for this function:

_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()

Parameters:
$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.

Parameters:
$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().

Here is the call graph for this function:

_locale_import_one_string ( op,
value = NULL,
mode = NULL,
lang = NULL,
file = NULL,
group = 'default' 
)

Imports a string into the database

Parameters:
$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().

Here is the call graph for this function:

_locale_import_one_string_db ( &$  report,
langcode,
source,
translation,
textgroup,
location,
mode,
plid = NULL,
plural = NULL 
)

Import one string into the database.

Parameters:
$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.
Returns:
The string ID of the existing string modified or the new string added.

Definition at line 1283 of file locale.inc.

References db_query(), and db_result().

Referenced by _locale_import_one_string().

Here is the call graph for this function:

_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.

Parameters:
$string A string containing the arithmetic formula
Returns:
The PHP version of the formula

Definition at line 1393 of file locale.inc.

References $op, and _locale_import_tokenize_formula().

Referenced by _locale_import_parse_plural_forms().

Here is the call graph for this function:

_locale_import_parse_header ( header  ) 

Parses a Gettext Portable Object file header

Parameters:
$header A string containing the complete header
Returns:
An associative array of key-value pairs

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

Parameters:
$pluralforms A string containing the Plural-Forms entry
$filename A string containing the filename
Returns:
An array containing the number of plurals and a formula in PHP for computing the plural form

Definition at line 1350 of file locale.inc.

References _locale_import_parse_arithmetic(), drupal_set_message(), and t().

Referenced by _locale_import_one_string().

Here is the call graph for this function:

_locale_import_parse_quoted ( string  ) 

Parses a string in quotes

Parameters:
$string A string specified with enclosing quotes
Returns:
The string parsed from inside the 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

Parameters:
$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().

Here is the call graph for this function:

_locale_import_read_po ( op,
file,
mode = NULL,
lang = NULL,
group = 'default' 
)

Parses Gettext Portable Object file into an array

Parameters:
$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().

Here is the call graph for this function:

_locale_import_shorten_comments ( comment  ) 

Generate a short, one string version of the passed comment array

Parameters:
$comment An array of strings containing a comment
Returns:
Short one string version of the 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

Parameters:
$string A string containing the arithmetic formula
Returns:
The PHP version of the 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.

Parameters:
$langcode The language code for which the file needs to be refreshed.
Returns:
New content of the 'javascript_parsed' variable.

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().

Here is the call graph for this function:

_locale_languages_common_controls ( &$  form,
language = NULL 
)

Common elements of the language addition and editing form.

Parameters:
$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().

Here is the call graph for this function:

_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().

Here is the call graph for this function:

_locale_rebuild_js ( langcode = NULL  ) 

(Re-)Creates the JavaScript translation file for a language.

Parameters:
$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().

Here is the call graph for this function:

_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().

Here is the call graph for this function:

_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().

Here is the call graph for this function:

_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.

Parameters:
$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().

Here is the call graph for this function:

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.

Parameters:
$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.

Here is the call graph for this function:

locale_batch_by_language ( langcode,
finished = NULL,
skip = array() 
)

Prepare a batch to import translations for all enabled modules in a given language.

Parameters:
$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.
Returns:
A batch structure or FALSE if no files found.

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

locale_languages_configure_form (  ) 

Setting for language negotiation options

Definition at line 447 of file locale.inc.

References t(), and variable_get().

Here is the call graph for this function:

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().

Here is the call graph for this function:

locale_languages_custom_form (  ) 

Custom language addition form.

Definition at line 176 of file locale.inc.

References _locale_languages_common_controls(), and t().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

locale_languages_edit_form ( &$  form_state,
langcode 
)

Editing screen for a particular language.

Parameters:
$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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

locale_languages_predefined_form (  ) 

Predefined language setup form.

Definition at line 156 of file locale.inc.

References _locale_prepare_predefined_list(), and t().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

locale_translate_export_po_form ( &$  form_state,
names 
)

Form to export PO files for the languages provided.

Parameters:
$names An associate array with localized language names

Definition at line 707 of file locale.inc.

References module_invoke_all(), and t().

Here is the call graph for this function:

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().

Here is the call graph for this function:

locale_translate_export_pot_form (  ) 

Translation template export form.

Definition at line 729 of file locale.inc.

References module_invoke_all(), and t().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

locale_translate_seek_screen (  ) 

String search screen.

Definition at line 531 of file locale.inc.

References $output, _locale_translate_seek(), and drupal_get_form().

Here is the call graph for this function:


Generated on Mon Jun 2 15:08:53 2008 for SimpleTest by  1.5.5