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
My First Bazaar Package
(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!
= Adding the missing phrases= As EPrints is designed to be multi-language, phrases should be used instead of embedded text. In this section we add the phrase file to define a title and a description for our screen. Create the English language directory that will contain the package's English language phrase file: $ mkdir -p lib/lang/en/phrases/ Create a phrase file: $ gedit lib/lang/en/phrases/hello_world.xml <source lang="xml"> <?xml version="1.0" encoding="iso-8859-1" standalone="no" ?> <!DOCTYPE phrases SYSTEM "entities.dtd"> <epp:phrases xmlns="http://www.w3.org/1999/xhtml" xmlns:epp="http://eprints.org/ep3/phrase" xmlns:epc="http://eprints.org/ep3/control"> <epp:phrase id="Plugin/Screen/Hello:title">Hello</epp:phrase> <epp:phrase id="Plugin/Screen/Hello:description">My First Bazaar Package</epp:phrase> <epp:phrase id="Plugin/Screen/Hello:text">Hello World - This is the my first bazaar package calling.</epp:phrase> </epp:phrases> </source> Don't worry too much about the wrapping here, the important thing is the phrases of which we have created 3. Note that 2 of these (the top 2) will get used instantly by our package however the 3rd needs to be added to the render method of our screen. In order to do this edit the Hello.pm screen created in Step 1 and add the following in the appropriate place in the render method. $frag->appendChild($repository->xml->create_element("br")); $frag->appendChild($self->html_phrase("text")); For some hints on loading and manipulating EPrints see [[Manipulating eprints in 3.2]]. '''Don't Forget''' to add the phrase file to your bazaar package using the developer tools tab and commit them to git! '''WARNING: if your package overrides any existing EPrints phrases then your overrides will be applied to ALL repositories even if they have not enabled your package. In this case you would add your override phrases to a separate file - eg. lib/epm/hello_world/cfg/lang/en/phrases/hello_world_overrides.xml - this file will then only be considered when a repository enables your package. [[Category:EPrints_Bazaar]]
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)