Localizing custom module views

Topics: Localization, Writing modules
Oct 4, 2011 at 4:33 PM

Do you have to do anything special to localize views in a custom module? (just a view corresponding an action on a controller)
The translation file doesn't seem to be loaded.

What i know so far:

  • Localizing views coming from a custom handler (widget) works
  • Localizing my custom theme works
  • The translation manager was able to extract the default translation for the view, but when I place the "orchard.module.po" file in the folder "<module>/App_Data/Localization/nl-BE" folder and modify it, nothing happens. (same approach for the widget and theme worked)

Any suggestions?

Oct 4, 2011 at 8:03 PM

Is this on 1.3? (we fixed a bug with alternate templates and translations)

Oct 5, 2011 at 6:19 AM

Nope, version 1.2. I'll try to update to version 1.3 today and let you know if it solves the problem :)

Oct 5, 2011 at 4:40 PM

I followed the steps on http://orchardproject.net/docs/Upgrading-a-site-to-a-new-version-of-Orchard.ashx (upgrade in place)

When I try to login in the admin (or try to view the front, doesn't matter) after the copy, I get the following error in the module HtmlField (module from the gallery): http://orchardproject.net/docs/Upgrading-a-site-to-a-new-version-of-Orchard.ashx  

What's happening? :)

Oct 5, 2011 at 7:51 PM

Can't see that error, you included the same link twice. Did you try to contact the author of that module?

Oct 5, 2011 at 8:10 PM
Edited Oct 5, 2011 at 8:10 PM

Oops. this is the error: http://www.screencast.com/t/YiWUCRyX

Did not try to contact the module creator. Wanted to hear your thoughts first :)

Oct 5, 2011 at 8:25 PM

Apparently this module has a problem with 1.3. You should contact the author.

Oct 6, 2011 at 9:15 AM

I have had a brief look and see there is a breaking change in Orchard 1.3

Orchard < 1.3

    public interface IHtmlFilter : IDependency {
        string ProcessContent(string text);


Orchard 1.3

    public interface IHtmlFilter : IDependency {
        string ProcessContent(string text, string flavor);

I have updated the code to work with orchard 1.3 and uploaded a new version to the gallery, it is not showing up yet but hopefully will show up soon.


Oct 9, 2011 at 11:21 AM

After installing the new version of HtmlField (thanks to the quick reaction of jrmurdoch!) and succesfully updating to orchard 1.3, the localization now works!

Thanks for the help guys!