Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
4540360a
Commit
4540360a
authored
15 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
First change to add a function to convert number to text
parent
e28b304b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/translate.class.php
+32
-5
32 additions, 5 deletions
htdocs/translate.class.php
with
32 additions
and
5 deletions
htdocs/translate.class.php
+
32
−
5
View file @
4540360a
...
...
@@ -337,8 +337,8 @@ class Translate {
}
/**
* \brief Retourn
e la
list
e des domaines charg�es en
memo
ire
* \return
array Tableau des domaines charg�es
* \brief Retourn list
of files already loaded into
memo
ry
* \return
string List of files loaded into memory "main=1,errors=1,..."
*/
function
list_domainloaded
()
{
...
...
@@ -351,7 +351,12 @@ class Translate {
return
$ret
;
}
/**
* Enter description here...
*
* @param unknown_type $key
* @return unknown
*/
function
getTradFromKey
(
$key
)
{
global
$db
;
...
...
@@ -517,7 +522,7 @@ class Translate {
/**
* \brief Ret
o
urn
e la
list
e des langues disponibl
es
* \brief Return list
of all available languag
es
* \return array list of languages
*/
function
get_available_languages
(
$langdir
=
DOL_DOCUMENT_ROOT
)
...
...
@@ -562,6 +567,28 @@ class Translate {
}
/**
* \brief Return full text translated to languagea label for a key. Store key-label in a cache.
* \number number Number to encode in full text
* \param isamount 1=It's an amount, 0=it's just a number
* \return string Label translated in UTF8 (but without entities)
* 10 if setDefaultLang was en_US => ten
* 123 if setDefaultLang was fr_FR => cent vingt trois
*/
function
getLabelFromNumber
(
$number
,
$isamount
=
0
)
{
$outlang
=
$this
->
defaultlang
;
// Output language we want
$outlangarray
=
split
(
'_'
,
$outlang
,
2
);
// If lang is xx_XX, then we use xx
if
(
strtolower
(
$outlangarray
[
0
])
==
strtolower
(
$outlangarray
[
1
]))
$outlang
=
$outlangarray
[
0
];
// TODO
return
$number
;
}
/**
* \brief Return a label for a key. Store key-label in a cache.
* \param db Database handler
...
...
@@ -570,7 +597,7 @@ class Translate {
* \param fieldkey Field for key
* \param fieldlabel Field for label
* \param fieldval Value to find record
* \return string Label
* \return string Label
in UTF8 (but without entities)
* \remarks This function can be used to get label in database but more often to get code from key id.
*/
function
getLabelFromKey
(
$db
,
$key
,
$tablename
,
$fieldkey
,
$fieldlabel
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment