21

As we can see in this question, Bengali (Bangla) support in polyglossia is incomplete.

The major weak areas are,

  1. Support for numerals.
  2. Support for other language related areas like dates.

For the first one, the current solutions are,

  1. As found here, defining own interfaces. The issues to be solved keep growing and one wants to give up at some point.
  2. As suggested here (near the end), redefine the meaning of \@arabic (and may be \@alph). As rightly indicated there, this is a risky approach.

My preferred approach has been the second one. But I am already paying the price of using this approach. I see that I can not even use those label or ref change options in enumitem.

If I decide to contribute by adding Bengali (Bangla) support to polyglossia, where should I start?

I understand that this must be some kind of table. If I get pointed to the right ones, this task will be easier.

ShreevatsaR
  • 45,428
  • 10
  • 117
  • 149
Masroor
  • 17,842
  • 1
    Have you looked at Polyglossia's gloss-bengali.ldf? That's usually the place to start. Also, contact the author/maintainer. Welsh is much improved as the result of my discussions with him ;). It no longer contains characters which don't exist in the language, for example. (I don't use Polyglossia, but this has also improved Babel's file at least marginally.) – cfr Mar 24 '16 at 02:10
  • @cfr Contacted the current maintainer. Thanks. – Masroor Mar 24 '16 at 02:22
  • For dates, I use a customised datetime file to override the standard one (which is wrong and includes characters which don't exist in the language - this problem pervades all TeX support for Welsh - I guess people all copied Babel's mess). But that's mainly because I use pdfTeX and so can't enjoy the new Polyglossia file. For Polyglossia, I just had to explain what was needed for it to be correct, basically. – cfr Mar 24 '16 at 02:31
  • @cfr At this moment, I am more concerned about numbers. Unless the support it built-in, using references is becoming is nightmare. – Masroor Mar 24 '16 at 02:35
  • I found the developer very helpful and responsive. No doubt Welsh is simpler in some ways (e.g. numerals are no different from English), so it might be a bit more complex. But I'm sure he'll help. – cfr Mar 24 '16 at 02:42
  • 1
    @cfr As we can see, the question is still unanswered. My email to the maintainer has not received any response. Looks like you and I are having a different set of experience. – Masroor Mar 31 '16 at 02:33
  • Sorry about that. I can only really say: well, it seemed worth a try. On the other hand, it is not really that long - especially given that we've had public holidays in between. People may be away or otherwise occupied. – cfr Mar 31 '16 at 02:38
  • 1
    The .ldf file is the place to start. I find Bengali digits for section, page etc are defined now (https://tex.stackexchange.com/questions/246881/how-to-get-section-numbers-and-page-numbers-with-bengali-numerals-in-latex-or-xe/513862#513862) plus also the translated names of the document parts. – Cicada Oct 27 '19 at 10:03

1 Answers1

2

Contributing to the development of polyglossia to add Bengali (Bangla) support is a great idea! To start, you should familiarize yourself with the structure and codebase of the package. Polyglossia's source code can be found on GitHub at https://github.com/reutenauer/polyglossia.

Next, you can look for examples of other languages that are already supported by polyglossia to see how they have been implemented. For example, you can study the code for the Hindi language, which has similar features to Bengali, such as support for numerals and dates.

To add support for Bengali numerals, you will need to create a table that maps the standard Arabic numerals to their Bengali equivalents. You can then modify the existing code for formatting numbers in polyglossia to use this table when rendering Bengali text.

To add support for other language-related areas such as dates, you may need to create new code that can handle the specific features of the Bengali language. This could involve modifying the existing code for handling dates, or creating new functions that can handle Bengali-specific date formatting.

Once you have made these changes, you can submit a pull request to the polyglossia project on GitHub. Be sure to document your changes and explain how they work, and include any relevant test cases to ensure that your changes do not introduce new bugs or regressions.

In sum, here are some steps you can take to get started:

  • Familiarize yourself with the polyglossia package and its code. You can find the source code and documentation on CTAN (https://ctan.org/pkg/polyglossia).

  • Identify the areas where Bengali support is currently incomplete or missing, such as numerals and date formatting.

  • Research the Bengali language and its writing system to understand the specific needs of the language. This will involve understanding the script and its characters, as well as any special rules or conventions related to numerals and dates.

  • Look at other language modules in polyglossia to see how they have implemented support for numerals and dates. This will give you an idea of the types of tables or data structures you may need to create to support Bengali.

  • Start by creating a table or data structure that maps Arabic numerals to their Bengali equivalents. This will be used to replace the default definition of @arabic, allowing polyglossia to correctly typeset numerals in Bengali.

  • Test your changes by creating a simple document in Bengali that includes numerals, such as a list of items with numbered bullets.

  • Once numerals are working correctly, move on to adding support for dates and other language-specific features. This may involve creating additional tables or data structures to handle things like month and day names, or modifying the way certain commands (like \today) are formatted.

  • Finally, submit your changes to the polyglossia maintainers for review and inclusion in a future release.

Keep in mind that this is a complex task and may take some time and effort to complete. However, your contributions will be greatly appreciated by the Bengali-speaking community and the wider LaTeX community as a whole.