Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Delivery
Public
Open source
Symfony Bundles
sf3-translations
Commits
515da8cb
Commit
515da8cb
authored
8 years ago
by
Decima
Browse files
Options
Download
Email Patches
Plain Diff
fix type error
parent
dd809113
master
2.x
2.0
1.1.3
1.1.2
1.1.1
v1.0.9
v1.0.8
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Repository/ZoneRepository.php
+9
-2
Repository/ZoneRepository.php
TranslationService/Translation.php
+2
-2
TranslationService/Translation.php
with
11 additions
and
4 deletions
+11
-4
Repository/ZoneRepository.php
+
9
-
2
View file @
515da8cb
...
...
@@ -23,13 +23,20 @@ class ZoneRepository extends \Doctrine\ORM\EntityRepository {
return
$res
[
0
];
}
$exp
=
explode
(
"_"
,
$locale
);
}
}
private
function
searchLocale
(
$locale
)
{
return
$this
->
createQueryBuilder
(
"z"
)
->
where
(
"LOWER(z.locale) LIKE :locale"
)
->
setParameter
(
"locale"
,
strtolower
(
$locale
))
->
getQuery
()
->
getResult
();
return
$this
->
createQueryBuilder
(
"z"
)
->
where
(
"LOWER(z.locale) LIKE :locale"
)
->
setParameter
(
"locale"
,
strtolower
(
$locale
))
->
getQuery
()
->
useQueryCache
(
TRUE
)
->
useResultCache
(
TRUE
)
->
setResultCacheLifetime
(
100
)
->
getResult
();
}
}
This diff is collapsed.
Click to expand it.
TranslationService/Translation.php
+
2
-
2
View file @
515da8cb
...
...
@@ -53,8 +53,8 @@ class Translation {
if
(
$translated
=
$this
->
repository_translation
->
findOneBy
([
"translationKey"
=>
$key
,
"locale"
=>
$locale
,
"domain"
=>
$domain
]))
{
return
$translated
->
getTranslationValue
();
}
else
{
if
(
count
(
explode
(
"_"
,
$locale
))
>
1
)
{
$locale
=
$this
->
findLocale
(
implode
(
"_"
,
array_splice
(
explode
(
"_"
,
$locale
),
0
,
-
1
)));
if
(
count
(
explode
(
"_"
,
$locale
->
getLocale
()
))
>
1
)
{
$locale
=
$this
->
findLocale
(
implode
(
"_"
,
array_splice
(
explode
(
"_"
,
$locale
->
getLocale
()
),
0
,
-
1
)));
if
(
$locale
)
return
$this
->
findTranslation
(
$key
,
$locale
,
$domain
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help