Translation, translator, advantages

Jan 27, 2010 at 7:24 AM

There is no difference between standard "resource" functionality (expression builder, $Resources:)  and catharsis,
except  "self" special code, which needs time to "understand it".
For you information contains resource provider/manager, resource manager factory, you can "write"
self resource manager to get localized results.

But resources has serious problem:  it is to difficult to find resource item by translated text (it is difficult to show extra button "edit", -
to provide clear, user friendly way to edit resource data,text etc)

Previously i am wishful thinking about advantages of the Catharsis, but now i see nothing special, except "good" OOP model.
there is lot of work to do in it, but idea|core is perfect.

hope you will improve following things:
          - translation: should be possible to edit "resource:text, image etc" right from the page (now we should to find "text" in list, which is not user friendly)
          - automatically/manually forms generation:
                 it is to simple to generate forms to overview, edit table data, which contains 3 fields. But to prepare more detail forms - it takes time.
                 so, should exists way(wizard) to generate forms with more then 3 fields or to "extend" existing codebase(persistents) with additional fields
          - DynamicData has way (trough class attributes) to works with fields tamplates, so in result we could siple provide way to show "html editor" instead textarea, or datatime picker or other very firiendly "elements". As for developers, which i works with,  good approach to have tamplates to show edit,detail forms content.

kindest regards, Anatoliy




Jan 27, 2010 at 8:33 AM

Hi Anatoliy

There are significant differences among ASP.NET standard localization and Catharsis implementation.

First of all, you have an extension method .GetLocalized available on any string on any layer. That mean, that even if you are exporting stuff you can do it with localized phrases, immediatelly (think about accessing the ASP.NET Globalization manager)

Secondly, the ASP.NET standard is simply not working in the OOP which is implemented in Catharsis. If you'd like to reuse some control which is filled once with the entity A and secondly with entity B you cannot localized it differently. You are provided with the key  (e.g. $resource ) and than some totaly meaningless path "Controls/MyControl.ascx".

Next reason is the smart default language bubbling (Not found expression is provided in the closest culture or the default if not found)

In this ASP.NET world you will stay rigid, because of the WebForm world approach (do localizing for webForm 'definition-site' , not for the use-site (entity) - horrible)

Other point of view, is possiblility to change localized phrases in the runtime, in production. Unless you deploy your first application in production you probably won't understand. You will think that .rescx files are good enough... but you will see.

And also, the Catharsis Localizing engine is also implemented as the ASP.NET Resource provider! So what are you talking about? you can use it as the ASP.NET standard approach

<globalization enableClientBasedCulture="true"
              resourceProviderFactoryType="Firm.Example.Common.Providers.LocalizedResourceFactory, Firm.Example.Common"....

Finally, the Catharsis is designed to provide as much as possible to be ready to cover your needs.

BUT: you are not forced to use the built in stuff. DO IT YOUR-SELF. Find your own way. You simply havet to implement this to meet your needs. And than share it with us. In fact, that is the purpose of our Open Source approach.


Enjoy your way of using Catharsis

Radim Köhler

NOTE: What is hard to understand on the .GetLocalized() extension method? Why it took some time for you to understand it?

Jan 27, 2010 at 9:20 AM

Hi Radim, thanks for the so fast answer

Strange, but i am agree with you :)
so, i haven't checked generated code so well, Catharsis contains standard ASP.Net resource manager.

but my point of view: this kind of functionality is not so well,
it is hard to find "text" which you want ot change in the list "Translator".
Curently there are 2-3 different types of data to edit, 
and already several pages with content to translate.

Let look on the situation when administrator of the site want to change one word|sign in the sentence.
if he has experience in Catharsis he will use "search filter" and filter "big" table to 5-10 rows, find resource
which looks like correct and change this(if not -admin will spend more time to page by page look on resources and
search right resource row). In any cases "it is time" and "actions". So we have to have "smart" administrator,
with an expirience.

Most popular systems with dynamic "text|image" resources in edit mode show button "edit" which provide possibility of automatically opens "edit" form of the current resource.

yes, you can implement searching content by resource key, area but it is not so simple.

