Hi,
I found the code part that fails when the language is Turkish.
The problem can be generated as follows:
- "ConfigurationDataId" column in dashCommerce_Core_ConfigurationData
table is named as "configurationdataid" in SubSonic table schema which
is formed when the culture is English.
- In Application_PreRequestHandlerExecute (Global.asax.cs), System.Threading.Thread.CurrentThread.CurrentCulture and System.Threading.Thread.CurrentThread.CurrentUICulture is set to Turkish.
- Function below cannot work properly because when "ConfigurationDataId" is lowered during HTTP Request, columnName becomes "configurationdataıd" according to Turkish upper/lowercasing rules, which is different than the one in SubSonic table schema.
public void SetValue(string columnName, object oVal)
{
columnName = columnName.ToLower(); //EK: Why is this necessary? This method is the only place where ColumnName is set.
if(!Contains(columnName))
{
Add(new TableColumnSetting(columnName, oVal));
}
else
{
this[columnName].CurrentValue = oVal;
}
}
I do not understand the reason why column names are lowered in Subsonic. One reason may be to help -especially Pascal or Visual Basic oriented- programmers that do not write column names int the same way they are coded in database.
For a shortcut patch, I replaced each string.ToLower() function to string.ToLower(System.Globalization.CultureInfo.InvariantCulture) in TableSchema.cs in SubSonic project where the above code is now:
columnName = columnName.ToLower(System.Globalization.CultureInfo.InvariantCulture); //EK: Why is this necessary? This method is the only place where ColumnName is set.
The patch seems to work but I am not sure about the side effects.
During the analysis of this situation, I come to a conclusion that SubSonic -therefore dashCommerce- is not 100% Turkish compliant as most of the string related codes in SubSonic (such as Regular expresions for ALPHA, LOWERCASE constants,string validator functions) does not take local alphabets and .NET's CurrentCulture into account. For example in Constants.cs (SubSonic) ALPHA is coded as
public const string ALPHA = "[^a-zA-Z]";
However Turkish version should be
public const string ALPHA = "[^a-zA-ZçğıöşüÇĞİÖŞÜ]";
I think the same problems may arise for other languages such as German.