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
6da7410c
Commit
6da7410c
authored
8 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Show warning for overwritten translation
parent
d24045d8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/admin/translation.php
+20
-7
20 additions, 7 deletions
htdocs/admin/translation.php
htdocs/langs/en_US/admin.lang
+1
-0
1 addition, 0 deletions
htdocs/langs/en_US/admin.lang
with
21 additions
and
7 deletions
htdocs/admin/translation.php
+
20
−
7
View file @
6da7410c
...
...
@@ -279,6 +279,14 @@ if ($mode == 'overwrite')
if
(
$mode
==
'searchkey'
)
{
$langcode
=
GETPOST
(
'langcode'
)
?
GETPOST
(
'langcode'
)
:
$langs
->
defaultlang
;
$newlang
=
new
Translate
(
''
,
$conf
);
$newlang
->
setDefaultLang
(
$langcode
);
$newlangfileonly
=
new
Translate
(
''
,
$conf
);
$newlangfileonly
->
setDefaultLang
(
$langcode
);
$recordtoshow
=
array
();
$nbempty
=
0
;
...
...
@@ -294,9 +302,6 @@ if ($mode == 'searchkey')
}
else
{
$newlang
=
new
Translate
(
''
,
$conf
);
$newlang
->
setDefaultLang
(
$langcode
);
// Load all translations keys
foreach
(
$conf
->
file
->
dol_document_root
as
$keydir
=>
$searchdir
)
{
...
...
@@ -310,6 +315,7 @@ if ($mode == 'searchkey')
{
$tmpfile
=
preg_replace
(
'/.lang/i'
,
''
,
basename
(
$file
[
'name'
]));
$newlang
->
load
(
$tmpfile
,
0
,
0
,
''
,
0
);
$newlangfileonly
->
load
(
$tmpfile
,
0
,
0
,
''
,
1
);
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
}
}
...
...
@@ -352,7 +358,6 @@ if ($mode == 'searchkey')
print
"
\n
"
;
print
'<tr '
.
$bc
[
$var
]
.
'><td>'
;
$langcode
=
GETPOST
(
'langcode'
)
?
GETPOST
(
'langcode'
)
:
$langs
->
defaultlang
;
//print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1);
print
$formadmin
->
select_language
(
$langcode
,
'langcode'
,
0
,
null
,
0
,
0
,
0
,
'maxwidthonsmartphone'
,
1
);
print
'</td>'
.
"
\n
"
;
...
...
@@ -367,11 +372,11 @@ if ($mode == 'searchkey')
print
'<td>'
;
print
'<input type="text" class="flat" size="1" name="entitysearch" value="'
.
$conf
->
entity
.
'">'
;
print
'</td>'
;
print
'<td align="
center
">'
;
print
'<td align="
right
">'
;
}
else
{
print
'<td align="
center
">'
;
print
'<td align="
right
">'
;
print
'<input type="hidden" name="entitysearch" value="'
.
$conf
->
entity
.
'">'
;
}
print
'<input type="submit" class="button" value="'
.
$langs
->
trans
(
"Search"
)
.
'" name="search">'
;
...
...
@@ -385,13 +390,21 @@ if ($mode == 'searchkey')
// Show result
$i
=
0
;
$var
=
false
;
foreach
(
$recordtoshow
as
$key
=>
$val
)
{
$i
++
;
if
(
$i
<=
$offset
)
continue
;
if
(
$i
>
(
$offset
+
$limit
))
break
;
print
'<tr><td>'
.
$langcode
.
'</td><td>'
.
$key
.
'</td><td colspan="2">'
;
$var
=!
$var
;
print
'<tr '
.
$bc
[
$var
]
.
'><td>'
.
$langcode
.
'</td><td>'
.
$key
.
'</td><td>'
;
print
dol_escape_htmltag
(
$val
);
print
'</td><td align="right">'
;
if
(
$val
!=
$newlangfileonly
->
tab_translate
[
$key
])
{
$htmltext
=
$langs
->
trans
(
"OriginalValueWas"
,
$newlangfileonly
->
tab_translate
[
$key
]);
print
$form
->
textwithpicto
(
''
,
$htmltext
,
1
,
'warning'
);
}
print
'</td></tr>'
.
"
\n
"
;
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/langs/en_US/admin.lang
+
1
−
0
View file @
6da7410c
...
...
@@ -1047,6 +1047,7 @@ 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
OriginalValueWas=The original translation is overwritten. Original value was:<br><br>%s
TotalNumberOfActivatedModules=Total number of activated feature modules: <b>%s</b> / <b>%s</b>
YouMustEnableOneModule=You must at least enable 1 module
ClassNotFoundIntoPathWarning=Class %s not found into PHP path
...
...
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