Search code examples
asp.netresourceshtml-emailglobalization

htm files as resources in asp.net?


My site is globalized. For email notifications I use an .htm files for the email body. Is there a way I can have a .htm file for each language and call that file based on the culture settings of the browser? I do this for all the strings on the page, but I can't find a way to add a .htm file to a resource set. What's the best way to do this? I really need to translate my website email notifications but am struggling with this.

Any help or a point in the right direction appreciated!


Solution

  • Since .htm files are static files, they cannot be localized. Here is what I do. Instead of using mail.htm, use mail_en-US.htm, mail_tr-TR.htm, etc.

    string file = String.Format("mail_{0}.htm" , Thread.CurrentUICulture);