OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.41k stars 2.39k forks source link

Add ability to test the content item rendering with pseudo-localization #11211

Open xperiandri opened 2 years ago

xperiandri commented 2 years ago

Is your feature request related to a problem? Please describe.

Often developers forget to render some fields from the model

Describe the solution you'd like

A button in the content item editing view near the Preview button that automatically pseudo-localizes the content item and renders a preview. Like https://marketplace.visualstudio.com/items?itemName=MattLaceyLtd.ResourcePseudoLocalizer

Describe alternatives you've considered

An additional pseudo-language in language list and ability to create a localized page in that language with automatic pseudo-localization of all string fields

hishamco commented 2 years ago

I heard about pseudo-localization two weeks ago in ASP.NET Standup meeting, there's nothing wrong with that, but ASP.NET Localization APIs shows the same key if the string is not localized

Backing to your question you should distinguish between static strings that can be localized throught PO files and dynamic data which could be came from files, database and so on. Again this related to data localizations that I need to spend some time on

Thanks

xperiandri commented 2 years ago

My idea is to do an on-the-fly pseudo localization of content items that are passed to a preview page. Because you won't need that elsewhere. And for the strings inside the code, you can do that now. Just the question if it is possible to add a pseudo-language to the CMS languages list.

hishamco commented 2 years ago

Often developers forget to render some fields from the model

Which fields do you mean? I presume the preview page shows a live data for the editing page

hishamco commented 2 years ago

One more thing the Pseudolocalization is useful for testing internationalization aspects of software, but the preview page not necessarly shows a localized view if the content localization module is diable. May be it will be confusing, because me as developer if my website is not localized and click a preview for a certain page, then I saw some alteration on my actual text, I will presume there's something wrong

Please correct me or let me know if I missunderstood you

xperiandri commented 2 years ago

Which fields do you mean? I presume the preview page shows a live data for the editing page

Any content item parts that provide content to UI

xperiandri commented 2 years ago

May be it will be confusing, because me as developer if my website is not localized and click a preview for a certain page, then I saw some alteration on my actual text, I will presume there's something wrong

One more button near to Preview button

hishamco commented 2 years ago

Any content item parts that provide content to UI

If you means the content part or item fields may it make sense, but again I see it's confusing little bit if the content localization module is disabled

We could add it as a feature for content localization module, @sebastienros your thought?

hishamco commented 1 year ago

This might be doable if the text render by liquid or razor