Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
eae50e0d
Commit
eae50e0d
authored
8 years ago
by
Jaime Pérez
Browse files
Options
Downloads
Patches
Plain Diff
Refactor translation methods for PHP's implementation of Gettext.
parent
b2820c7b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/SimpleSAML/Locale/Translate.php
+2
-2
2 additions, 2 deletions
lib/SimpleSAML/Locale/Translate.php
lib/SimpleSAML/XHTML/Template.php
+5
-2
5 additions, 2 deletions
lib/SimpleSAML/XHTML/Template.php
with
7 additions
and
4 deletions
lib/SimpleSAML/Locale/Translate.php
+
2
−
2
View file @
eae50e0d
...
@@ -469,7 +469,7 @@ class Translate
...
@@ -469,7 +469,7 @@ class Translate
}
}
public
static
function
translateSingular
(
$original
)
public
static
function
translateSingular
PHPGettext
(
$original
)
{
{
$text
=
\Gettext\BaseTranslator
::
$current
->
gettext
(
$original
);
$text
=
\Gettext\BaseTranslator
::
$current
->
gettext
(
$original
);
...
@@ -483,7 +483,7 @@ class Translate
...
@@ -483,7 +483,7 @@ class Translate
}
}
public
static
function
translatePlural
(
$original
,
$plural
,
$value
)
public
static
function
translatePlural
PHPGettext
(
$original
,
$plural
,
$value
)
{
{
$text
=
\Gettext\BaseTranslator
::
$current
->
ngettext
(
$original
,
$plural
,
$value
);
$text
=
\Gettext\BaseTranslator
::
$current
->
ngettext
(
$original
,
$plural
,
$value
);
...
...
This diff is collapsed.
Click to expand it.
lib/SimpleSAML/XHTML/Template.php
+
5
−
2
View file @
eae50e0d
...
@@ -174,8 +174,11 @@ class SimpleSAML_XHTML_Template
...
@@ -174,8 +174,11 @@ class SimpleSAML_XHTML_Template
// set up translation
// set up translation
if
(
$this
->
localization
->
i18nBackend
===
'gettext/gettext'
)
{
if
(
$this
->
localization
->
i18nBackend
===
'gettext/gettext'
)
{
$options
[
'translation_function'
]
=
array
(
'\SimpleSAML\Locale\Translate'
,
'translateSingular'
);
$options
[
'translation_function'
]
=
array
(
'\SimpleSAML\Locale\Translate'
,
'translateSingularPHPGettext'
);
$options
[
'translation_function_plural'
]
=
array
(
'\SimpleSAML\Locale\Translate'
,
'translatePlural'
);
$options
[
'translation_function_plural'
]
=
array
(
'\SimpleSAML\Locale\Translate'
,
'translatePluralPHPGettext'
);
}
// TODO: add a branch for the old SimpleSAMLphp backend
}
// TODO: add a branch for the old SimpleSAMLphp backend
$twig
=
new
Twig_Environment
(
$loader
,
$options
);
$twig
=
new
Twig_Environment
(
$loader
,
$options
);
...
...
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