This project is read-only.

Localizing custom module views

Topics: Localization, Writing modules
Oct 4, 2011 at 5: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 9:03 PM

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

Oct 5, 2011 at 7: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 5:40 PM

I followed the steps on (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):  

What's happening? :)

Oct 5, 2011 at 8: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 9:10 PM
Edited Oct 5, 2011 at 9:10 PM

Oops. this is the error:

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

Oct 5, 2011 at 9:25 PM

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

Oct 6, 2011 at 10: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 12:21 PM

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!