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

Adding Persian lbx #1139

Open
mkhoshbin1 opened this issue Apr 28, 2021 · 11 comments
Open

Adding Persian lbx #1139

mkhoshbin1 opened this issue Apr 28, 2021 · 11 comments
Labels
enhancement localisation concerns lbx files or localisation in general

Comments

@mkhoshbin1
Copy link

mkhoshbin1 commented Apr 28, 2021

Hi,
I am a native Farsi (Persian) speaker and would like to contribute to the Persian localization. I am new to the latex ecosystem and have the following questions:

  1. Are you interested in this addition?
  2. There are a number of bibtex style files in persian-bib, but from what I see in the screenshots, that package (along with XePersian) does more than just string translations. They also manage LTR and RTL, appropriate commas (, vs ،), and the numeral system (e.g. 123 vs ۱۲۳). This page has very good screenshots. Can this be implemented?
  3. To manage the RTL transition, what else is necessary apart from lbx file?

I've read the checklist and can probably manage that. I may be able to help with more necessary tasks with minimal directions.

@moewew
Copy link
Collaborator

moewew commented Apr 28, 2021

Thank you very much for getting in touch and offering to contribute a localisation file.

We are always happy to integrate more languages into biblatex.

So far we have not had any RTL languages (and we are not particularly familiar with RTL languages either), so I'm guessing this is going to be a longer project. I'm expecting that many things that are generally possible with LaTeX should also be possible with biblatex, but there are some limitations in the way biblatex works that could make things difficult.


If you want to get started translating stuff, look into translating the strings in the .lbx file and answering the questions in the checklist.

If you want to explore how feasible all the LTR/RTL things are it would help greatly if you could provide us with minimal compilable example documents in Farsi that show how you set up things write normal text and a numbered list.

@moewew moewew added enhancement localisation concerns lbx files or localisation in general labels Apr 28, 2021
@mkhoshbin1
Copy link
Author

Thanks!
I'll get started on the lbx file based on the english version.
By example, do you mean a MWE with the expected output after all localisations?

@moewew
Copy link
Collaborator

moewew commented Apr 28, 2021

Ah sorry, a basic "hello world" document that shows how you typeset Farsi would be enough. It need not involve biblatex or any of its bibstrings at all. Since I have basically no experience with RTL languages, I need something simple to experiment with.

@mkhoshbin1
Copy link
Author

@moewew
Hello and sorry for the very late reply. Still interested in this issue?

@moewew
Copy link
Collaborator

moewew commented Dec 15, 2021

Sure, absolutely.

But as I say, I expect this might be much more difficult than translations for LTR languages, so a simple example document (without biblatex) to get us started would be great. It is quite possible though that we might get stuck at some point, because I have no idea about RTL languages.

@mkhoshbin1
Copy link
Author

Hi @moewew
I've prepared two documents. One contains a simple test and the other contains a sample book citation.
You will need to use XeTex and XePersian. You will also need to install the font I've included which is a standard Farsi font.

I have also made some progress translating the .lbx file. I'll let you know when I'm done with it.

sample_persian.zip

@moewew
Copy link
Collaborator

moewew commented Apr 15, 2022

Thanks for the examples. I see that both use xepersian, which seems to do a lot of work in order to patch additional packages to make them "Persian"-aware.

As I said, I have no clue at all about RTL languages, so I fear I might not be able to help an awful lot.

@mkhoshbin1
Copy link
Author

Yes. The changes are very significant.
Luckily, It defines a latin environment which can be turned on and off. This may help as it seems to switch everything to normal.
For example, I use this for the english references in my CV:

\begin{latin}
	\printbibliography[filter=articles, heading=none, resetnumbers=true]
\end{latin}

@mkhoshbin1
Copy link
Author

Perhaps the author of XePersian, @vafakhalighi, can give us some pointers?

@florisre
Copy link

Thank you very much for getting in touch and offering to contribute a localisation file.

We are always happy to integrate more languages into biblatex.

So far we have not had any RTL languages (and we are not particularly familiar with RTL languages either), so I'm guessing this is going to be a longer project. I'm expecting that many things that are generally possible with LaTeX should also be possible with biblatex, but there are some limitations in the way biblatex works that could make things difficult.

If you want to get started translating stuff, look into translating the strings in the .lbx file and answering the questions in the checklist.

If you want to explore how feasible all the LTR/RTL things are it would help greatly if you could provide us with minimal compilable example documents in Farsi that show how you set up things write normal text and a numbered list.

I took the liberty of creating another MWE which does not use xepersian, but rather polyglossia. I am not sure if this helps, but it seems like a more standard attempt to me, since biblatex interacts with polyglossia anyway, if I am not mistaken.

\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}

\setmainlanguage{persian}
\newfontfamily\persianfont[Script=Arabic]{Vazirmatn}

\begin{document}
	
	این یک مثال کوچک در زبان فارسی است. متن عادی را می‌بینید.
	
	لیست عددی:
	
	\begin{enumerate}
		\item مورد اول
		\item مورد دوم
		\item مورد سوم
	\end{enumerate}
	
	متن عادی ادامه دارد.
	
\end{document}

I am happy to help pursue this further, though I am not sure whether my skills will be of much use. Note, that the Vazirmatn font needs to be installed to compile this.

@florisre
Copy link

florisre commented Oct 4, 2023

Actually, come to think about this, another issue would arise with support for Persian in the bibliography: In academic writing in Iranian Studies, it is quite common to cite Persian language sources in transcribed form, meaning in Latin script rather than Arabic script. Many of my sources are currently transcribed but still tagged as langid="persian", thus might end up being typeset RTL etc.

Just a thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement localisation concerns lbx files or localisation in general
Projects
None yet
Development

No branches or pull requests

3 participants