Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
221
Merge Requests
221
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
d479a963
Commit
d479a963
authored
Apr 03, 2014
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2212411
by LinL, znerol: Code style cleanup of language system.
parent
cd94c105
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
28 deletions
+35
-28
core/lib/Drupal/Core/Language/LanguageDefault.php
core/lib/Drupal/Core/Language/LanguageDefault.php
+9
-3
core/lib/Drupal/Core/Language/LanguageManager.php
core/lib/Drupal/Core/Language/LanguageManager.php
+9
-8
core/lib/Drupal/Core/Language/LanguageManagerInterface.php
core/lib/Drupal/Core/Language/LanguageManagerInterface.php
+17
-17
No files found.
core/lib/Drupal/Core/Language/LanguageDefault.php
View file @
d479a963
<?php
/**
* @file
* Contains \Drupal\Core\Language\LanguageDefault.
*/
namespace
Drupal\Core\Language
;
/**
...
...
@@ -24,10 +29,11 @@ class LanguageDefault {
/**
* Constructs the default language object.
*
* @param array $default_values
* @param array $values
* The properties used to construct the default language.
*/
public
function
__construct
(
array
$
default_
values
)
{
$this
->
set
(
new
Language
(
$
default_
values
));
public
function
__construct
(
array
$values
)
{
$this
->
set
(
new
Language
(
$values
));
}
/**
...
...
core/lib/Drupal/Core/Language/LanguageManager.php
View file @
d479a963
...
...
@@ -50,7 +50,7 @@ public function __construct(LanguageDefault $default_language) {
/**
* {@inheritdoc}
*/
function
setTranslation
(
TranslationInterface
$translation
)
{
public
function
setTranslation
(
TranslationInterface
$translation
)
{
$this
->
translation
=
$translation
;
}
...
...
@@ -150,7 +150,7 @@ public function getLanguage($langcode) {
/**
* {@inheritdoc}
*/
function
getLanguageName
(
$langcode
)
{
public
function
getLanguageName
(
$langcode
)
{
if
(
$langcode
==
Language
::
LANGCODE_NOT_SPECIFIED
)
{
return
$this
->
t
(
'None'
);
}
...
...
@@ -214,9 +214,10 @@ public function getLanguageSwitchLinks($type, $path) {
* Some common languages with their English and native names.
*
* Language codes are defined by the W3C language tags document for
* interoperability. Language codes typically have a language and optionally,
* a script or regional variant name. See
* http://www.w3.org/International/articles/language-tags/ for more information.
* interoperability. Language codes typically have a language and, optionally,
* a script or regional variant name. See:
* http://www.w3.org/International/articles/language-tags/ for more
* information.
*
* This list is based on languages available from localize.drupal.org. See
* http://localize.drupal.org/issues for information on how to add languages
...
...
@@ -332,9 +333,9 @@ public static function getStandardLanguageList() {
/**
* {@inheritdoc}
*
* This function is a noop since the configuration can
not be overridden by
* This function is a noop since the configuration cannot be overridden by
* language unless the Language module is enabled. That replaces the default
* language manger with a configurable language manager.
* language man
a
ger with a configurable language manager.
*
* @see \Drupal\language\ConfigurableLanguageManager::setConfigOverrideLanguage()
*/
...
...
core/lib/Drupal/Core/Language/LanguageManagerInterface.php
View file @
d479a963
...
...
@@ -17,10 +17,10 @@ interface LanguageManagerInterface {
/**
* Injects the string translation service.
*
* @param \
use
Drupal\Core\StringTranslation\TranslationInterface $translation
* @param \Drupal\Core\StringTranslation\TranslationInterface $translation
* The string translation service.
*/
function
setTranslation
(
TranslationInterface
$translation
);
public
function
setTranslation
(
TranslationInterface
$translation
);
/**
* Initializes each language type to a language object.
...
...
@@ -79,9 +79,9 @@ public function getDefaultLanguage();
/**
* Returns a list of languages set up on the site.
*
* @param
$flags
* (optional) Specifies the state of the languages that have to be
* returned.
It can be: Language::STATE_CONFIGURABLE,
* @param int
$flags
* (optional) Specifies the state of the languages that have to be returned.
*
It can be: Language::STATE_CONFIGURABLE,
* Language::STATE_LOCKED, Language::STATE_ALL.
*
* @return array
...
...
@@ -110,7 +110,7 @@ public function getLanguage($langcode);
* @return string
* The printed name of the language.
*/
function
getLanguageName
(
$langcode
);
public
function
getLanguageName
(
$langcode
);
/**
* Returns a list of the default locked languages.
...
...
@@ -158,15 +158,15 @@ public function getFallbackCandidates($langcode = NULL, array $context = array()
/**
* Returns the language switch links for the given language type.
*
* @param $type
* @param
string
$type
* The language type.
* @param $path
* @param
string
$path
* The internal path the switch links will be relative to.
*
* @return array
* A keyed array of links ready to be themed.
*/
function
getLanguageSwitchLinks
(
$type
,
$path
);
public
function
getLanguageSwitchLinks
(
$type
,
$path
);
/**
* Sets the configuration override language.
...
...
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