Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Oliver Eglseder
lfeditor
Commits
5ec4dcfa
Commit
5ec4dcfa
authored
Feb 18, 2015
by
Damjan
Browse files
[BUGFIX] Using XML as override files.
Typo3 can read XML override non-default translations.
parent
0bb683fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
Classes/Service/FileOverrideService.php
Classes/Service/FileOverrideService.php
+6
-8
No files found.
Classes/Service/FileOverrideService.php
View file @
5ec4dcfa
...
...
@@ -30,7 +30,7 @@ use SGalinski\Lfeditor\Exceptions\LFException;
use
SGalinski\Lfeditor\Utility\SgLib
;
use
SGalinski\Lfeditor\Utility\Typo3Lib
;
class
FileOverrideService
extends
FileBaseXL
F
Service
{
class
FileOverrideService
extends
FileBaseX
M
LService
{
/**
* Object which represents original (overridden) language file.
*
...
...
@@ -57,7 +57,7 @@ class FileOverrideService extends FileBaseXLFService {
if
(
!
is_file
(
$overrideFileAbsolutePath
))
{
$extRelativeFilePath
=
SgLib
::
trimPath
(
'EXT:'
,
$typo3ExtRelativeFilePath
);
$extRelativeFilePath
=
substr
(
$extRelativeFilePath
,
0
,
strrpos
(
$extRelativeFilePath
,
'.'
))
.
'.xl
f
'
;
$extRelativeFilePath
=
substr
(
$extRelativeFilePath
,
0
,
strrpos
(
$extRelativeFilePath
,
'.'
))
.
'.x
m
l'
;
/** @var ConfigurationService $configurationService */
$configurationService
=
$this
->
objectManager
->
get
(
'SGalinski\Lfeditor\Service\ConfigurationService'
);
...
...
@@ -77,7 +77,7 @@ class FileOverrideService extends FileBaseXLFService {
*/
public
function
readFile
()
{
if
(
is_file
(
$this
->
absFile
))
{
$this
->
read
Xlf
File
();
parent
::
readFile
();
if
(
!
Typo3Lib
::
isTypo3BackendInUtf8Mode
())
{
$this
->
localLang
=
Typo3Lib
::
utf8
(
$this
->
localLang
,
FALSE
,
[
'default'
]);
}
...
...
@@ -143,14 +143,12 @@ class FileOverrideService extends FileBaseXLFService {
}
parent
::
writeFile
();
// TODO: Delete override file and additional configuration line if there is no content in file?
// Set only new values in GlobalConfiguration if something changed
$typo3ExtRelativeFilePath
=
Typo3Lib
::
transTypo3File
(
$this
->
originalFileObject
->
getAbsFile
(),
FALSE
);
$relativeOverrideFilePath
=
SgLib
::
trimPath
(
PATH_site
,
$this
->
absFile
);
//TODO: this can support more than 1 override files?
if
(
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'locallangXMLOverride'
][
$typo3ExtRelativeFilePath
][
0
]
===
$relativeOverrideFilePath
)
{
$locallangXMLOverride
=
&
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'locallangXMLOverride'
];
if
(
$locallangXMLOverride
[
$typo3ExtRelativeFilePath
][
0
]
===
$relativeOverrideFilePath
)
{
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment