Open Journal Systems
3.3.0
|
Static Public Member Functions | |
static | _allLocalesCacheMiss ($cache, $id) |
static & | _getAllLocalesCache () |
static & | _getAllLocalesCacheContent () |
static | addOctothorpes ($key) |
static | get2LetterFrom3LetterIsoLanguage ($iso3Letter) |
static | get3LetterFrom2LetterIsoLanguage ($iso2Letter) |
static | get3LetterIsoFromLocale ($locale) |
static & | getAllLocales () |
static | getFilenameComponentMap ($locale) |
static | getIso1FromIso3 ($iso3) |
static | getIso1FromLocale ($locale) |
static | getIso3FromIso1 ($iso1) |
static | getIso3FromLocale ($locale) |
static | getLocale () |
static | getLocaleDirection ($locale) |
static & | getLocaleFiles ($locale=null) |
static | getLocaleFrom3LetterIso ($iso3Letter) |
static | getLocaleFromIso3 ($iso3) |
static | getLocalePrecedence () |
static | getLocaleStyleSheet ($locale) |
static | getParameterNames ($source) |
static | getPrimaryLocale () |
static | getSupportedFormLocales () |
static | getSupportedLocales () |
static | getTimeZone () |
static | initialize ($request) |
static | installLocale ($locale) |
static | isLocaleComplete ($locale) |
static | isLocaleValid ($locale) |
static | isLocaleWithFamilyFirst ($locale) |
static & | loadLocaleList ($filename) |
static | makeComponentMap ($locale) |
static | registerLocaleFile ($locale, $filename, $addToTop=false) |
static | reloadLocale ($locale) |
static | requireComponents () |
static | translate ($key, $params=array(), $locale=null, $missingKeyHandler=array(__CLASS__, 'addOctothorpes')) |
static | uninstallLocale ($locale) |
Static Public Attributes | |
static | $request |
Provides methods for loading locale data and translating strings identified by unique keys.
Definition at line 73 of file PKPLocale.inc.php.
|
static |
Create a cache file with locale data.
$cache | CacheManager |
$id | the cache id (not used here, required by the cache manager) |
Definition at line 861 of file PKPLocale.inc.php.
References Registry\get(), and loadLocaleList().
|
static |
Get the cache object for the current list of all locales.
Definition at line 838 of file PKPLocale.inc.php.
References Registry\get(), and CacheManager\getManager().
Referenced by _getAllLocalesCacheContent().
|
static |
Retrieves locale data from the locales cache.
Definition at line 825 of file PKPLocale.inc.php.
References _getAllLocalesCache().
Referenced by get2LetterFrom3LetterIsoLanguage(), get3LetterFrom2LetterIsoLanguage(), getAllLocales(), getIso1FromIso3(), getIso3FromIso1(), getLocaleDirection(), getLocaleFrom3LetterIso(), getLocaleFromIso3(), getLocaleStyleSheet(), isLocaleComplete(), and isLocaleWithFamilyFirst().
|
static |
Add octothorpes to a key name for presentation of the key as missing.
Definition at line 243 of file PKPLocale.inc.php.
|
static |
Translate the ISO 3-letter language string (ISO639-2b) into a ISO compatible 2-letter string (ISO639-1).
$iso3Letter | string |
Definition at line 633 of file PKPLocale.inc.php.
References _getAllLocalesCacheContent().
Referenced by PKPLocaleTest\testGet2LetterFrom3LetterIsoLanguage().
|
static |
Translate the ISO 2-letter language string (ISO639-1) into a ISO compatible 3-letter string (ISO639-2b).
$iso2Letter | string |
Definition at line 614 of file PKPLocale.inc.php.
References _getAllLocalesCacheContent().
Referenced by get3LetterIsoFromLocale(), ArticlePubMedXmlFilter\process(), PKPLocaleTest\testGet3LetterFrom2LetterIsoLanguage(), O4DOIXmlFilter\translateLanguageToLocale(), and DataciteXmlFilter\translateLanguageToLocale().
|
static |
Translate the PKP locale identifier into an ISO639-2b compatible 3-letter string.
$locale | string |
Definition at line 651 of file PKPLocale.inc.php.
References get3LetterFrom2LetterIsoLanguage().
Referenced by ArticleMedraXmlFilter\createContentItemNode(), O4DOIXmlFilter\createOtherTextNode(), O4DOIXmlFilter\createTitleNode(), DOAJXmlFilter\process(), PKPLocaleTest\testGet3LetterIsoFromLocale(), OAIMetadataFormat_MARC21\toXml(), and OAIMetadataFormat_MARC\toXml().
|
static |
Return a list of all available locales.
Definition at line 537 of file PKPLocale.inc.php.
References _getAllLocalesCacheContent().
Referenced by InstallForm\__construct(), ManagementHandler\announcements(), GatewayHandler\clockss(), ManagementHandler\context(), SettingsHandler\distribution(), ManagementHandler\distribution(), ContextGridHandler\editContext(), InstallLanguageForm\fetch(), LanguageToggleBlockPlugin\getContents(), IssueGalley\getGalleyLabel(), ArticleGalley\getGalleyLabel(), FormValidatorLocale\getMessage(), Context\getSupportedFormLocaleNames(), getSupportedFormLocales(), Site\getSupportedLocaleNames(), Context\getSupportedLocaleNames(), getSupportedLocales(), Context\getSupportedSubmissionLocaleNames(), IssueGalleyGridCellProvider\getTemplateVarsFromRowColumn(), NativeXmlPKPAuthorFilter\handleElement(), PKPWorkflowHandler\index(), ManageLanguageGridHandler\loadData(), AdminLanguageGridHandler\loadData(), GatewayHandler\lockss(), Installer\preInstall(), ValidatorFactory\required(), LanguageGridHandler\saveLanguageSetting(), AdminHandler\settings(), WorkflowHandler\setupIndex(), PKPAuthorDashboardHandler\setupTemplate(), PKPLocaleTest\testGetAllLocales(), ManagementHandler\website(), AdminHandler\wizard(), and ManagementHandler\workflow().
|
static |
Get an associative array of LOCALE_COMPOMENT_... => filename
$locale | string |
Definition at line 361 of file PKPLocale.inc.php.
|
static |
Translate the ISO639-3 into ISO639-1.
$iso3 | string |
Definition at line 732 of file PKPLocale.inc.php.
References _getAllLocalesCacheContent().
|
static |
Translate the PKP locale identifier into an ISO639-1 compatible 2-letter string.
$locale | string |
Definition at line 762 of file PKPLocale.inc.php.
Referenced by ArticleCrossrefXmlFilter\createJournalArticleNode(), HelpHandler\index(), and DataciteXmlFilter\process().
|
static |
Translate the ISO 2-letter language string (ISO639-1) into ISO639-3.
$iso1 | string |
Definition at line 714 of file PKPLocale.inc.php.
References _getAllLocalesCacheContent().
Referenced by getIso3FromLocale().
|
static |
Translate the PKP locale identifier into an ISO639-3 compatible 3-letter string.
$locale | string |
Definition at line 750 of file PKPLocale.inc.php.
References getIso3FromIso1().
Referenced by Dc11SchemaArticleAdapter\extractMetadataFromDataObject().
|
static |
Return the key name of the user's currently selected locale (default is "en_US" for U.S. English).
Reimplemented in AppLocale.
Definition at line 119 of file PKPLocale.inc.php.
References SessionManager\getManager(), AppLocale\getSupportedLocales(), and isLocaleValid().
|
static |
Get the reading direction for a particular locale.
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.
$locale | string |
Definition at line 465 of file PKPLocale.inc.php.
References _getAllLocalesCacheContent().
Referenced by BootstrapThreeThemePlugin\init(), HealthSciencesThemePlugin\init(), and PKPTemplateManager\initialize().
|
static |
Get a list of locale files currently registered, either in all locales (in an array for each locale), or for a specific locale.
$locale | string Locale identifier (optional) |
Definition at line 229 of file PKPLocale.inc.php.
References Registry\get().
Referenced by registerLocaleFile(), and translate().
|
static |
Translate an ISO639-2b compatible 3-letter string into the PKP locale identifier.
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.
$iso3letter | string |
Definition at line 671 of file PKPLocale.inc.php.
References _getAllLocalesCacheContent(), AppLocale\getPrimaryLocale(), and AppLocale\getSupportedLocales().
Referenced by PKPLocaleTest\testGetLocaleFrom3LetterIso(), O4DOIXmlFilter\translateLanguageToLocale(), and DataciteXmlFilter\translateLanguageToLocale().
|
static |
Translate an ISO639-3 compatible 3-letter string into the PKP locale identifier.
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.
$iso3 | string |
Definition at line 781 of file PKPLocale.inc.php.
References _getAllLocalesCacheContent(), AppLocale\getPrimaryLocale(), and AppLocale\getSupportedLocales().
|
static |
Get the stack of "important" locales, most important first.
Reimplemented in AppLocale.
Definition at line 182 of file PKPLocale.inc.php.
References AppLocale\getLocale().
|
static |
Get the stylesheet filename for a particular locale.
$locale | string |
Definition at line 446 of file PKPLocale.inc.php.
References _getAllLocalesCacheContent().
Referenced by PKPTemplateManager\setupBackendPage(), and PKPLocaleTest\testGetLocaleStylesheet().
|
static |
Given a locale string, get the list of parameter references of the form {$myParameterName}.
$source | string |
Definition at line 599 of file PKPLocale.inc.php.
References PKPString\regexp_match_all().
Referenced by LocaleFile\testLocale().
|
static |
Retrieve the primary locale of the current context.
Reimplemented in AppLocale.
Definition at line 200 of file PKPLocale.inc.php.
References isLocaleValid().
Referenced by BrowseBySectionPlugin\executeSectionFormFields().
|
static |
Get all supported form locales for the current context.
Reimplemented in AppLocale.
Definition at line 99 of file PKPLocale.inc.php.
References getAllLocales().
|
static |
Get all supported UI locales for the current context.
Reimplemented in AppLocale.
Definition at line 80 of file PKPLocale.inc.php.
References getAllLocales().
|
static |
Get the sites time zone.
Definition at line 880 of file PKPLocale.inc.php.
References DAORegistry\getDAO(), and Config\getVar().
Referenced by initialize().
|
static |
Initialize the locale system.
$request | PKPRequest |
Reimplemented in AppLocale.
Definition at line 284 of file PKPLocale.inc.php.
References $request, DBConnection\getInstance(), AppLocale\getLocale(), getTimeZone(), Config\getVar(), and AppLocale\registerLocaleFile().
|
static |
Install support for a new locale.
$locale | string |
Definition at line 557 of file PKPLocale.inc.php.
References HookRegistry\call(), PluginRegistry\getCategories(), DAORegistry\getDAO(), PluginRegistry\loadCategory(), and AppLocale\requireComponents().
Referenced by InstallLanguageForm\execute(), and reloadLocale().
|
static |
Determine whether or not a locale is marked incomplete.
$locale | xx_XX symbolic name of locale to check |
Definition at line 478 of file PKPLocale.inc.php.
References _getAllLocalesCacheContent().
Referenced by InstallForm\__construct(), AdminLanguageGridHandler\loadData(), and PKPLocaleTest\testIsLocaleComplete().
|
static |
Check if the supplied locale is currently installable.
$locale | string |
Definition at line 505 of file PKPLocale.inc.php.
Referenced by AdminLanguageGridHandler\_updateLocaleSupportState(), InstallLanguageForm\execute(), ContactForm\execute(), UserDetailsForm\execute(), getLocale(), O4DOIXmlFilter\getObjectLocalePrecedence(), DataciteXmlFilter\getObjectLocalePrecedence(), getPrimaryLocale(), InstallHandler\index(), PKPInstall\preInstall(), LanguageGridHandler\saveLanguageSetting(), LanguageGridHandler\setContextPrimaryLocale(), PKPUserHandler\setLocale(), AdminLanguageGridHandler\setPrimaryLocale(), O4DOIXmlFilter\translateLanguageToLocale(), DataciteXmlFilter\translateLanguageToLocale(), and InstallHandler\upgrade().
|
static |
Determine whether or not a locale uses family name first.
$locale | xx_XX symbolic name of locale to check |
Definition at line 492 of file PKPLocale.inc.php.
References _getAllLocalesCacheContent().
|
static |
Load a locale list from a file.
$filename | string |
Definition at line 518 of file PKPLocale.inc.php.
Referenced by _allLocalesCacheMiss().
|
static |
Build an associative array of LOCALE_COMPOMENT_... => filename (use getFilenameComponentMap instead)
$locale | string |
Reimplemented in AppLocale.
Definition at line 337 of file PKPLocale.inc.php.
|
static |
Register a locale file against the current list.
$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. |
Reimplemented in AppLocale.
Definition at line 423 of file PKPLocale.inc.php.
References HookRegistry\call(), and getLocaleFiles().
|
static |
Reload locale-specific data.
$locale | string |
Definition at line 588 of file PKPLocale.inc.php.
References installLocale(), and uninstallLocale().
Referenced by PKP\Services\PKPContextService\restoreLocaleDefaults().
|
static |
Load a set of locale components. Parameters of mixed length may be supplied, each a LOCALE_COMPONENT_... constant. An optional final parameter may be supplied to specify the locale (e.g. 'en_US').
Reimplemented in AppLocale.
Definition at line 374 of file PKPLocale.inc.php.
References fatalError().
Referenced by TextureArticleGalleyForm\__construct(), AuthorDepositForm\__construct(), MarkupHandler\_conversion(), MarkupHandler\batch(), TextureHandler\editor(), PKPApplication\getCCLicenseBadge(), MarkupPlugin\manage(), MarkupHandler\profile(), MarkupSettingsTabHandler\settings(), SwordSettingsTabHandler\swordSettings(), and MarkupHandler\triggerConversion().
|
static |
Translate a string using the selected locale. Substitution works by replacing tokens like "{$foo}" with the value of the parameter named "foo" (if supplied).
$key | string |
$params | array named substitution parameters |
$locale | string the locale to use |
$missingKeyHandler | function Callback to be invoked when a key cannot be found. |
Reimplemented in AppLocale.
Definition at line 257 of file PKPLocale.inc.php.
References HookRegistry\call(), Registry\get(), AppLocale\getLocale(), and getLocaleFiles().
Referenced by Issue\getIssueIdentification().
|
static |
Uninstall support for an existing locale.
$locale | string |
Definition at line 577 of file PKPLocale.inc.php.
References DAORegistry\getDAO().
Referenced by reloadLocale(), and AdminLanguageGridHandler\uninstallLocale().
|
static |
Definition at line 74 of file PKPLocale.inc.php.
Referenced by initialize().