Difference between revisions of "API:EPrints/Language"

From EPrints Documentation
Jump to: navigation, search
(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. -...)
 
(Removing all content from page)
Line 1: Line 1:
<!-- 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.
 
-->{{Pod2Wiki}}{{API:Source|file=EPrints/Language.pm|package_name=EPrints::Language}}[[Category:API|Language]]<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_name -->=NAME=
 
'''EPrints::Language''' - A Single Language supported by a repository.
 
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_description -->=DESCRIPTION=
 
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.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_new -->==new==
 
 
  $language = EPrints::Language-&gt;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.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_phrase -->==phrase==
 
 
  $xhtml = $language-&gt;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.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_this_languages_repository_specific_phrases -->==this_languages_repository_specific_phrases==
 
 
  This languages repository specific phrases.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_phrases -->==phrases==
 
 
  The fallback languages repository specific phrases (if there is a fallback).
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_this_languages_general_phrases -->==this_languages_general_phrases==
 
 
  This languages general phrases.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_phrases -->==phrases==
 
 
  The fallback languages general phrases (if there is a fallback).
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_failing_that_it_returns_an_xhtml_dom_encoded_error -->==failing_that_it_returns_an_xhtml_dom_encoded_error==
 
 
  Failing that it returns an XHTML DOM encoded error.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_has_phrase -->==has_phrase==
 
 
  $boolean = $language-&gt;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.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_get_id -->==get_id==
 
 
  $langid = $language-&gt;get_id
 
 
Return the ISO language ID of this language object.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=_postamble_ --><!-- End of Pod2Wiki -->
 

Revision as of 15:40, 12 August 2009