Localizing DevExtreme Extension dxDataGrid

0
0

Hi.

I have to localize a dxDataGrid and for this I am using:

 Application.Eval("DevExpress.localization.locale('pt')"); 

However, nothing changes. I added this line right before I set many dxDataGrid1.Options properties. I also have a this.dxDataGrid1.Update(); right afterwards, but doesn’t seem to help.
Is there anything else I need to take care of in order to get it localized?

Thanks in advance.

Ivan
(Wisej 2.2.46.0, VS 2019, C#)

  • You must to post comments
0
0

Hi Ivan,

I tried

Dim package3 As New Widget.Package
package3.Name = “dx.messages.de.js”
package3.Source = “/Resources/js/DevExpress/localization/dx.messages.de.js”

.Packages.Add(package3)

Application.Eval(“DevExpress.localization.loadMessages(‘de’); DevExpress.localization.locale(‘de’)”)

in the beginning of DXGrid initialize code, but I receive “DevExpress is not defined” error message.

Is it possible by any chance for you to send me small sample code how you get to manage DXGrid localization. It is a big problem for me now?

Many thanks in advance!

If you wish you can contact me directly at: https://www.facebook.com/mariyan.gotsev/

It seems we work in very close scenarios: wisej+devex integration problems 🙂

  • You must to post comments
0
0

Hi there.

I also had many problems getting this to work. Even if you rely on the dxDataGrid set in the Extension itself it doesn’t work well. It goes like that: if you have the dxDataGrid dropped in a Window, the first time you open it, it doesn’t work (DevExpress is not loaded yet). If you close the Window and open again, it works.
Since I didn’t know how to load the DevExpress in the Default.html and it hasn’t been posted any sample on it, I dropped a DevExpress button in my Login Window and used it to Choose the Language. This way, Wisej had to load the DevExpress package and by the time the user gets to the Window with the Grid, it will be already present and it will work. In my case, I load my own .json language file with my own translations and it works this way.
If you don’t get it working I can produce a sample for you tomorrow. Let me know.

Have a great Sunday!

Cheers.

Ivan

  • You must to post comments
0
0

Hi again.

Well, well, well… it is now working. 🙂
Honestly, I “think” I didn’t do anything. I will account it to the Wisej gods working while I slept.

If it helps someone, I am using my own JSON file for pt-br (Português Brasil), which you can download from a DevExpress Github repository, then loading it right before showing the grid:


            string lcDictionary = File.ReadAllText(Application.MapPath("App_Data/DevExtremeLocalization/pt-br.json"));
            string lcEval = "DevExpress.localization.loadMessages(" + lcDictionary + ")";
            Application.Eval(lcEval);
            Application.Eval("DevExpress.localization.locale('pt-br')");
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.