Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Any way to easily localize indicators ?
Collapse
X
-
Tags: None
-
Hello,
Thank you for the post.
I tried the linked sample and exporting as a compiled assembly, I do see that the resource is inside of the assembly and was able to be used after restarting the platform.
Are you currently developing the .resx in visual studio? If so, please ensure that the note from the other post is not being overwritten when you resave in visual studio. That is a final step before NinjaTrader can utilize the file.
If you cannot see your custom file work, I would likely suggest checking if you can import the item from the other post and export it as compiled and see it work. If so, you could compare your current logic and syntax to see where they may differ. I did note that I had to extract the other file as it was created in the beta phase so you would need to manually import the item if you had not already.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
-
Hi Jesse,
Thanks for the answer
I copied the SampleAddon.zip in my Addon folder, compiled OK, then exported.
In dotpeek, you can see the designer class being added (it's a .cs so it's compiled), but the ressource file is not embedded, resources are only the standard Custom resources.
This is what you were writing in previous post ("Unfortunately, this would still not be of value. Although it works to use the resource, you currently can not export resources as source or compiled assembly.")
Everything works ok in VS (compiles and embed resource in dll) but
* How are you able to develop indicators? you can't use F5 anymore in NT since the resource files are not embedded, so Indicators lose their names and are not usable
* How to you encrypt using Agile.Net ?
* Even is all the previous works, how to you deliver the language files (the fr-fr, de-de etc subfolders) I tried putting the subfolders and resource dlls in the zip file but they are not copied when importing the zip files.
Thanks
Edit : added picLast edited by gomifromparis; 02-16-2018, 10:35 AM.
Comment
-
Hello,
Thank you for the reply.
I can see the other sample working on my end and do see that the .resx file was included in the assembly and is usable. I would be uncertain of the image you provided but would suggest instead using the platform to confirm if the resource can or cannot be found. You do need to mirror that other post if you are trying to recreate the same usage of including a resx file. Using custom resource names will likely not work, instead, you would need to use the syntax listed in the other post to correct the designer.cs file, and use the names listed in that sample.
Regarding the note I had posted, that would still apply for custom named resources but after testing I do see that the result of exporting a compiled assembly has changed since the beta when this was originally brought up.
Regarding developing indicators
How are you able to develop indicators? you can't use F5 anymore in NT since the resource files are not embedded, so Indicators lose their names and are not usable
If you are referring to VS and its build command, that was never suggested or supported in contrast to NinjaTrader. Visual Studio can be used as a complimentary syntax editor to NinjaTrader but was never intended to do any building. You should use the platform to complete any compile or check for errors. In NT8 there is a addon sample that demonstrates building from a separate visual studio project which in turn builds a separate dll. This does require that you restart the platform to see changes.
How to you encrypt using Agile.Net
If you are using an external visual studio project to produce a dll, you would need to use the agile.net application to protect that dll like any other .net dll. This is considered an advanced developer task and you would need to consult the agile.net documentation for further instructions in that process. You would also need to test that the resulting dll can be imported and used in the platform if you are using an external dll project.
Even is all the previous works, how to you deliver the language files (the fr-fr, de-de etc subfolders) I tried putting the subfolders and resource dlls in the zip file but they are not copied when importing the zip files
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Jesse View PostUnfortunately, this would be outside of the scope of the sample that was previously linked. The other sample was not targeted at localization but resource utilization. I would likely need to see if this is currently possible and reply back on that when I have more details.
Comment
-
Just wanted to confirm that yes, after doing the modifications, I can see the html in the exported resource dll, so embedding the default language strings will work. Now question is how to deal with the additional languagesLast edited by gomifromparis; 02-16-2018, 11:16 AM.
Comment
-
I was able to embed a resource with strings, but when I use a multi-file resx, for instance MyResource.resx and MyResource.fr.resx, I get only one of them to be merged in the dll resource.
Comment
-
Hello,
Thank you for the reply and confirming that for me.
After further inspection, I do see that the other sample also works for localization you just need to make sure to name the files correctly like they are in the existing NinjaTrader resource files.
MyResource.fr.resx is not a valid name but MyResource.fr-FR.resx would be. You can see the existing localization .resx files for examples of the correct names.
Changing the code in the sample from the other page in the .resx file, I can see changes when I change the NT language in the options and restart.
I did note that only the English is included in a compiled assembly so I will need to research if this would be expected or if the platform should include the separate files in exports as well.
I look forward to being of further assistance.Last edited by NinjaTrader_Jesse; 02-16-2018, 01:34 PM.JesseNinjaTrader Customer Service
Comment
-
Hello,
I just wanted to reply back on this item.
It would seem that although the compiler does take into account the single .resx file, it will not for multi part resx files. Development suggested avoiding using this type of localization in NinjaScript exports as it is not currently supported. It would instead be advised to use the Language selection in the options to delegate what you can, I understand properties and attributes cannot be controlled in this way.
Code:Print(NinjaTrader.Core.Globals.GeneralOptions.Language.ToString());
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by PaulMohn, Today, 03:49 AM
|
0 responses
7 views
0 likes
|
Last Post
by PaulMohn
Today, 03:49 AM
|
||
Started by inanazsocial, Today, 01:15 AM
|
1 response
9 views
0 likes
|
Last Post Today, 02:18 AM | ||
Started by rocketman7, Today, 02:12 AM
|
0 responses
10 views
0 likes
|
Last Post
by rocketman7
Today, 02:12 AM
|
||
Started by dustydbayer, Today, 01:59 AM
|
0 responses
4 views
0 likes
|
Last Post
by dustydbayer
Today, 01:59 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
5 responses
23 views
0 likes
|
Last Post Today, 12:32 AM |
Comment