Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
AppLocale Class Reference
Inheritance diagram for AppLocale:
PKPLocale PKPLocale

Public Member Functions

 getLocale ()
 
 getLocalePrecedence ()
 
 getLocalePrecedence ()
 
 getPrimaryLocale ()
 
 getPrimaryLocale ()
 
 getSupportedFormLocales ()
 
 getSupportedFormLocales ()
 
 getSupportedLocales ()
 
 getSupportedLocales ()
 
 makeComponentMap ($locale)
 
 requireComponents ()
 
 setPrimaryLocale ($primaryLocale)
 
 setSupportedLocales ($supportedLocales)
 
 translate ($key, $params=array(), $locale=null)
 
- Public Member Functions inherited from PKPLocale
 _allLocalesCacheMiss (&$cache, $id)
 
_getAllLocalesCache ()
 
_getAllLocalesCacheContent ()
 
 get2LetterFrom3LetterIsoLanguage ($iso3Letter)
 
 get3LetterFrom2LetterIsoLanguage ($iso2Letter)
 
 get3LetterIsoFromLocale ($locale)
 
getAllLocales ()
 
 getFilenameComponentMap ($locale)
 
 getIso1FromIso3 ($iso3)
 
 getIso1FromLocale ($locale)
 
 getIso3FromIso1 ($iso1)
 
 getIso3FromLocale ($locale)
 
getLocaleFiles ($locale=null)
 
 getLocaleFrom3LetterIso ($iso3Letter)
 
 getLocaleFromIso3 ($iso3)
 
 getLocaleStyleSheet ($locale)
 
 getParameterNames ($source)
 
 initialize ()
 
 installLocale ($locale)
 
 isLocaleComplete ($locale)
 
 isLocaleValid ($locale)
 
loadLocaleList ($filename)
 
 makeComponentMap ($locale)
 
registerLocaleFile ($locale, $filename, $addToTop=false)
 
 reloadLocale ($locale)
 
 requireComponents ()
 
 translate ($key, $params=array(), $locale=null)
 
 uninstallLocale ($locale)
 

Static Public Member Functions

static setTranslations ($translations)
 

Detailed Description

Provides methods for loading locale data and translating strings identified by unique keys.

Mock implementation of the Locale class.

Definition at line 27 of file AppLocale.inc.php.

Member Function Documentation

AppLocale::getLocale ( )

Return the key name of the user's currently selected locale (default is "en_US" for U.S. English).

Returns
string

Definition at line 71 of file AppLocale.inc.php.

References PKPRequest\getCookieVar(), Request\getJournal(), SessionManager\getManager(), PKPRequest\getSite(), getSupportedLocales(), PKPRequest\getUserVar(), Config\getVar(), and PKPLocale\isLocaleValid().

