How to access the BO library resource file from the UI project?

How to access the BO library resource file from the UI project?

Old forum URL: forums.lhotka.net/forums/t/3874.aspx


stefan posted on Friday, November 09, 2007

I want to customize my WinForm GUI.

In my EditCustomerForm I have a label on top that I want to state the text:
"Customer: " + mcustomer.Name
Actually I don't want it to display "Customer" but "Kunde" which is the german translation.
My BO-library-project comes with a resource file providing all the translations necessary for my
customer business object. If I could just access the library resources from within the GUI project.

Are there any best practices?
Basically it sounds like a standard localization issue...

One idea I have is having my BOs provide a reference to its library's ResourceManager.
That should work, but is it the BO's responsibility to provide a link to the translations of its property names?

What have others done?

Stefan




stefan replied on Wednesday, November 14, 2007

Any ideas?

I just want to keep the BO-specific resource strings in one place and be able
to easily access them from any UI...

Pleeeaaase...

Stefan

ajj3085 replied on Wednesday, November 14, 2007

Doesn't sound like it's the BO's responsibility.  I suppose making the Resources class public could work.. but then you risk breaking any clients if you change resource names.

DavidDilworth replied on Friday, November 16, 2007

Have you considered using a BO to get the resources you need from the file.  You give it a series of keys and it gets the required values.

It's a specialist kind of BO, as it doesn't hit the DB.  But it obviously needs access to the code on the App Server.

It's a TranslationService or LocalizationService BO.

Copyright (c) Marimer LLC