3

I'm trying to display Arabic Islamic Months in a list box but in English

So that Output Month in Arabic today is ربيع اول

which is in English is November

but what I want is Rabī al-Awwal or just like Microsoft Rabi I like in this link

I have found this question which asks for nearly what i want but in objective-C which I don't understand and can't use , what I need is code in VB.Net or C#

PS: nothing of these lines give me what I want

Console.WriteLine(Now.Date.ToString("MMMM", New CultureInfo("ar-SA")))
Console.WriteLine(Now.Date.ToString("MMMM", New CultureInfo("ar-EG")))  
Console.WriteLine(Now.Date.ToString("MMMM", New CultureInfo("en-US")))
Console.WriteLine(Now.Date.ToString("MMMM", New CultureInfo("en-SA")))

Edit: The Output is

ربيع الأول
نوفمبر
November
November
VB_LOVER
  • 46
  • 6
  • https://learn.microsoft.com/en-us/dotnet/standard/datetime/working-with-calendars?view=netframework-4.7.2 may be of use - it discusses datetimes in different calendars (which I think is what you are talking about here). – Chris Nov 19 '18 at 01:11
  • I already saw this link , but it doesn't have any sample code for what I want , I already wrote sample code and its output that uses cultures but It didn't meet my needs, the only sample that meets my needs is the one I mentioned in my question https://stackoverflow.com/questions/13109905/changing-gregorian-month-and-days-names-to-islamic-nsdate – VB_LOVER Nov 19 '18 at 08:46
  • If i understand you correctly, you are looking for something that provides romanization of Arab words (months). I can't really help you but try searching the web for libraries that do romanization of Arab (it could perhaps be difficult to find free libraries for such purposes, though... –  Nov 19 '18 at 16:40
  • If you can't find any library, you might perhaps want to write your own Arab -> Romanization converter. You could use the Arab character -> Romanization mapping information provided here: http://unicode.org/repos/cldr/trunk/common/transforms/Arabic-Latin.xml (however, i am not sure, if this transformation/mapping table exactly matches the Romanization variant you are after) –  Nov 19 '18 at 16:43
  • I don't want Romanization @elgonzo , all I want is just get english names for arabic lunar months just like this one [link](https://stackoverflow.com/questions/13109905/changing-gregorian-month-and-days-names-to-islamic-nsdate) , but this answer was written in Objective-C, I need similar one in C# or VB.Net that could make use of cultures , calendars and dateformatinfo classes. – VB_LOVER Nov 19 '18 at 18:14
  • I am utterly confused. You seem to want Romanization, yet you don't want Romanization. That's is all i understand. For anyone being able to help you, you would first need to explain how and why "Rabī al-Awwal" wouldn't be Romanization of ربيع الأوّل. –  Nov 19 '18 at 19:38
  • @elgonzo This is certainly beyond me, but I think that OP believes that Romanization is giving "November" rather than "Rabī al-Awwal". I assume that Rabī al-Awwal partially overlaps November this year, but may not overlap it at all in other years. – Blackwood Nov 20 '18 at 03:00
  • 1
    @Blackwood, you might be right. Perhaps OP should look into using `System.Globalization.HijriCalendar` or `System.Globalization.UmAlQuraCalendar`... –  Nov 20 '18 at 14:12
  • @elgonzo did you see this [Question](https://stackoverflow.com/questions/13109905/changing-gregorian-month-and-days-names-to-islamic-nsdate?noredirect=1&lq=1) , if you already did ,do you call this question Romanization ?, I didn't see this word at that question at all and it has already two answers one in objective-C and another one in swift, all I need is another answer in C# or VB.Net and I can customize it to do what I need later. – VB_LOVER Nov 20 '18 at 20:12
  • You yourself wrote that you want "Rabī al-Awwal" in your question. Look at it. Those are not Arab characters, but Latin characters. "R", "a", "b", "i", etc... Using Latin letters to spell words of languages which are not based on Latin alphabet **is** Romanization. Anyway, you might look at my previous comment with regard to (islamic) calendars provided by .NET you might want to look into. –  Nov 21 '18 at 00:57
  • You still didn't answer my question @elgonzo , did you see this (Question)[https://stackoverflow.com/questions/13109905/changing-gregorian-month-and-days-names-to-islamic-nsdate?noredirect=1&lq=1] and it's answers? , for your previous comment I was already there, so that I wrote the sample code in my question which didn't meet my needs and that's what you can get currently from .Net classes unless I'm missing something. – VB_LOVER Nov 21 '18 at 11:48

1 Answers1

-1

You can just do the following:

  • Imports System.Globalization
  • Imports System.Globalization.CultureInfo

    lblMonthAndYear.Text = currentDate.ToString("MMMM, yyyy", New CultureInfo("ar-EG"))

HRM
  • 2,097
  • 6
  • 23
  • 37
  • The result of your code is "أبريل, 2020" which is nearly like my second line in my code snippet whose result was "نوفمبر" , but what I want is "1441, Shaban" when trying to get this result I couldn't get this result using normal codes – VB_LOVER Apr 05 '20 at 13:24