Closed Maskoe closed 1 month ago
Very good suggestion !
Hey @Maskoe, sounds like a great improvement. I am currently on vacation. I'll try to find time afterwards and see if I can incorporate your suggestion. Please don't be angry if it takes longer.
Best regards mMilk
I am constantly getting
The type or namespace name 'Locales' does not exist in the namespace 'LocTest' (are you missing an assembly reference?)
If I copy the generated class into my project and disable your source generator, it works. I can also import the namespace just fine. It just wont let me build for some reason.
I got it to work once, but I have no idea what I did. I tried different projects, solutions, setting namespace and class name manually, restarting rider 10 times.
I also have this warning in my console
0>CSC: Warning CS9057 : The analyzer assembly 'C:\Users\Mirco\.nuget\packages\kli.localize\1.0.4\analyzers\dotnet\cs\kli.Localize.Generator.dll' references version '4.11.0.0' of the compiler, which is newer than the currently running version '4.9.0.0'.
using LocTest.Locales;
namespace LocTest;
public class Testtt
{
public void DoSomething()
{
var msg = T.Uppercase;
Console.WriteLine(msg);
}
}
Edit: Ahh found the difference.
If I turn on <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
in version 1.0.4 nothing happens.
If I turn it on on version 0.8.x I see my files in obj/debug/net8.0/generated
@Maskoe, thanks for your feedback, i will have a look
@Maskoe, I have reset the expected compiler/sdk dependencies. I hope this helps you for now => v1.0.6
Yea works for me now. Its awesome.
Thats pretty much how every i18n library in the javascript world does it.
Was it a bug in your code or was it the weird compiler version thing?
I'm glad to hear that it works. I'm still not 100% sure what is causing the problem. It is under investigation :)
If you think the issue is resolved - feel free to close it.
best regards mMilk
Hello, very cool library.
I would like to have just one Locale.json file per language. I would structure it like this
Messages/T.json
I would like that to lead to
Is that doable? If you dont want to do it, can you point me in a direction so I can give it a try? Obviously while at it, it should probably work with any level of nesting. So I can really go ham and do
T.Errors.CreateUser.InvalidRole
.