PHP 클래스 PKPLocale, pkp-lib

파일 보기 프로젝트 열기: pkp/pkp-lib 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$request

공개 메소드들

메소드 설명
_allLocalesCacheMiss ( $cache, $id ) Create a cache file with locale data.
_getAllLocalesCache ( ) : FileCache Get the cache object for the current list of all locales.
_getAllLocalesCacheContent ( ) : array Retrieves locale data from the locales cache.
get2LetterFrom3LetterIsoLanguage ( $iso3Letter ) : string Translate the ISO 3-letter language string (ISO639-2b) into a ISO compatible 2-letter string (ISO639-1).
get3LetterFrom2LetterIsoLanguage ( $iso2Letter ) : string Translate the ISO 2-letter language string (ISO639-1) into a ISO compatible 3-letter string (ISO639-2b).
get3LetterIsoFromLocale ( $locale ) : string Translate the PKP locale identifier into an ISO639-2b compatible 3-letter string.
getAllLocales ( ) : array Return a list of all available locales.
getFilenameComponentMap ( $locale ) : array Get an associative array of LOCALE_COMPOMENT_.
getIso1FromIso3 ( $iso3 ) : string Translate the ISO639-3 into ISO639-1.
getIso1FromLocale ( $locale ) : string Translate the PKP locale identifier into an ISO639-1 compatible 2-letter string.
getIso3FromIso1 ( $iso1 ) : string Translate the ISO 2-letter language string (ISO639-1) into ISO639-3.
getIso3FromLocale ( $locale ) : string Translate the PKP locale identifier into an ISO639-3 compatible 3-letter string.
getLocaleDirection ( $locale ) : string Get the reading direction for a particular locale.
getLocaleFiles ( $locale = null ) Get a list of locale files currently registered, either in all locales (in an array for each locale), or for a specific locale.
getLocaleFrom3LetterIso ( $iso3Letter ) : string Translate an ISO639-2b compatible 3-letter string into the PKP locale identifier.
getLocaleFromIso3 ( $iso3 ) : string Translate an ISO639-3 compatible 3-letter string into the PKP locale identifier.
getLocaleStyleSheet ( $locale ) : string Get the stylesheet filename for a particular locale.
getParameterNames ( $source ) : array Given a locale string, get the list of parameter references of the form {$myParameterName}.
getTimeZone ( ) : string Get the sites time zone.
initialize ( $request ) Initialize the locale system.
installLocale ( $locale ) Install support for a new locale.
isLocaleComplete ( $locale ) : boolean Determine whether or not a locale is marked incomplete.
isLocaleValid ( $locale ) : boolean Check if the supplied locale is currently installable.
loadLocaleList ( $filename ) : array Load a locale list from a file.
makeComponentMap ( $locale ) : array Build an associative array of LOCALE_COMPOMENT_.
registerLocaleFile ( $locale, $filename, $addToTop = false ) Register a locale file against the current list.
reloadLocale ( $locale ) Reload locale-specific data.
requireComponents ( ) Load a set of locale components. Parameters of mixed length may be supplied, each a LOCALE_COMPONENT_.
translate ( $key, $params = [], $locale = null ) : string Translate a string using the selected locale.
uninstallLocale ( $locale ) Uninstall support for an existing locale.

메소드 상세

_allLocalesCacheMiss() 정적인 공개 메소드

Create a cache file with locale data.
static public _allLocalesCacheMiss ( $cache, $id )
$cache CacheManager
$id the cache id (not used here, required by the cache manager)

_getAllLocalesCache() 정적인 공개 메소드

Get the cache object for the current list of all locales.
static public _getAllLocalesCache ( ) : FileCache
리턴 FileCache

_getAllLocalesCacheContent() 정적인 공개 메소드

Retrieves locale data from the locales cache.
static public _getAllLocalesCacheContent ( ) : array
리턴 array

get2LetterFrom3LetterIsoLanguage() 정적인 공개 메소드

Translate the ISO 3-letter language string (ISO639-2b) into a ISO compatible 2-letter string (ISO639-1).
static public get2LetterFrom3LetterIsoLanguage ( $iso3Letter ) : string
$iso3Letter string
리턴 string the translated string or null if we don't know about the given language.

get3LetterFrom2LetterIsoLanguage() 정적인 공개 메소드

Translate the ISO 2-letter language string (ISO639-1) into a ISO compatible 3-letter string (ISO639-2b).
static public get3LetterFrom2LetterIsoLanguage ( $iso2Letter ) : string
$iso2Letter string
리턴 string the translated string or null if we don't know about the given language.

get3LetterIsoFromLocale() 정적인 공개 메소드

Translate the PKP locale identifier into an ISO639-2b compatible 3-letter string.
static public get3LetterIsoFromLocale ( $locale ) : string
$locale string
리턴 string

getAllLocales() 정적인 공개 메소드

Return a list of all available locales.
static public getAllLocales ( ) : array
리턴 array

