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 the language of outgoing e-mail messages === By default, all e-mail messages are sent out on the default language of the depository. You might let the users choose their preferred language so that they'll receive messages on that language. The ''lang'' (system) field is defined for all users; the value can be set automatically in [[EPrints_Directory_Structure/eprints3/archives/ARCHIVEID/cfg/cfg.d|cfg/cfg.d/user_fields_automatic.pl]] for example by $c->{set_user_automatic_fields} = sub { my ( $user ) = @_; if( !$user -> is_set( "frequency" ) ) { $user->set_value("frequency","never"); } ## NEW: set default language to the session language if( !$user -> is_set( "lang" ) ) { $user->set_value("lang",$user->{session}->{lang}->{id}); } } and also let the user edit their own preference by inserting the ''lang'' field in the [[EPrints_Directory_Structure/eprints3/archives/ARCHIVEID/cfg/workflows/user|cfg/workflows/user/default.xml]] workflow, say in the personal section: <component type="Field::Multi"> <title><epc:phrase ref="user_section_personal" /></title> <field ref="name" required="yes" /> <field ref="lang"/> <-- NEW!!! edit preferred language --> <field ref="dept"/> <field ref="org"/> <field ref="address"/> <field ref="country"/> <field ref="url"/> </component> Finally, you might want the default language appear on the user's profile pages. This needs editing the [[EPrints_Directory_Structure/eprints3/archives/ARCHIVEID/cfg/cfg.d|cfg/cfg.d/user_render.pl]] file by inserting the following into the place of your choice (I coose just next to "country"): if( $user->is_set( "lang" ) ) { $p->appendChild($session->make_element( "br" ) ); $p->appendChild($session->html_phrase("user_preferred_language", lang => $user->render_value( "lang" ) ) ); } here the new phrase "user_preferred_language" should be defined in one of the phrase files (see the [[#Phrases|Phrases]] section); in it the pin "lang" contains the language itself: <epp:phrase id="user_preferred_language">Preferred language: < epc:pin name="lang"/> </epp:phrase> <span style="color:red; font-weight:bold">WARNING!</span> While e-mail messages are sent out utf-8 encoded, they are not properly formatted. For non-English e-mails you must apply the "Proper utf-8 encoding for outgoing e-mails" patch from the [[#Patches|Patches]] section. Also, by default, the text version of the e-mail does not contain links. This is also corrected by this patch.
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)