New Localization module realized

Topics: Announcements, Localization
May 3 at 9:08 PM
Edited May 3 at 9:08 PM
Due to pbs in Orchard.CulturePicker and RM.Localization I wrote my own solution, you may find the code here
https://bitbucket.org/csurieux/datwendo.localization/overview

I used an ActionFilter to fix the 'home Page dilemma' which is more elegant than the controller solution in the previous modules.
I also added a Content Culture selector, working independently from browser and cookie traditional selectors.
And a menu item to insert culture choices as menu items.
Thanks for feedback.
May 5 at 5:41 PM
Edited May 5 at 6:41 PM
Compilling is without errors...

When I try to use widget Cookie Culture Picker I got this :
Server Error in '/' Application.

The partial view 'EditorTemplates/Parts.CookieCulturePicker.Edit' was not found or no view engine supports the 

searched locations. The following locations were searched:
...
~/Modules/Datwendo.Localization/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
...
but this file is exist in your project:
Datwendo.Localization/Views/EditorTemplates/Parts/CookieCulturePicker.Edit.cshtml

RM.Localization run from first time for me.


Orchard 1.81
May 5 at 6:15 PM
2014-05-05 21:01:14,282 [42] Orchard.Exceptions.DefaultExceptionPolicy - Default - An unexpected exception was caught
https://localhost:44300/Admin/Widgets/AddWidget?layerId=3&widgetType=CookieCulturePicker&zone=AsideSecond&returnUrl=%2FAdmin%2FWidgets System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The partial view 'EditorTemplates/Parts.CookieCulturePicker.Edit' was not found or no view engine supports the searched locations. The following locations were searched:
~/Themes/TheAdmin/Views/Orchard.Widgets/admin/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Themes/TheAdmin/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Themes/RestaurantTheme01/Views/Orchard.Widgets/admin/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Themes/RestaurantTheme01/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Themes/TheThemeMachine/Views/Orchard.Widgets/admin/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Themes/TheThemeMachine/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Orchard.Widgets/Views/admin/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Widgets/Views/admin/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Themes/Orchard.Widgets/Views/admin/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Reports/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Dashboard/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Vandelay.Industries/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Upgrade/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/TinyMce/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/RussianSlug/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Templates/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Taxonomies/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Tags/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Scripting/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Recipes/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Projections/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Pages/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Packaging/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Modules/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Migrations/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Localization/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Lists/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Containers/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.JobsQueue/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.ImportExport/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.ImageEditor/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.DesignerTools/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.CustomForms/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.ContentTypes/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Comments/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.CodeGeneration/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.ContentPicker/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Contents/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Blogs/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Shapes/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Navigation/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Feeds/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.TaskLease/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.MediaLibrary/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Title/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.MediaProcessing/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.OutputCache/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Scheduling/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Alias/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Roles/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Users/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Workflows/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Forms/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.SecureSocketsLayer/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Fields/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.jQuery/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/NGM.Forum/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Markdown/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Common/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Lucene/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Ipertrade.CultureLayer/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Widgets/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Themes/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Datwendo.Localization/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Search/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Indexing/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Core/Settings/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Autoroute/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
~/Modules/Orchard.Tokens/Views/EditorTemplates/Parts.CookieCulturePicker.Edit.cshtml
May 5 at 6:16 PM
at System.Web.Mvc.HtmlHelper.FindPartialView(ViewContext viewContext, String partialViewName, ViewEngineCollection viewEngineCollection)
at System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection)
at System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper htmlHelper, String partialViewName)
at Orchard.Core.Shapes.CoreShapes.RenderInternal(HtmlHelper Html, TextWriter Output, String TemplateName, Object Model, String Prefix) in ~\src\Orchard.Web\Core\Shapes\CoreShapes.cs:line 755
at Orchard.Core.Shapes.CoreShapes.EditorTemplate(HtmlHelper Html, TextWriter Output, String TemplateName, Object Model, String Prefix) in ~\src\Orchard.Web\Core\Shapes\CoreShapes.cs:line 743
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy.ShapeAttributeBindingStrategy.PerformInvoke(DisplayContext displayContext, MethodInfo methodInfo, Object serviceInstance) in ~\src\Orchard\DisplayManagement\Descriptors\ShapeAttributeStrategy\ShapeAttributeBindingStrategy.cs:line 64
at Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy.ShapeAttributeBindingStrategy.<>c__DisplayClass4.<CreateDelegate>b__3(DisplayContext context) in ~\src\Orchard\DisplayManagement\Descriptors\ShapeAttributeStrategy\ShapeAttributeBindingStrategy.cs:line 55
at Orchard.DisplayManagement.Descriptors.ShapeAlterationBuilder.<>c__DisplayClass3.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in ~\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:line 56
at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in ~\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 185
at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in ~\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 94
at Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in ~\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 86
at Orchard.DisplayManagement.Implementation.DisplayHelper.Invoke(String name, INamedEnumerable1 parameters) in ~\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 44
at Orchard.DisplayManagement.Implementation.DisplayHelper.TryInvoke(InvokeBinder binder, Object[] args, Object& result) in ~\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 29
at CallSite.Target(Closure , CallSite , Object , Object )
at Orchard.Core.Shapes.CoreShapes.ContentZone(Object Display, Object Shape, TextWriter Output) in ~\src\Orchard.Web\Core\Shapes\CoreShapes.cs:line 274
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy.ShapeAttributeBindingStrategy.PerformInvoke(DisplayContext displayContext, MethodInfo methodInfo, Object serviceInstance) in ~\src\Orchard\DisplayManagement\Descriptors\ShapeAttributeStrategy\ShapeAttributeBindingStrategy.cs:line 64
at Orchard.DisplayManagement.Descriptors.ShapeAttributeStrategy.ShapeAttributeBindingStrategy.<>c__DisplayClass4.<CreateDelegate>b__3(DisplayContext context) in ~\src\Orchard\DisplayManagement\Descriptors\ShapeAttributeStrategy\ShapeAttributeBindingStrategy.cs:line 55
at Orchard.DisplayManagement.Descriptors.ShapeAlterationBuilder.<>c__DisplayClass3.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in ~\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:line 56
at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in ~\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 185
at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in ~\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 94
at Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in ~\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 86
at Orchard.DisplayManagement.Implementation.DisplayHelper.Invoke(String name, INamedEnumerable
1 parameters) in ~\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 44
at Orchard.DisplayManagement.Implementation.DisplayHelper.TryInvoke(InvokeBinder binder, Object[] args, Object& result) in ~\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 29
at CallSite.Target(Closure , CallSite , Object , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at ASP._Page_Modules_Orchard_Widgets_Views_Widget_Edit_cshtml.Execute() in ~\src\Orchard.Web\Modules\Orchard.Widgets\Views\Widget.Edit.cshtml:line 3
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
at System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection)
at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)
at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model)
at Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.Render(ShapeDescriptor shapeDescriptor, DisplayContext displayContext, HarvestShapeInfo harvestShapeInfo, HarvestShapeHit harvestShapeHit) in ~\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:line 151
at Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.<>c__DisplayClass26.<>c__DisplayClass28.<Discover>b__15(DisplayContext displayContext) in ~\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:line 133
at Orchard.DisplayManagement.Descriptors.ShapeAlterationBuilder.<>c__DisplayClass3.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in ~\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:line 56
at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in ~\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 185
at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in ~\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 94
at Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in ~\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 86
at Orchard.DisplayManagement.Implementation.DisplayHelper.Invoke(String name, INamedEnumerable`1 parameters) in ~\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 44
at Orchard.DisplayManagement.Implementation.DisplayHelper.TryInvoke(InvokeBinder binder, Object[] args, Object& result) in ~\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 29
at CallSite.Target(Closure , CallSite , Object , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
at ASP._Page_Modules_Orchard_Widgets_Views_admin_AddWidget_cshtml.Execute() in ~\src\Orchard.Web\Modules\Orchard.Widgets\Views\Admin\AddWidget.cshtml:line 6
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
at Orchard.Mvc.ViewEngines.ThemeAwareness.LayoutAwareViewEngine.<>c__DisplayClass7.<FindView>b__5(ViewContext viewContext, TextWriter writer, IViewDataContainer viewDataContainer) in ~\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:line 59
at Orchard.Mvc.ViewEngines.ThemeAwareness.LayoutAwareViewEngine.LayoutView.Render(ViewContext viewContext, TextWriter writer) in ~\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:line 90
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controller
May 5 at 6:52 PM
Edited May 5 at 7:04 PM
Thanks to try it.
But do you use the last commit, I think I solved these issues, could you give it a try again and give me more interesting details than the log ?
No use filling codeplex.
Yes the first line of code written last friday.
Is it Orchard 1.8 (which 1.x, 1.8x, zip) ?
What kind of parameters have you set ?
How many cultures have you declared for your site. And what cultures for your browser (which ?)
I suppose you get this for your home page ? How many translations ?

This module supposes you create the translated pages in /.../culture/page and that your alias are ok?

Here a sample of what I get

CLICK
Marked as answer by CSADNT on 5/5/2014 at 2:09 PM
May 5 at 7:03 PM
Last point, could you report your issues on bitbucket, this does not concern Orchard.
Marked as answer by CSADNT on 5/5/2014 at 2:09 PM
May 6 at 9:57 AM
Edited May 6 at 10:12 AM
Ok, with the last yours version I can get cookie culture picker.

At first look ...

working only content zone with page and projection types...

html widget in first and second aside zones dont working but in RM do...

po translations in header and footer don't ... in RM do

menu doesn,t , in RM does (I think it might related to culture layer , which I use for menu, since mine menus isn't symmetric)

Sipke's new List and Blogs don't working either like in RM...

can not analyze deeper now.

imho, discussion about such things like localization, which is the most weakness in orchard, should be in one plase for convenience
May 6 at 10:34 AM
Edited May 6 at 10:56 AM
negocifal wrote:
per now.
imho, discussion about such things like localization, which is the most weakness in orchard, should be in one plase for convenience
Sorry but I don't agree, I don't want to mix Orchard and modules, it is a minimal respect for people working on Orchard and taking care of forums.
It takes you a click on the upper link to go on bitbucket and put your comments.

You will find my answer there.

Edit: I did part of the job for you, you just have to continue here
https://bitbucket.org/csurieux/datwendo.localization/issue/1/issue-reported-by-negocifal-6-5-14-in
May 11 at 7:26 PM
Edited May 11 at 7:31 PM
Hello, I installed your module sucessfully. However when I select the widgets to add there is no widget "Cookie Culture Picker " listed.
Also in the admin modules menu, the only feature available to select is "Datwendo Localization", all your other features (cookie culture, menu culture picker, etc.) show up yet are unselectable (no checkbox).
Can you tell me the steps I must follow in order to use your module ? Thanks.
My Orchard version: 1.8 Datwendo Localization version: 1.1
May 11 at 8:06 PM
Edited May 11 at 10:40 PM
PLease could you report the issues on bitbucket where I will answer as explained below.
Check the folder is named Datwendo.localization.
Next on bitbucket.