I’m trying to translate a table “RoomType”.
I create a “Texts” table that contains:
Id, LangID, TranslatedText
001, EN, Single
001, IT, Singola
002, EN, Double
002, IT, Doppia
This is the DB Schema

The table RoomType contains:
ID, TextID, MaxBed
01, 001, 1
02, 002, 2
I need to create an nHibernate Mapping that join RoomType and Text and permit to load RoomType queing Text with WHERE clause on LandID = CurrentLanguage.
This is a little mapping but I do not know how I can go next:
public class RoomTypeaMap : ClassMapping<RoomType>
{
public RoomTypeaMap()
{
Join("Texts", el =>
{
el.Key(k => k.Column("TextID"));
});
}
}
As an alternative I can add a column for every language

In this scenario I need that the mapping Gets the localized name of the roomtype from and (preferring) to different column.
Something like this:
public class RoomTypeaMap : ClassMapping<RoomType>
{
public RoomTypeaMap()
{
Property(el => el.Name, m =>
{
m.Formula("Name_" + currentLanguage);
});
}
}
I found this interesting post but it not help me:
http://nhforge.org/wikis/howtonh/localization-techniques.aspx
Thank You for your help!!
i would get rid of the language table and have the Texts table as Element table for a map
and use the folling Mapping
Update:
to implement the fallback