getFilenameComponentMap() 정적인 공개 메소드

.. => filename
static public getFilenameComponentMap ( $locale ) : array
$locale string
리턴 array

getIso1FromIso3() 정적인 공개 메소드

Translate the ISO639-3 into ISO639-1.
static public getIso1FromIso3 ( $iso3 ) : string
$iso3 string
리턴 string the translated string or null if we don't know about the given language.

getIso1FromLocale() 정적인 공개 메소드

Translate the PKP locale identifier into an ISO639-1 compatible 2-letter string.
static public getIso1FromLocale ( $locale ) : string
$locale string
리턴 string

getIso3FromIso1() 정적인 공개 메소드

Translate the ISO 2-letter language string (ISO639-1) into ISO639-3.
static public getIso3FromIso1 ( $iso1 ) : string
$iso1 string
리턴 string the translated string or null if we don't know about the given language.

getIso3FromLocale() 정적인 공개 메소드

Translate the PKP locale identifier into an ISO639-3 compatible 3-letter string.
static public getIso3FromLocale ( $locale ) : string
$locale string
리턴 string

getLocaleDirection() 정적인 공개 메소드

A locale can specify a reading direction with the direction attribute. If no direction is specified, defaults to ltr (left-to-right). The only other value that is expected is rtl. This value is used in HTML and CSS markup to present a right-to-left layout.
static public getLocaleDirection ( $locale ) : string
$locale string
리턴 string

getLocaleFiles() 정적인 공개 메소드

Get a list of locale files currently registered, either in all locales (in an array for each locale), or for a specific locale.
static public getLocaleFiles ( $locale = null )
$locale string Locale identifier (optional)

getLocaleFrom3LetterIso() 정적인 공개 메소드

This can be ambiguous if several locales are defined for the same language. In this case we'll use the primary locale to disambiguate. If that still doesn't determine a unique locale then we'll choose the first locale found.
static public getLocaleFrom3LetterIso ( $iso3Letter ) : string
리턴 string

getLocaleFromIso3() 정적인 공개 메소드

This can be ambiguous if several locales are defined for the same language. In this case we'll use the primary locale to disambiguate. If that still doesn't determine a unique locale then we'll choose the first locale found.
static public getLocaleFromIso3 ( $iso3 ) : string
$iso3 string
리턴 string

getLocaleStyleSheet() 정적인 공개 메소드

Get the stylesheet filename for a particular locale.
static public getLocaleStyleSheet ( $locale ) : string
$locale string
리턴 string or null if none configured.

getParameterNames() 정적인 공개 메소드

Given a locale string, get the list of parameter references of the form {$myParameterName}.
static public getParameterNames ( $source ) : array
$source string
리턴 array

getTimeZone() 정적인 공개 메소드

Get the sites time zone.
static public getTimeZone ( ) : string
리턴 string Time zone

initialize() 정적인 공개 메소드

Initialize the locale system.
static public initialize ( $request )
$request PKPRequest

installLocale() 정적인 공개 메소드

Install support for a new locale.
static public installLocale ( $locale )
$locale string

isLocaleComplete() 정적인 공개 메소드

Determine whether or not a locale is marked incomplete.
static public isLocaleComplete ( $locale ) : boolean
$locale xx_XX symbolic name of locale to check
리턴 boolean

isLocaleValid() 정적인 공개 메소드

Check if the supplied locale is currently installable.
static public isLocaleValid ( $locale ) : boolean
$locale string
리턴 boolean

loadLocaleList() 정적인 공개 메소드

Load a locale list from a file.
static public loadLocaleList ( $filename ) : array
$filename string
리턴 array

makeComponentMap() 정적인 공개 메소드

.. => filename (use getFilenameComponentMap instead)
static public makeComponentMap ( $locale ) : array
$locale string
리턴 array

registerLocaleFile() 정적인 공개 메소드

Register a locale file against the current list.
static public registerLocaleFile ( $locale, $filename, $addToTop = false )
$locale string Locale key
$filename string Filename to new locale XML file
$addToTop boolean Whether to add to the top of the list (true) or the bottom (false). Allows overriding.

reloadLocale() 정적인 공개 메소드

Reload locale-specific data.
static public reloadLocale ( $locale )
$locale string

requireComponents() 정적인 공개 메소드

.. constant. An optional final parameter may be supplied to specify the locale (e.g. 'en_US').
static public requireComponents ( )

translate() 정적인 공개 메소드

Substitution works by replacing tokens like "{$foo}" with the value of the parameter named "foo" (if supplied).
static public translate ( $key, $params = [], $locale = null ) : string
$key string
$params array named substitution parameters
$locale string the locale to use
리턴 string

uninstallLocale() 정적인 공개 메소드

Uninstall support for an existing locale.
static public uninstallLocale ( $locale )
$locale string

프로퍼티 상세

$request 정적으로 공개적으로 프로퍼티

static public $request