Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
API:EPrints/Language
(section)
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==METHODS== <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_new --> ===new=== $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. <tt>$langid</tt> is the ISO language ID of the language, <tt>$repository</tt> is the repository to which this language object belongs. <tt>$fallback</tt> is either <tt>undef</tt> or a reference to the main language object for the repository. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_clone --> ===clone=== EPrints::Language->CLONE Clone a language object. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_get_phrase_info --> ===get_phrase_info=== $info = $language->get_phrase_info( $phraseid ) Returns a hash describing the phrase <tt>$phraseid</tt>. Contains: langid - the language the phrase is from phraseid - the phrase ID xml - the raw XML fragment fallback - whether the phrase was from the fallback language system - whether the phrase was from the system files filename - the file the phrase came from If <tt>$phraseid</tt> doesn't exist returns <tt>undef</tt>. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_get_phrase_ids --> ===get_phrase_ids=== $phraseids = $language->get_phrase_ids( $fallback ) Returns a reference to an array of all phrase ids that are defined in this language (repository and system). If <tt>$fallback</tt> is <tt>true</tt> returns any additional phrase IDs defined in the fallback language. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_phrase --> ===phrase=== $xhtml = $language->phrase( $phraseid, $inserts ) Return an XHTML DOM structure for the phrase with the given phraseid. The <tt>$phraseid</tt> is looked for in the following order, if it's not in one phrase file the system checks the next. 1. This languages repository specific phrases. 2. The fallback languages repository specific phrases (if there is a fallback). 3. This languages general phrases. 4. The fallback languages general phrases (if there is a fallback). 5. Failing that it returns an XHTML DOM encoded error. If the phrase contains <tt>pin</tt> elements then $inserts must be a reference to a hash. Each <tt>pin</tt> has a <tt>name</tt> attribute. For each pin there must be a key in <tt>$inserts</tt> of the <tt>name</tt>. The value is a XHTML DOM object which will replace the <tt>pin</tt> when returing this phrase. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_has_phrase --> ===has_phrase=== $boolean = $language->has_phrase( $phraseid ) Returns <tt>true</tt> if the <tt>$phraseid</tt> is defined for this language. Returns <tt>false</tt> if it is only available as a fallback or unavailable. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_get_id --> ===get_id=== $langid = $language->get_id Return the ISO language ID of this language object. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_get_fallback --> ===get_fallback=== $lang = $language->get_fallback Return the fallback language for this language. Returns <tt>undef</tt> if there is no fallback. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_load_phrases --> ===load_phrases=== $ok = $language->load_phrases( $file ) Load phrases from <tt>$file</tt> into the current language. Use with care! <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_create_phrase_doc --> ===create_phrase_doc=== $doc = EPrints::Language->create_phrase_doc( $session, [ $comment ] ) Create and return a new, empty, phrases document. Optionally put <tt>$comment</tt> at the top. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=head_copyright -->
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)