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
Multilang field
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!
{{fieldtypes}} == Description == Allows multiple text values to be recorded representing the same text in different languages. This is a sub-class of the [[Compound field]] as at least two sub-fields are required. At least one to store the text and one to store the language (sub-field called <tt>lang</tt>) in which it is written. By default a Multilang field still sets <tt>multiple => 0</tt> so if more than only one language will be used for any one record then <tt>multiple => 1</tt> also needs to be set. The languages available for the <tt>lang</tt> sub-field are specified in the <tt>cfg/namedsets/languages</tt> file. == Inheritance == * [[Metadata]] ** [[Compound field]] *** [[Multilang field]] == Additional Properties == Same as [[Compound field#Additional_Properties|Compound fields]] except for {| border="1" cellpadding="3" cellspacing="0" ! Name !! Default Value !! Required !! Description !! Notes |- | '''input_boxes''' || <tt>1</tt> || NO || Number of boxes for this field in input form to insert separate values. || Different from [[Metadata]] default (<tt>0</tt>). |- | '''input_ordered''' || <tt>0</tt> || NO || Whether the rows of values are numbered and therefore can be re-ordered. || Different from [[Metadata]] default (<tt>1</tt>). Ordering is unnecessary, as priority is determined based on the language sub-field value (and the repository's configuration for language prioritisation). |- | '''match''' || <tt>IN</tt> || NO || How to match values in search results. || Different from [[Metadata]] default (<tt>EQ</tt>). Treat the search value as a list of whitespace-separated words rather than a single string. |} == Required Phrases == Same as [[Compound field#Required_Phrases|Compounds fields]] but rather than needing: datasetid + "_fieldname_" + fieldname Multilang fields require the following phrases. The first directly replaces the original fieldname phrase and the second specifies the language used: datasetid + "_fieldname_" + fieldname + "_" + subfieldname datasetid + "_fieldname_" + fieldname + "_lang" As Multilang fields are compound there may be more than two phrases to add depending on the number of subfields specified. If you were to change the <tt>title</tt> phrase for an eprint to have type <tt>multilang</tt>, you would need the phrases: eprint_fieldname_title_text eprint_fieldname_title_lang If you modify the <tt>cfg/namedsets/languages</tt> file you will need to make sure you add the appropriate additional phrases in the form: languages_typename_LANGID E.g. <tt>languages_typename_fr_ca</tt> could be <tt>French Canadian</tt> == Database == Multilang fields do not have a standard way of being stored in the database as they are compound fields. The <tt>lang</tt> sub-field will appear in the dataset table (or separate table if a <tt>multiple</tt> field) as: fieldname_lang VARCHAR(16) == API == See [[API:EPrints/MetaField/Multilang|API page]]. == Examples == Most basic example. { name => 'title_multilang', type => 'multilang', fields => [ { sub_name => 'text', type => 'text', }, ], } Multiple languages for a single record field. { name => 'title_multilang', type => 'multilang', multiple => 1, fields => [ { sub_name => 'text', type => 'text', }, ], } More than one non-language sub-field. { name => 'question', type => 'multilang', multiple => 1, fields => [ { sub_name => 'question', type => 'longtext', }, { sub_name => 'answer', type => 'text', }, ], }
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)
Templates used on this page:
Template:Fieldtypes
(
edit
)
Template:RefLinks
(
edit
)