From EPrints Documentation
Revision as of 18:29, 11 August 2009 by Tdb01r (talk | contribs) (New page: <!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost. -...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


EPrints::Language - A Single Language supported by a repository.


The language class handles loading the "phrase" files for a single language. See the mail documentation for a full explanation of the format of phrase files.


 $language = EPrints::Language->new( $langid, $repository, [$fallback] )

Create a new language object representing the phases eprints will use in a given language, loading them from the phrase config XML files.

$langid is the ISO language ID of the language, $repository is the repository to which this language object belongs. $fallback is either undef or a reference to the main language object for the repository.


 $xhtml = $language->phrase( $phraseid, $inserts, $session )

Return an XHTML DOM structure for the phrase with the given phraseid.

The phraseid is looked for in the following order, if it's not in one phrase file the system checks the next.


 This languages repository specific phrases.


 The fallback languages repository specific phrases (if there is a fallback).


 This languages general phrases.


 The fallback languages general phrases (if there is a fallback).


 Failing that it returns an XHTML DOM encoded error.


 $boolean = $language->has_phrase( $phraseid, $session )

Return 1 if the phraseid is defined for this language. Return 0 if it is only available as a fallback or unavailable.


 $langid = $language->get_id

Return the ISO language ID of this language object.