<cite>drcgreece: </cite> Hi Tommy,
Have a look at the following class, it is where the Current Language is being sent to client-side.
<a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Web.Common/Web/Localization/LocalizationScriptManager.cs">https://github.com/aspnetboilerplate/as ... Manager.cs</a>
Then, Abp Framework, on each new Http Request it runs this code:
/// <summary> /// This method is called by ASP.NET system when a request starts. /// </summary> protected virtual void Application_BeginRequest(object sender, EventArgs e) { SetCurrentCulture(); } protected virtual void SetCurrentCulture() { AbpBootstrapper.IocManager.Using<ICurrentCultureSetter>(cultureSetter => cultureSetter.SetCurrentCulture(Context)); }
Hence, once the user changes culture/language, the Cookie is changed on the client side + on every new request, that cookie is read and stored inside the :
Thread.CurrentThread.CurrentCulture = new CultureInfo(language); Thread.CurrentThread.CurrentUICulture = new CultureInfo(language);
That's how I understand it.
Hopefully, Ismail would comment more given his knowledge and experience in this framework.
Regards
Thank you for pointing out the class that does the "trick". :D
Do you know specifically where the GetScript is being called at client side?
I can't understand the second part on how the Thread at client side is set the latest language selection by users.
Hope you are able to explain more...
Thanks, /tommy
<cite>ismcagdas: </cite> Hi,
I think he is talking about this file <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/dev/src/MyCompanyName.AbpZeroTemplate.Web/Views/Layout/_Layout.cshtml">https://github.com/aspnetzero/aspnet-ze ... out.cshtml</a>.
That's correct. The login is still going thru MVC first before switching to SPA.
/tommy
<cite>ismcagdas: </cite> Hi,
It is in our next release v2.1 and I hope it will be out soon probaly in two weeks. Is that ok for you ?
Dear Support,
I would really if you shed light on how the "abp" javascript object is being set during the application startup processing. Especially abp.js, I realized this is where abp.localization properties are set pertaining to languages.
I just couldn't figure out for example, abp.localization.currentLanguage is set. Please kindly advice.
I gathered there is corresponding typescript file, does it have any impact on how these abp is being set?
I realized there are multiple locations that have localization impacts:
Originally, I was thinking to retrieve User Default Language in appSetting.js and then update header.js (vm.currentLanguage) with newly fetched language setting. Now, it seems there are so many factors to consider.
Lastly, it will be great to add in a new control field (Disable) to AbpLanguages table, which will be used to construct the language list being assigned to abp.localization.languages. This way, it will help to control the language selection in both login screen and dropdown.
This is how productive I had been for the day :oops:
Yes. I look forward to the new release in two weeks.
Thanks. /Tommy
This is related to #3152
Hi Bilal,
Using Role assignment is also an interesting approach that does not require individual assignment. However, if the role is too specific, you may end with too many roles at system administration level.
Definitely, it is a possible alternative. Something I will keep in mind.
Thanks. /Tommy
<cite>ismcagdas: </cite> Hi @drcgreece,
As far as I know, the only way for now is using symbolsource. You can check the details here <a class="postlink" href="http://www.symbolsource.org/Public/Home/VisualStudio">http://www.symbolsource.org/Public/Home/VisualStudio</a>.
Thanks.
Sorry guys, pardon my lack of knowledge on this area. Why would you another debug program when it can be done with VS?
P/s: Ismail, think it will be really useful if you would consider some sort of class diagram for abp, abp zero and aspnet zero. Even if charge a nominal fee, I believe people would pay to shorten the learning curve.
Hi
I would suggest the following approach:
Yes, the above involved customising the Account Controlle class file.
/tommy
<cite>tteoh: </cite>
<cite>ismcagdas: </cite> Hi,
You can use Thread.CurrentThread.CurrentUICulture.
Thanks.
Hi Support,
The above is only checking the language of current run-time right?
What about User's current language saved in AbpSettings?
I realized that each time the user select a language other than the system default language, the setting is saved into AbpSettings. However, this setting is NOT loaded and set the UI accordingly, right? (AngularJS template)
Thanks, /tommy
Hi Support,
I found this: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2103#thread-subscription-status">https://github.com/aspnetboilerplate/as ... ion-status</a>
Any chance of releasing a patch? Need it for my current project. Thanks.
/tommy
<cite>ismcagdas: </cite> Hi,
You can use Thread.CurrentThread.CurrentUICulture.
Thanks.
Hi Support,
The above is only checking the language of current run-time right?
What about User's current language saved in AbpSettings?
I realized that each time the user select a language other than the system default language, the setting is saved into AbpSettings. However, this setting is NOT loaded and set the UI accordingly, right? (AngularJS template)
Thanks, /tommy
Hi, I am sure if using role to achieve above is such a good idea.
You probably need to customize a survey assignment table that has a FK to AbpUsers table. From there, you could filter the survey based on Current UserId against the assignments - My Assigned Surveys.
Just wonder if the current data filter class (for tenancy) is a good candidate or just implement the filter as application logic part of survey table/Repository filter.
Perhaps, Support has a better recommendation.
Thanks, /tommy