Referenced by CounterReportPlugin\_assignTemplateCounterXML(), LanguageDAO\_getCache(), SolrWebService\_getOrdering(), EditorSubmissionDAO\_getUnfilteredEditorSubmissions(), SectionEditorSubmissionDAO\_getUnfilteredSectionEditorSubmissions(), IssueHandler\_setupIssueTemplate(), AboutHandler\aboutThisPublishingSystem(), PKPPlugin\addHelpData(), PKPPlugin\addLocaleData(), MetadataDescription\addStatement(), IssueHandler\archive(), AuthorSubmitForm\AuthorSubmitForm(), TinyMCEPlugin\callback(), DOAJPlugin\contact(), PayPalPlugin\displayPaymentForm(), EmailHandler\emails(), ControlledVocabDAO\enumerate(), EmailTemplateForm\execute(), EditorAction\expediteSubmission(), Dc11SchemaArticleAdapter\extractMetadataFromDataObject(), CitationForm\fetch(), PKPAnnouncementTypeDAO\getAnnouncementTypeName(), ArticleDAO\getArticle(), ArticleReportDAO\getArticleReport(), ArticleDAO\getArticlesByJournalId(), ArticleDAO\getArticlesByUserId(), AuthorDAO\getAuthorsAlphabetizedByJournal(), AuthorSubmissionDAO\getAuthorSubmission(), AuthorSubmissionDAO\getAuthorSubmissions(), ArticleDAO\getBySetting(), PublishedArticleDAO\getBySetting(), PKPPageRouter\getCacheFilename(), KeywordCloudBlockPlugin\getContents(), CopyeditorSubmissionDAO\getCopyeditorSubmission(), CopyeditorSubmissionDAO\getCopyeditorSubmissionsByCopyeditorId(), Form\getDefaultFormLocale(), EditorSubmissionDAO\getEditorSubmission(), IssueGalley\getGalleyLabel(), ArticleGalley\getGalleyLabel(), Gift\getGiftName(), JournalDAO\getJournals(), PKPHelp\getLocale(), getLocalePrecedence(), Submission\getLocalizedData(), Journal\getLocalizedDescription(), Journal\getLocalizedFavicon(), PublishedArticle\getLocalizedGalleys(), AbntCitationPlugin\getLocalizedLocation(), Journal\getLocalizedPageHeaderLogo(), Site\getLocalizedPageHeaderTitle(), Journal\getLocalizedPageHeaderTitle(), Journal\getLocalizedSetting(), PKPNotificationManager\getParamsForCurrentLocale(), PublishedArticleDAO\getPublishedArticleAuthors(), PublishedArticleDAO\getPublishedArticleByArticleId(), PublishedArticleDAO\getPublishedArticleIdsAlphabetizedByJournal(), PublishedArticleDAO\getPublishedArticles(), PublishedArticleDAO\getPublishedArticlesByJournalId(), PublishedArticleDAO\getPublishedArticlesBySectionId(), PublishedArticleDAO\getPublishedArticlesInSections(), ReviewerSubmissionDAO\getReviewerSubmission(), ReviewerSubmissionDAO\getReviewerSubmissionsByReviewerId(), ReviewReportDAO\getReviewReport(), SectionEditorSubmissionDAO\getSectionEditorSubmission(), SectionEditorSubmissionDAO\getSectionEditorSubmissions(), MetadataDescription\getStatement(), ProofreaderSubmissionDAO\getSubmission(), LayoutEditorSubmissionDAO\getSubmission(), LayoutEditorSubmissionDAO\getSubmissions(), ProofreaderSubmissionDAO\getSubmissions(), SubscriptionTypeDAO\getSubscriptionTypeName(), EventLogEntry\getTranslatedMessage(), BooksForReviewHandler\index(), AboutHandler\index(), EmailTemplateForm\initData(), AuthorSubmitStep1Form\initData(), QuickSubmitForm\initData(), InstallForm\initData(), PKPLocale\initialize(), SiteSettingsDAO\installSettings(), JournalSettingsDAO\installSettings(), PKPUserGroupDAO\installSettings(), PKPMailTemplate\PKPMailTemplate(), Installer\preInstall(), TemplateBasedFilter\process(), PKPLocale\requireComponents(), SolrWebService\retrieveResults(), SharingRT\sharingLocale(), PKPLocale\translate(), LDAPAuthPlugin\userFromAttr(), LDAPAuthPlugin\userToAttr(), ArticleHandler\view(), HelpHandler\view(), BooksForReviewHandler\viewBookForReview(), and IssueHandler\viewIssue().

AppLocale::getLocalePrecedence ( )

Mocked method

Returns
array a test array of locales

Definition at line 67 of file env1/MockAppLocale.inc.php.

AppLocale::getLocalePrecedence ( )

Get the stack of "important" locales, most important first.

Returns
array

Definition at line 134 of file AppLocale.inc.php.

References Request\getJournal(), getLocale(), and PKPRequest\getSite().

Referenced by DataObject\getLocalizedData().

AppLocale::getPrimaryLocale ( )

Mocked method

Returns
string

Definition at line 98 of file env1/MockAppLocale.inc.php.

AppLocale::getPrimaryLocale ( )

Retrieve the primary locale of the current context.

Returns
string

Definition at line 152 of file AppLocale.inc.php.

References Request\getJournal(), PKPRequest\getSite(), Config\getVar(), and PKPLocale\isLocaleValid().

