Language Table

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/21/2009 7:46:02 AM
Gravatar
Total Posts 8

Language Table

Hi,

we are starting to use mojoportal as a framework to develop a custom feature related to document management.

Our purpose is basically to show lists of documents and permit to authenticated users to manage these objects (search, edit, delete, and so on).

In this particular context, translations of the static content (labels, buttons, titles, help, ...) are a very important theme; for this reason, we focused on the possibility to "force" the authenticated users to select between languages actually supported on the site (in other words, between languages for which exists a complete and verified translation of the variuos items).

In order to make some tests (trying to alter mojoportal core as little as possible), we acted as follows:

1) added in mojoprofile.config a custom field used to manage the User's Preferred Language; the user can choose between some "active" languages (cultures) fixed in the "optionlist" of the field definition.
1) added a new custom key in web.config file (or in user.config), used to ebable/disable Culture override with the user's preferred language.
3) added some custom code in culturehelperhttpmodule.cs (and other few parts), that override the page culture (only if the user is authenticated, the override feature is enabled in web.config or user.config files, and there is a preferred
culture code in the user's profile).

The trick worked, but we realized that we need to implement a more "sophisticated" system to achieve other purposes.

In particular, we need to define "active" languages by means of a table instead of a static list in the mojoprofile.config file (for instance, to guide the administrative users in compiling our core data tables, in which they have to register the item description in the various "active" languages).

At this point, we noticed that in mojoportal DB there is already a table named dbo.mp_language (with a corresponding "hidden" administration page that is not included in the core data management menu).

So, please, could you explain the purpose of the standard language table? Is it something related to the webstore module for managing a requirement similar to our?

Thanks in advance, and please pardon my English

p.s.: Did anyone showed the need for a few additional security features related to privacy, like "user account expiration date", "force password change at the next login", "block user if he did not login in the last xx months"?

 

7/23/2009 7:36:15 AM
Gravatar
Total Posts 8

Re: Language Table

After my initial submission, I have searched again in mojoportal site, and I found the dbo.mp_language table quoted in an article named "Coming Soon - The mojoPortal Store" by Joe Audette:

"I've been doing a lot of re-factoring in the WebStore to get the re-usable pieces built into mojoPortal core so they can be used across features. For example, Country List, State List, Currency List, Language List and their administrative features were originally in the WebStore projects but I've moved them into the core of mojoPortal because they will be needed by other features."

Unfortunately I was not able to find other documentation, and the table seems not to be actually used in mojoportal 2.3.10 (except for its "hidden" administration page).

Please, does anyone know what is this table intended for?

Thanks again

 

7/23/2009 8:00:36 AM
Gravatar
Total Posts 18439

Re: Language Table

Hi,

You are right that the language table is not currently being used. There exist business classes db classes and an admin page to manage languages in the table but it is not linked into the menu because we are not currently using it.

Early on in the webstore I started out trying to implement multipole languages in the store with translations for products descriptions etc but it was really making the system way too complex and no other features in mojoPortal work this way so I decided to back out that complexity. I may use it later to allow specifying a single language on a store, but generally I recommend different but related sites for supporting multiple languages.

Its possible to implement a language switcher, see the listingfor TEAK on our consulting page, they have a link to an example site where they implemented this: http://www.bsquare.com/

I recommend make no changes to mojoPortal code at all. You can implement your own culture helper http module and comment out ours in Web.config modules sections and add your own custom one.

Hope it helps,

Joe

7/23/2009 10:10:51 AM
Gravatar
Total Posts 8

Re: Language Table

Hi Joe,

thanks a lot for your help!

We did not realized that there was a way to build a custom culture helper http module and to point to it simply editing the we.config file; the other changes to the core that we made during our test (necessary to read the custom key added to web.config file to enable/disable our feature) are useless, since pointing to our custom culture helper http module already expresses the will to use our custom feature.

The new field in the user's profile is managed through the standard  mojoprofile file, so no changes to mojoportal core are required (luckily, since we are aware that touching the core is not a brilliant idea  ).

Just a clarification: we have to create our custom class in the web/components folder (and therefore recompile it in the core dll), or act in a way similar to the one described in the "User Sign In Event Handlers " article?

Regarding to dbo.mp_language table, it seems that your initial intention was quite equal to our: implement a system for having multiple translation of particular DB fields, mainly the "description" of the item;personally, we took the idea of the "active" languages from Dotnetnuke, and of a nice user interface to manage items descriptions from a DNN open source ecommerce module called NevoWeb Store (or NB Store).

As I can understand, the dbo.mp_language table is actually "under development" (and that it might change depending on the development of the web store module): in this case, probably it is better that we implement a similar custom table (with culture entire codes, rather than the first two letters of the language), waiting for possible future implementation in mojoportal standard table.

Thanks again

Riccardo

 

7/23/2009 10:25:13 AM
Gravatar
Total Posts 18439

Re: Language Table

Hi Riccardo,

You can implement your custom culture helper http module as a separate class library in its own dll, you specify the type and assembly name (without the .dll extension) in the config entry. Use a post build event to copy your dll up to the Web/bin

Yes, you are probably wise to implement your own language stuff for the reasons you mention, it may change later.

Best,

Joe

7/24/2009 6:31:08 AM
Gravatar
Total Posts 8

Re: Language Table

Hi Joe,

your hint about the implementation of our custom culture helper http module has been very useful, and the solution worked perfectly.

Mojoportal is a great product, and you are very kind and patient.

Thanks a lot again for your help

Riccardo

You must sign in to post in the forums. This thread is closed to new posts.