I have pretty good experience in bilingual web app development, especially in English & Arabic languages. The challenge with switching website page from English to Arabic is not just the content translation, the whole layout needs to be changed and the text direction for all need to be RTL whereas for English it needs to be LTR.
We developed this one app socialboard which aggregates content from social media and displays in a single place. Initially, we focused only on English content so everything in LTR even though some aggregated content was in Arabic. But then we got some clients whose primary language is Arabic. i.e most of the content of their social media was in Arabic.
So we had to do some changes, the UX team prepared the RTL layout for displaying content. The development team had to classify content (i.e to flag them isRTL or not) during creation and use proper layout based on isRTL field value of the content.
To classify, or to check whether the given content language is Arabic or not, we used the following extension method,
/// <summary>
/// To check whether the given string is Arabic.
/// </summary>
/// <param name="input"></param>
/// <returns>Returns True if Arabic</returns>
public static bool IsRtl(this string input)
{
return Regex.IsMatch(input, @"\p{IsArabic}");
}
And it is now part of my Code.Library package ValidationHelper module.
If you know any better way to check if the string is Arabic in C#, let me know in the comments.