Referenced by EditorSubmissionDAO\_getUnfilteredEditorSubmissions(), SectionEditorSubmissionDAO\_getUnfilteredSectionEditorSubmissions(), AboutHandler\aboutThisPublishingSystem(), ControlledVocabDAO\enumerate(), Mods34SchemaSubmissionAdapter\extractMetadataFromDataObject(), Form\Form(), FormValidatorLocale\FormValidatorLocale(), PKPAnnouncementTypeDAO\getAnnouncementTypeName(), ArticleDAO\getArticle(), ArticleReportDAO\getArticleReport(), ArticleDAO\getArticlesByJournalId(), ArticleDAO\getArticlesByUserId(), AuthorDAO\getAuthorsAlphabetizedByJournal(), AuthorSubmissionDAO\getAuthorSubmission(), AuthorSubmissionDAO\getAuthorSubmissions(), ArticleDAO\getBySetting(), PublishedArticleDAO\getBySetting(), CopyeditorSubmissionDAO\getCopyeditorSubmission(), CopyeditorSubmissionDAO\getCopyeditorSubmissionsByCopyeditorId(), EditorSubmissionDAO\getEditorSubmission(), PKPEmailTemplateDAO\getEmailTemplate(), JournalDAO\getJournals(), PKPLocale\getLocaleFrom3LetterIso(), PKPLocale\getLocaleFromIso3(), Journal\getLocalizedFavicon(), PublishedArticle\getLocalizedGalleys(), AbntCitationPlugin\getLocalizedLocation(), Journal\getLocalizedPageHeaderLogo(), Site\getLocalizedPageHeaderTitle(), Journal\getLocalizedPageHeaderTitle(), Journal\getLocalizedSetting(), FormValidatorLocale\getMessage(), PKPNotificationManager\getParamsForCurrentLocale(), PublishedArticleDAO\getPublishedArticleAuthors(), PublishedArticleDAO\getPublishedArticleByArticleId(), PublishedArticleDAO\getPublishedArticles(), PublishedArticleDAO\getPublishedArticlesByJournalId(), PublishedArticleDAO\getPublishedArticlesBySectionId(), PublishedArticleDAO\getPublishedArticlesInSections(), ReviewerSubmissionDAO\getReviewerSubmission(), ReviewerSubmissionDAO\getReviewerSubmissionsByReviewerId(), ReviewReportDAO\getReviewReport(), SectionEditorSubmissionDAO\getSectionEditorSubmission(), SectionEditorSubmissionDAO\getSectionEditorSubmissions(), ProofreaderSubmissionDAO\getSubmission(), LayoutEditorSubmissionDAO\getSubmission(), LayoutEditorSubmissionDAO\getSubmissions(), ProofreaderSubmissionDAO\getSubmissions(), SubscriptionTypeDAO\getSubscriptionTypeName(), AboutHandler\index(), NotificationHandler\notificationFeed(), and UserXMLParser\parseData().

AppLocale::getSupportedFormLocales ( )

Get all supported form locales for the current context.

Returns
array

Definition at line 51 of file AppLocale.inc.php.

References PKPLocale\getAllLocales(), Request\getJournal(), PKPRequest\getSite(), and Config\getVar().

Referenced by Form\Form(), MultilingualListbuilderGridColumn\MultilingualListbuilderGridColumn(), and GridCellProvider\render().

AppLocale::getSupportedFormLocales ( )

Mocked method

Returns
array

Definition at line 127 of file env1/MockAppLocale.inc.php.

AppLocale::getSupportedLocales ( )
AppLocale::getSupportedLocales ( )

Mocked method

Returns
array

Definition at line 119 of file env1/MockAppLocale.inc.php.

AppLocale::makeComponentMap (   $locale)

Make a map of components to their respective files.

Parameters
$localestring
Returns
array

Definition at line 181 of file AppLocale.inc.php.

Referenced by genTestLocale\execute(), and PKPLocale\getFilenameComponentMap().

AppLocale::requireComponents ( )

method required during setup of the PKP templating engine and application framework

Definition at line 59 of file env1/MockAppLocale.inc.php.

