- ABP Framework version: v8.0.2
- UI Type: MVC
- Database System: EF Core (SQL Server )
- Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
- Exception message and full stack trace:
- Steps to reproduce the issue:
- i would like to ask about when i change language in abp application in at runtime to arabic gets error of my entity
- because decimal field has comma separator ? any advice to make common solution
- the following image clarify the error and display in English like "The field should be numeric from 0 to 99999"
7 Answer(s)
-
0
hi
Can you check this first? https://abp.io/support/questions/4102/error-in-fraction-point-in-arabic-language
-
0
Thank you for quickly response : and it is working with me after but this line System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; in webModule but there is another error because i use this line in my services var cultureName = CultureInfo.CurrentCulture.Name; and check if cultureName =='ar' do somthing, but now this variable cultureName gives me empty string , could you please advice .
-
0
hi
Please share some of your code.
-
0
this sample of code to get data according to selected culture //====================================================== var cultureName= CultureInfo.CurrentCulture.Name; var dbContext = await GetDbContextAsync();
var result = (await GetDbSetAsync()) .Join(dbContext.Set<JournalVoucherStatusCulture>(), journalStatus => journalStatus.Id, journalStatusCulture => journalStatusCulture.VoucherStatusId, (journalStatus, journalStatusCulture) => new { journalStatus, journalStatusCulture }) .Where(a => a.journalStatus.JournalStatusTitle.Contains(fiscalYearStatusTitle) && a.journalStatusCulture.CultureId == cultureName) .Select(x => new JournalStatusCul { Id = x.journalStatus.Id, JournalStatusTitle = x.journalStatusCulture.JournalStatusTitle != null ? x.journalStatusCulture.JournalStatusTitle : x.journalStatus.JournalStatusTitle });
-
0
hi
Can you try this?
app.Use(async (httpContext, next) => { if (System.Threading.Thread.CurrentThread.CurrentCulture.Name == "ar") { using (CultureHelper.Use(System.Globalization.CultureInfo.InvariantCulture, System.Globalization.CultureInfo.InvariantCulture)) { await next(httpContext); } } else { await next(httpContext); } });
-
0
-
0
hi
I see.
Can you try these two solutions?
1.
http://blog.rebuildall.net/2011/03/02/jQuery_validate_and_the_comma_decimal_separator
2.
https://github.com/dotnet/aspnetcore/issues/6566#issuecomment-1213584906