Feature #306 - Moving the function api_get_language_isocode() in the internationalization library.

skala
Ivan Tcholakov 16 years ago
parent 7373315387
commit 9b58c8aada
  1. 16
      main/inc/lib/internationalization.lib.php
  2. 18
      main/inc/lib/main_api.lib.php

@ -212,6 +212,22 @@ function get_lang($variable, $notrans = 'DLTT', $language = null) {
$variable."&amp;language=".$language."\" target=\"_blank\" style=\"color:#FF0000\"><strong>#</strong></a>");
}
// TODO: Database::get_language_isocode() to be deprecated.
/**
* Gets language isocode column from the language table, taking the current language as a query parameter.
* @param string $language This is the name of the folder containing translations for the corresponding language (e.g arabic, english).
* If $language is omitted, interface language is assumed then.
* @return string The found isocode or null on error.
* Returned codes are according to the following standards (in order of preference):
* - ISO 639-1 : Alpha-2 code (two-letters code - en, fr, es, ...)
* - RFC 4646 : five-letter code based on the ISO 639 two-letter language codes
* and the ISO 3166 two-letter territory codes (pt-BR, ...)
* - ISO 639-2 : Alpha-3 code (three-letters code - ast, fur, ...)
*/
function api_get_language_isocode($language = null) {
return Database::get_language_isocode($language);
}
/**
* Gets the current interface language.
* @param bool $purified (optional) When it is true, a purified (refined) language value will be returned, for example 'french' instead of 'french_unicode'.

@ -2057,7 +2057,7 @@ function api_item_property_update($_course, $tool, $item_id, $lastedit_type, $us
==============================================================================
*/
// TODO: To be moved to Display calss.
// TODO: To be moved to Display class.
/**
* Displays a combobox so the user can select his/her preferred language.
* @param string The desired name= value for the select
@ -2185,22 +2185,6 @@ function api_get_language_id($language) {
return $row['id'];
}
// TODO: Tobe moved in the Internationalization library. Database::get_language_isocode() to be deprecated.
/**
* Gets language isocode column from the language table, taking the current language as a query parameter.
* @param string $language This is the name of the folder containing translations for the corresponding language (e.g arabic, english).
* If $language is omitted, interface language is assumed then.
* @return string The found isocode or null on error.
* Returned codes are according to the following standards (in order of preference):
* - ISO 639-1 : Alpha-2 code (two-letters code - en, fr, es, ...)
* - RFC 4646 : five-letter code based on the ISO 639 two-letter language codes
* and the ISO 3166 two-letter territory codes (pt-BR, ...)
* - ISO 639-2 : Alpha-3 code (three-letters code - ast, fur, ...)
*/
function api_get_language_isocode($language = null) {
return Database::get_language_isocode($language);
}
/**
* Returns a list of CSS themes currently available in the CSS folder
* @return array List of themes directories from the css folder

Loading…
Cancel
Save