Referenced by DOIExportPlugin\_displayIssueList(), JournalSettingsDAO\_performLocalizedReplacement(), EditorHandler\assignEditor(), UserHandler\authorizationDenied(), CopyAccessLogFileTool\CopyAccessLogFileTool(), PubIdImportExportPlugin\display(), JournalSetupStep3Form\display(), SuppFileForm\display(), MetadataForm\display(), DOIExportPlugin\displayAllUnregisteredObjects(), ManualPaymentPlugin\displayPaymentForm(), PayPalPlugin\displayPaymentForm(), SubmissionEditHandler\enrollSearch(), JournalSiteSettingsForm\execute(), DuraCloudImportExportPlugin\executeCLI(), DOIExportPlugin\executeCLI(), NativeImportExportPlugin\executeCLI(), Dc11SchemaArticleAdapter\extractMetadataFromDataObject(), ResolverPlugin\fetch(), METSGatewayPlugin\fetch(), OJSPaymentManager\fulfillQueuedPayment(), DataciteExportPlugin\generateExportFiles(), StatisticsHandler\generateReport(), Issue\getIssueIdentification(), ManualPaymentPlugin\handle(), PKPComponentRouter\handleAuthorizationFailure(), InformationHandler\index(), PKPCitationGridHandler\initialize(), PKPFilterGridHandler\initialize(), GridHandler\initialize(), PKPPlugin\installData(), Action\instructions(), SectionEditorAction\recordDecision(), StatisticsHandler\reportGenerator(), SubmissionEditHandler\saveMetadata(), ScheduledTask\ScheduledTask(), PKPNotificationManager\sendNotificationEmail(), PKPNotificationManager\sendToMailingList(), BrowsePlugin\setupBrowseHandler(), AdminHandler\setupTemplate(), AboutHandler\setupTemplate(), CopyeditorHandler\setupTemplate(), ManagerHandler\setupTemplate(), ProofreaderHandler\setupTemplate(), LoginHandler\setupTemplate(), RTAdminHandler\setupTemplate(), PKPInstallHandler\setupTemplate(), ReportGeneratorHandler\setupTemplate(), ReviewerHandler\setupTemplate(), AuthorHandler\setupTemplate(), SectionHandler\setupTemplate(), SectionEditorHandler\setupTemplate(), AdminJournalHandler\setupTemplate(), LayoutEditorHandler\setupTemplate(), CommentHandler\setupTemplate(), NotificationHandler\setupTemplate(), UserHandler\setupTemplate(), SubscriptionManagerHandler\setupTemplate(), SubmissionEditHandler\submission(), TrackSubmissionHandler\submissionReview(), SubmissionEditHandler\submissionReview(), RTHandler\suppFileMetadata(), IssueManagementHandler\updateIssueToc(), SubmissionCopyeditHandler\viewMetadata(), and SubmissionEditHandler\viewMetadata().

AppLocale::setPrimaryLocale (   $primaryLocale)

Setter to configure a custom primary locale for testing.

Parameters
$primaryLocalestring

Definition at line 90 of file env1/MockAppLocale.inc.php.

Referenced by PKPLocaleTest\testGetLocaleFrom3LetterIso().

AppLocale::setSupportedLocales (   $supportedLocales)

Setter to configure a custom primary locale for testing.

Parameters
$supportedLocalesarray example array( 'en_US' => 'English', 'de_DE' => 'German' )

Definition at line 111 of file env1/MockAppLocale.inc.php.

Referenced by PKPLocaleTest\testGetLocaleFrom3LetterIso().

static AppLocale::setTranslations (   $translations)
static

Set translation keys to be faked.

Parameters
$translationsarray

Definition at line 135 of file env1/MockAppLocale.inc.php.

Referenced by SolrWebServiceTest\setUp(), and StringTest\testTitleCase().

AppLocale::translate (   $key,
  $params = array(),
  $locale = null 
)

Mocked method

Parameters
$keystring
$paramsarray named substitution parameters
$localestring the locale to use
Returns
string

Definition at line 78 of file env1/MockAppLocale.inc.php.


The documentation for this class was generated from the following files: