EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #09915


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

RE: [EP-tech] Right to Left Text


CAUTION: This e-mail originated outside the University of Southampton.

Hi David

 

Many thanks for the clarifications.

 

Thanks

Maher

 

From: David R Newman <drn@ecs.soton.ac.uk>
Sent: Wednesday, January 1, 2025 4:12 PM
To: eprints-tech@ecs.soton.ac.uk; Maher Abdellatif Ahmad Qahwash <qahwash@kfupm.edu.sa>
Subject: Re: [EP-tech] Right to Left Text

 

Hi Maher, I think you may need a bespoke function for rendering abstracts that can detect if the text is in Arabic or a right-to-left language. I think I would start with the lib/cfg. d/render_paras. pl and as part of how the <p> elements

ZjQcmQRYFpfptBannerStart

Warning: This email has been sent from outside KFUPM. Do not open links or attachments unless you are sure they are safe.

ZjQcmQRYFpfptBannerEnd

Hi Maher,

I think you may need a bespoke function for rendering abstracts that can detect if the text is in Arabic or a right-to-left language.  I think I would start with the lib/cfg.d/render_paras.pl and as part of how the <p> elements are created do a test to see if any characters are Arabic.  If it is, either set a class you can then use is CSS with the attribute - direction: rtl; or directly set this in a style attribute for the p element.  E.g.

my $p = $para ~= m/\p{Arabic}/ ? $session->make_element( "p", class=>"ep_field_para", style=>"direction: rtl;" ) : $session->make_element( "p", class=>"ep_field_para" );

If that does not work you may want to try the regex m/[\x{0600}\x{0601}...\x{06FF}]/ instead.  Also, if you are liable to have the occasional Arabic character in Latin text then you may need to make the regex match the first character of the paragraph rather than any character in the paragraph.

Once done, you will need to make sure that the abstract field has its render_single_value attribute set to either 'EPrints::Extras::render_paras' or 'render_paras'.  The former is a core function added in EPrints 3.4.5 that will call $c->{render_paras} if it exists whereas the latter should just directly call $c->{render_paras}.

Finally, you will need to regenerate affected abstract pages with bin/generate_abstracts. If you have a lot it may be best run bin/epadmin refresh_abstracts and reload the webserver and just get all abstract pages to be regenerated on the next request.

Regards

David Newman


On 01/01/2025 4:44 am, Maher Abdellatif Ahmad Qahwash wrote:

CAUTION: This e-mail originated outside the University of Southampton.

CAUTION: This e-mail originated outside the University of Southampton.

Hi

 

We have an abstract field which contains Arabic and English words which results in the order of the words to get mixed up.  However when copying the same abstract and pasting it in word the order is correct.  Do we need to add anything to this abstract field in the workflow XML to resolve this issue?

 

Thanks

Maher


DISCLAIMER: The information in this email and its attachments (if any) is intended for the addressee only and may contain confidential or privileged information. If you are not the intended recipient, please delete the email and its attachments from your system and notify the sender immediately. You should not retain, disclose, copy, or use this email or any of its contents for any purpose, nor disclose its contents to any other person. KFUPM is not responsible for changes made to this message after it was sent. Statements and opinions expressed in this e-mail are those of the sender, and do not necessarily reflect those of KFUPM. KFUPM is not liable for any effect or virus damage caused by this message.
إن المعلومات الواردة في هذا البريد الإلكتروني ومرفقاته إن وجدت، قد تكون خاصة أو سرية؛ فإذا لم تكن المقصود بهذه الرسالة؛ فيُرجى منك حذفها ومرفقاتها من نظامك وإخطار المرسل بخطأ وصولها إليك فورا. كما لا يجوز نسخ أي جزء منها أو مرفقاتها ، أو الإفصاح عن محتوياتها لأي شخص أو استعمالها لأي غرض آخر. إن جامعة الملك فهد للبترول والمعادن لا تتحمل مسؤولية التغييرات التي يتم إجراؤها على هذه الرسالة بعد إرسالها. وإن البيانات أو الآراء المعبر عنها في هذا البريد، هي بيانات تخص مُرسلها، ولا تعكس بالضرورة رأي وبيانات الجامعة. كما لا تتحمل الجامعة مسؤولية أي تأثير ينتج عن هذه الرسالة أوعن أي فيروس قد تحمله.



*** Options: https://wiki.eprints.org/w/Eprints-tech_Mailing_List
*** Archive: https://www.eprints.org/tech.php/
*** EPrints community wiki: https://wiki.eprints.org/
 

 


DISCLAIMER: The information in this email and its attachments (if any) is intended for the addressee only and may contain confidential or privileged information. If you are not the intended recipient, please delete the email and its attachments from your system and notify the sender immediately. You should not retain, disclose, copy, or use this email or any of its contents for any purpose, nor disclose its contents to any other person. KFUPM is not responsible for changes made to this message after it was sent. Statements and opinions expressed in this e-mail are those of the sender, and do not necessarily reflect those of KFUPM. KFUPM is not liable for any effect or virus damage caused by this message.
إن المعلومات الواردة في هذا البريد الإلكتروني ومرفقاته إن وجدت، قد تكون خاصة أو سرية؛ فإذا لم تكن المقصود بهذه الرسالة؛ فيُرجى منك حذفها ومرفقاتها من نظامك وإخطار المرسل بخطأ وصولها إليك فورا. كما لا يجوز نسخ أي جزء منها أو مرفقاتها ، أو الإفصاح عن محتوياتها لأي شخص أو استعمالها لأي غرض آخر. إن جامعة الملك فهد للبترول والمعادن لا تتحمل مسؤولية التغييرات التي يتم إجراؤها على هذه الرسالة بعد إرسالها. وإن البيانات أو الآراء المعبر عنها في هذا البريد، هي بيانات تخص مُرسلها، ولا تعكس بالضرورة رأي وبيانات الجامعة. كما لا تتحمل الجامعة مسؤولية أي تأثير ينتج عن هذه الرسالة أوعن أي فيروس قد تحمله.