So, there are problems in "resource localization functionality". That is why, as for me, this kind of way / localization  was death from the begining, it is too complicated...

Kindest regards, anatoliy

Jan 27, 2010 at 9:58 AM

Hi again, Anatoliy.

I would like to give us some conclusion. If your application needs the Localization (and from my point of view it is always - 'FirstName' should be 'First name' for the user even if only English is used) you have to decide which way to go.

Catharsis implementation is not forcing you in any way. You can use standard ASP.NET localization with .rescx if you like it. The syntax of the 1) $resources and 2) metaKey="key"... is also supported (It is so so long time ago I did use it...).

If you prefere to profit from the adavantages of the MVC (as the design pattern) and OOP then the Catharsis framework has something more for you:

Create the contract (IModel) which expects some strings, numbers, Entities

Fill that contract in the Controller-Action. And do decide (if it is suitable) that you will localize the 'contracted' strings here - on the Controllre-Action layer. That will allow you to fill the contract (IModel) and be the Master of the provided result. For instance - to localize headers of the exported MS Excel sheet - this is not thebest but also the only place where to do it.

On the UI layer use passed data (filled in the IModel contract) . If this is the general Control - e.g. the List View - render the strings as was provided in the contract (based on the agreement: localized or as the keys to be localized). In specific cases, e.g. you are on the DetailWC of your entity - call localization there (no need to generalize).

In runtime - for administrators, the localization infrastructure allowes to search not only the keys, but even in the 'localized' phrases. so, if the 'First name' should be changed to the 'Name', it is possible to search with the localized phrase 'First name' instead of the key 'FirstName'.

And that, from our experience (based on currently 3 projects running in the production!!!) is very very user Friendly.


One important note to the Catharsis List View control. I would say that this is absolutelly unique control (which I did not ever met before...) You are not declaring the <gridView> elements and Binding them as in the ASP.NET web forms world for every entity.

List View si the real MVC control. There is a contract: IListModel. You are filling it completely in the Controller-Action-List -> result is then rendered without any other declarations, and Localized. That is really lot of time saving not only during development, but mostly in the maintainance.

ListView is powerful control, adjustable on the Controller layer, by switching the IListModel properties - including localization. This is in the ASP.NET web form world unthinkable, and with the .rescx files very complicated task.

Anatoliy, I am not sure if I am talking about stuff you'd like to talk. About your suggestions which are suitable  for you (in comparison with the Catharsis implementation). Please, if my answers are still not clear, do not hesitate to give use some example how it should be done. Maybe your Idea is functional and can move us forward.

And thanks for your time - to write these notes.

Enjoy Catharsis, and have the working localization...

Radim Köhler

PS: there is another fundamental extension provided by the Catharsis framework, which is missing in Microsoft System.Web and System.Web.Mvc libraries.

If the user changes the (in runtime appended) culture, he/she can intaract with textboxes in his/her native format: e.g. 12/31/2010 or 31.12.2010. This culture is then correctly used for binding, and the Dates and Numbers are correctly transformed and bounded.

Such functionality is in ASP.NET web forms and even mvc NOT WORKING at all (for instance Czech culture thousand separators are broken)

This is another brutal plus for the Catharsis built-in localization extending (see the .ToDisplay() extension method)...


Jan 27, 2010 at 10:21 AM

Hi Radim.

Localization has been discussed enough.
Thanks for that quick and detail explanations.


What about next versions of the Catharsis.

Where I can look on “features” which will comes soon?

regards, Anatoliy

Jan 27, 2010 at 10:29 AM

Hi Anatoliy

Well, at this moment I am working (better I would like to work) on some more detailed documentation, how to...

So untill there will be some handy tool for publishing, there won't be any list of coming features...


But in general, the mayor extension points of the next Catharsis release should be:

1) Wiki parser, wiki documents publishing support

2) Reduction of the string constant usage, due to the Expression trees

Both parts will bring lot of new abilities, but will also require some learning - and documentation I know ... :)


So, we will see

Enjoy Catharsis

Radim Köhler


Jan 27, 2010 at 10:37 AM

Thanks Radim,

Good to know that.

Regards, Anatoliy