mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
Add ___() function to allow declaration of messages that will be translated at display time
This commit is contained in:
parent
07cdad29a4
commit
4097eaed38
2 changed files with 22 additions and 0 deletions
|
@ -494,6 +494,13 @@ function LSdebugDefined() {
|
|||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate message by using LSlang or Gettext methods
|
||||
*
|
||||
* @param[in] @msg string The message
|
||||
*
|
||||
* @retval string The translated message if translation available, the original message otherwise
|
||||
**/
|
||||
function __($msg) {
|
||||
if (empty($msg)) return $msg;
|
||||
if (isset($GLOBALS['LSlang'][$msg])) {
|
||||
|
@ -502,6 +509,20 @@ function LSdebugDefined() {
|
|||
return _($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Non-translate message
|
||||
*
|
||||
* Just-return the input message. This function permit the detection of message
|
||||
* that will be translated only at display time and not at declare time.
|
||||
*
|
||||
* @param[in] @msg string The message
|
||||
*
|
||||
* @retval string The message (unchanged)
|
||||
**/
|
||||
function ___($msg) {
|
||||
return $msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* Supprime les accents d'une chaine
|
||||
*
|
||||
|
|
|
@ -12,6 +12,7 @@ xgettext --from-code utf-8 \
|
|||
--omit-header \
|
||||
--copyright-holder="Easter-eggs" \
|
||||
--keyword="__" \
|
||||
--keyword="___" \
|
||||
$( find "$PUBLIC_HTML" -name "*.php" )
|
||||
|
||||
# Extract other messages from LdapSaisie templates files
|
||||
|
|
Loading…
Reference in a new issue