radzenhq / radzen-blazor-studio

Sample applications created with Radzen Blazor Studio
https://www.radzen.com/blazor-studio
18 stars 3 forks source link

Text resources can't render by Radzen Blazor Studio #60

Closed koksalbasar closed 1 year ago

koksalbasar commented 2 years ago

Hi Radzen Team,

I'm working with resource files for multi language support. I'm using only one text resource instead of Radzen's multi resource approach. This is much more efficient for repeated words for me.

Picture0

When I add a resource to a label's text in the Radzen, Radzen creates a label and shows the text like this : [Expression]

Sample Code <RadzenGridColumn TItem="ValuraManager.Models.SqlExpress.ApplicationVariable" Property="country" Title="@(Properties.Resources.country_code)">

But the RB Studio can't render the label's text in the same scenario. Picture2

I found an escape path for me that works both the environment. I'm creating constants and then assigning the resource values to the constants while the screen is creating.

DataTypeText = Properties.Resources.data_type; Picture3

I think this concept is working but not efficient.

Thanks for your efforts, KB

akorchev commented 2 years ago

We are starting work on resources and we will try to provide better design time support for that. It would help us however if you send us your app (or a runnable subset of it) so we can make sure your case is supported too.

koksalbasar commented 2 years ago

Hi @akorchev,

I've created a simple project that used resources in two ways. I hope it's enough to explain the issue.

PS.1 Some components such as RequiredValidator was shows the resources text as typed. I added this component also into the project

PS2. Grid columns are not rendered by either Radzen or RB Studio if the resource text is added directly. Radzen even can't render [Expression] text. But the variable method is working on both sides.

RadzenTest1.zip

akorchev commented 2 years ago

We've managed to make this work. Will ship as part of the localization feature.

cultures

koksalbasar commented 2 years ago

Wow. I really appreciated it and was impressed by your thinking method. It's more than I wish.

And a question : Will it work for layouts?

koksalbasar commented 1 year ago

Hi @akorchev ,

The new update really worked for me. It's working smoothly. I was impressed so much.

I've tested many pages and only one failed. This page doesn't return an error. Only a blank page appears on the screen. Radzen can handle the same page. I hope the razor file would be enough to reproduce the error.

AppSurveySetup.zip

akorchev commented 1 year ago

I hope the razor file would be enough to reproduce the error. Unfortunately this won't allow us to reproduce the problem - Radzen Blazor Studio builds the whole application in order to render it in design time hence a single page won't work.

akorchev commented 1 year ago

Does the problem still happen? If yes we will need a complete application to test with.

koksalbasar commented 1 year ago

I'm sorry but still the same after 1.0.2. I'm checking after each update.

akorchev commented 1 year ago

Then we will need to test with your application. You know how to send it to us ;)

koksalbasar commented 1 year ago

I already shared with you a razor file in zip format. If it isn't enough I can prepare a small project and share it with you in zip format or a GitHub address

akorchev commented 1 year ago

Only a complete application will allow us to reproduce that. A single razor file won't work as it usually uses classes from the rest of the app.

koksalbasar commented 1 year ago

Hi @akorchev,

This is a part of my project. I've been started to develop this part when I'm a community user. So this has many spaghetti codes I'm sorry (Don't ask how I generate spaghetti code despite your development environment :) ).

I want to explain a couple of things about this project. Because it allowed me to be very flexible when adding new features to the old project. Without Radzen, it would have taken me more than a year to do this part.

The project uses more than one layout. Some pages are called by this project's menu, some pages are called by my main application's menu and some pages are called directly by the inside of the main application's page. The last two pages group is open inside iframes. This part is working seamlessly with my old project as native pages. I'll start to write the same application from scratch with RBS in January 2023 (without spaghetti codes). This makes me very excited.

I deleted many pages from the project. You need to test AppSurveySetup.razor page. I hope this set is good enough for you.

AppSurveySetup.razor page is shown as blank in RBS. This page is still working in my application without error. I add the screenshots from RS and the real app.

I hope this will help you. Please let me know if you need some additional resources. image image

RadzenTest4.zip

PS. When I deleted files (three files together) sometimes explorer can not refresh itself again.

koksalbasar commented 1 year ago

Hi @akorchev, I figure out what happened.

The visible property of the tab item components is set to false as default. When the page is running which tab item will be shown is decided.

This is an important point while designing. So this type properties must not be false as default while the design process. It can be applied every time? I can't be sure.

akorchev commented 1 year ago

Yes, this is the cause. We are currently looking for a solution how to deal with this.

koksalbasar commented 1 year ago

There is an idea.

Two screen modes may be applied. The first one is Design Mode and the second one is Real Time Mode. A switch can change the views such as language dropdown.

The Real Time Mode is the same as what we are using today.

The Desing Time Mode set all necessary properties to default and maybe you can add some margins between the components such as row and column. This can solve the moving component issue also.

akorchev commented 1 year ago

That's too complex to implement. We have decided to ignore the Visible property for <RadzenTabsItem> and similar for now.

akorchev commented 1 year ago

Closing this issue as the page should no longer look empty.