';
+ // Limit to superadmin
+ if (! empty($conf->multicompany->enabled) && !$user->entity)
+ {
+ print '
';
+ print '';
+ print '
';
+ print '
';
+ }
+ else
+ {
+ print '
';
+ print '';
+ }
+ print '';
+ print "
\n";
+ print '
';
+
+ if ($sortfield == 'transkey' && strtolower($sortorder) == 'asc') ksort($recordtoshow);
+ if ($sortfield == 'transkey' && strtolower($sortorder) == 'desc') krsort($recordtoshow);
+ if ($sortfield == 'transvalue' && strtolower($sortorder) == 'asc') asort($recordtoshow);
+ if ($sortfield == 'transvalue' && strtolower($sortorder) == 'desc') arsort($recordtoshow);
+
+ // Show result
+ $i=0;
+ foreach($recordtoshow as $key => $val)
+ {
+ $i++;
+ if ($i <= $offset) continue;
+ if ($i > ($offset + $limit)) break;
+ print '
'.$langcode.'
'.$key.'
';
+ print dol_escape_htmltag($val);
+ print '
'."\n";
+ }
+
+ print '
';
+ print '';
+}
+
dol_fiche_end();
print "\n";
diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php
index af51b64fa8d..16a16719366 100644
--- a/htdocs/core/class/html.formadmin.class.php
+++ b/htdocs/core/class/html.formadmin.class.php
@@ -58,7 +58,7 @@ class FormAdmin
* @param int $showcode Add language code into label
* @return string Return HTML select string with list of languages
*/
- function select_language($selected='',$htmlname='lang_id',$showauto=0,$filter=null,$showempty='',$showwarning=0,$disabled=0,$morecss='',$showcode=0)
+ function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0)
{
global $langs;
diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php
index 9ca6196b018..6b596dc3aa5 100644
--- a/htdocs/core/class/translate.class.php
+++ b/htdocs/core/class/translate.class.php
@@ -155,14 +155,15 @@ class Translate
* @param integer $alt 0 (try xx_ZZ then 1), 1 (try xx_XX then 2), 2 (try en_US)
* @param int $stopafterdirection Stop when the DIRECTION tag is found (optimize speed)
* @param int $forcelangdir To force a different lang directory
+ * @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf.
* @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
*/
- function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='')
+ function load($domain,$alt=0,$stopafterdirection=0,$forcelangdir='',$loadfromfileonly=0)
{
global $conf,$db;
// Load $this->tab_translate[] from database
- if (count($this->tab_translate) == 0) $this->loadFromDatabase($db); // Nothing was loaded yet, so we load database.
+ if (empty($loadfromfileonly) && count($this->tab_translate) == 0) $this->loadFromDatabase($db); // Nothing was loaded yet, so we load database.
// Check parameters
if (empty($domain))
@@ -336,19 +337,20 @@ class Translate
// This part is deprecated and replaced with table llx_overwrite_trans
// Kept for backward compatibility.
- $overwritekey='MAIN_OVERWRITE_TRANS_'.$this->defaultlang;
- if (! empty($conf->global->$overwritekey)) // Overwrite translation with key1:newstring1,key2:newstring2
- {
- // Overwrite translation with param MAIN_OVERWRITE_TRANS_xx_XX
- $tmparray=explode(',', $conf->global->$overwritekey);
- foreach($tmparray as $tmp)
+ if (empty($loadfromfileonly))
+ {
+ $overwritekey='MAIN_OVERWRITE_TRANS_'.$this->defaultlang;
+ if (! empty($conf->global->$overwritekey)) // Overwrite translation with key1:newstring1,key2:newstring2
{
- $tmparray2=explode(':',$tmp);
- if (! empty($tmparray2[1])) $this->tab_translate[$tmparray2[0]]=$tmparray2[1];
+ // Overwrite translation with param MAIN_OVERWRITE_TRANS_xx_XX
+ $tmparray=explode(',', $conf->global->$overwritekey);
+ foreach($tmparray as $tmp)
+ {
+ $tmparray2=explode(':',$tmp);
+ if (! empty($tmparray2[1])) $this->tab_translate[$tmparray2[0]]=$tmparray2[1];
+ }
}
- }
-
-
+ }
// Check to be sure that SeparatorDecimal differs from SeparatorThousand
if (! empty($this->tab_translate["SeparatorDecimal"]) && ! empty($this->tab_translate["SeparatorThousand"])
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 5065abc69ed..4d6f05f4de8 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3041,7 +3041,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title_generic.png', $pictois
* @param string $sortorder Order to sort ('' by default)
* @param string $center Strin gin the middle ('' by default). We often find here string $massaction comming from $form->selectMassAction()
* @param int $num Number of records found by select with limit+1
- * @param int $totalnboflines Total number of records/lines for all pages (if known). Use a negative value to no show number.
+ * @param int $totalnboflines Total number of records/lines for all pages (if known). Use a negative value to not show number.
* @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @param string $morehtml More html to show
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index aebb4aaa81d..4549aa74181 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1041,8 +1041,11 @@ TranslationSetup=Setup of translation
TranslationKeySearch=Search a translation key or string
TranslationOverwriteKey=Overwrite a translation string
TranslationDesc=How to set displayed application language : * Systemwide: menu Home - Setup - Display * Per user: User display setup tab of user card (click on username at the top of the screen).
-TranslationOverwriteDesc=You can also override strings filling the following table. Choose your language from "%s" dropdown, insert the key string found in the lang file (langs/xx_XX/somefile.lang) into "%s" and your new translation into "%s".
+TranslationOverwriteDesc=You can also override strings filling the following table. Choose your language from "%s" dropdown, insert the translation key string into "%s" and your new translation into "%s"
+TranslationOverwriteDesc2=You can use the other tab to help you know translation key to use
TranslationString=Translation string
+CurrentTranslationString=Current translation string
+WarningAtLeastKeyOrTranslationRequired=A search criteria is required at least for key or translation string
NewTranslationStringToShow=New translation string to show
TotalNumberOfActivatedModules=Total number of activated feature modules: %s / %s
YouMustEnableOneModule=You must at least enable 1 module