Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds Persian localization file #1408

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

ziaenezhad
Copy link

No description provided.

@plk
Copy link
Owner

plk commented Jan 9, 2025

@moewew - I think we will need a more complete .lbx for persian? This only has a few strings in there? There is a related PR for biblatex-apa which reasonably suggests a localisation for & but I'm not sure the and bibstring is suitable as this defaults to the string "and" in English. I wonder if we need another bibstring ("andsymbol" ...) for this?

@moewew
Copy link
Collaborator

moewew commented Jan 9, 2025

@ziaenezhad Thank you very much for contributing persian.lbx. I think I agree with @plk here. If we want to include this into core biblatex we will want to make sure that biblatex supports Persian more fully. Last time I looked into this, it was extremely tricky to get RTL typesetting right (#1139, #1252 and linked issues) and since I have no experience there, we really need some more help with that.

@ziaenezhad
Copy link
Author

ziaenezhad commented Jan 15, 2025

Yes, it works right. let's see some code examples:

% ./references.bib
@article{ref1,
  author = {علی علی‌پور, and ممد ممدپور},
  title = {مقایسه تطبیقی نقش مسواک و جاروبرقی در رشد نهال انگور},
  journal = {مجله نمونه},
  year = {1402},
  volume = {10},
  number = {2},
  pages = {1-10},
}

@book{ref2,
  author = {علی علی‌پور, and ممد ممدپورو, and رضا رضاپور},
  title = {تاثیر بوی کباب در افزایش نرخ بهروری کارگران کارخانه شورآباد},
  year = {1390},
  volume = {1},
  pages = {34-45},
}

using biblatex beside of xeperisa:

\documentclass{article}
\usepackage[backend=biber,style=apa]{biblatex}
\addbibresource{references.bib}

\usepackage{xepersian}
\settextfont{Yas}
\setlatintextfont{Times New Roman}

\begin{document}
	
	\section{مقدمه}	
	این یک نمونه متن است که در آن به منبعی با دو نویسنده
	\parencite{ref1}
	اشاره شده است.
	این یک نمونه متن دیگری است که در آن به منبعی با سه نویسنده
	\parencite{ref2}
	اشاره شده است.
	
	\printbibliography
	
\end{document}

Here is the output. @moewew as you see there is no issue regarding RTL typesetting. the only problem is the bib strings. now let's add the persian.lbx next to our main .tex file, and load it this way:

\usepackage[backend=biber, style=apa, language=persian]{biblatex}

You can check the output. As expected the English strings are replaced. @plk the only issue that remains is the & issue. let's place the fixed files (apa-dev.bbx & apa-dev.cbx) next to the main .tex file and try:

\usepackage[backend=biber, style=apa-dev, language=persian]{biblatex}

Now it's the final output as you see all issues are fixed and it looks fine :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants