plk / biblatex

biblatex is a sophisticated bibliography system for LaTeX users. It has considerably more features than traditional bibtex and supports UTF-8
520 stars 118 forks source link

Adding Persian lbx #1139

Open mkhoshbin1 opened 3 years ago

mkhoshbin1 commented 3 years ago

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 commented 3 years ago

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.

mkhoshbin1 commented 3 years ago

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 commented 3 years ago

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 commented 2 years ago

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

moewew commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

florisre commented 1 year ago

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 commented 1 year ago

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.