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
Translation
(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!
=== Setting document language === Each document file has its own language. The same document might be submitted in different languages. In the default Eprints workflow the reference to the language field is commented out; you only has to enable it. It is in file [[EPrints_Directory_Structure/eprints3/archives/ARCHIVEID/cfg/workflows/eprint|cfg/workflows/eprint/default.xml]], stage "files": <stage name="files"> <component type="XHTML">...</component> <component type="Upload"> <field ref="format" /> <field ref="formatdesc" /> <field ref="security" /> <field ref="license" /> <field ref="date_embargo" /> <field ref="language" /> <!-- UNCOMMENT! --> </component> </stage> The default value is set in [[EPrints_Directory_Structure/eprints3/archives/ARCHIVEID/cfg/cfg.d|cfg/cfg.d/document_fields_default.pl]] to the language of the session: $c->{set_document_defaults} = sub { my( $data, $session, $eprint ) = @_; ###### HERE: $data->{language} = $session->get_langid(); $data->{security} = "public"; }; The available language values are listed in [[EPrints_Directory_Structure/eprints3/archives/ARCHIVEID/cfg/namedsets|cfg/namedsets/languages]], you might consider revising this set. The "undefined" language is rendered as a question mark (?). You might also want to print the language as well. To this end, edit the [[EPrints_Directory_Structure/eprints3/archives/ARCHIVEID/cfg/citations/document|cfg/citations/document/default.xml]] file. Show the language only when it is set, and the document's mime type is ''text/plain'', ''application/pdf'', ''application/postscript'', ''application/msword'', or ''other''. (For a full list of available mime type see [[EPrints_Directory_Structure/eprints3/archives/ARCHIVEID/cfg/namedsets|cfg/namedsets/document]] ) <cite:linkhere>...</cite:linkhere> <epc:if test="security != 'public'"> ... </epc:if> <!-- NEW!!! --> <epc:if test="is_set(language) and format.one_of( 'text/plain' , 'application/pdf', 'application/postscript', 'application/msword', 'other')" > <epc:phrase ref="citation:doc_language"> <epc:param name="lang"> <epc:print expr="language"/> </epc:param> </epc:phrase> </epc:if> and, of course, one has to define the "citation:doc_language" phrase (see below) in all languages. In the phrase definition we have the pin "lang" which contains the document language in the actual language (defined as the phrase "<tt>languages_typename_XX</tt>"): <epp:phrase id="citation:doc_language"> (The document's language is <epc:pin name="lang"/>.) </epp:phrase> <span style="color: red; font-weight:bold">WARNING!</span> The example above works only after you've applied the "Citation phrases with embedded pins" patch in the [[#Patches|Patches]] section.
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)