Have you set the Languagepath in the gui plugin attribute and have the lang files set up correctly?
Hi Per, thanks for your reply.
I dont use LanguagePath in GUIPlugIn. Do I have to?
All my english translations loads perfectly. The lang file is placed in the lang directory.
The problem is that it always loads the english translation.
Hi
Yes, you need to set LanguagePath. Otherwise we don't know where in the language files to look for translations. If LanguagePath isn't set we will use the DisplayName and Description properties on the plugin attribute in the UI.
Regards
Per Gunsarfs
EPiServer Development Team
Hmm but there seems to be a bug in the language handling. When I switch langauge from english to swedish the heading (in admin menu) of my plugin changes to the swedish alternative but all labels etc in the actual aspx file is still in english.
If i change the languagepathroot in the langfile for english so it's not correct I get the language error that the path cannot be found for language "en" but Im running swedish.
Glad that some else have found the same problem, thanks Per.
This is exacly what I ment, it always reads the english translation.
Can someone on EPi confirm that this is a bug? Or provide a solution?
Regards,
Jonas Andersson
I've found a solution and its a simple one. To get the translations working correctly I did this.
protected override void OnPreInit(EventArgs e) {
string lang = EPiServerProfile.Current.Language;
UserInterfaceLanguage.Instance.SetCulture(lang);
base.OnPreInit(e);
}
Good that you found a solution, although you shouldn't need that code.
Was wondering if it could be because your plugins aren't using our base classes (PageBase or UserControlBase depending on the type). The language detection is done in the base classes, and if you don't inherite from those you'd need to set it up yourself.
Regards
Per Gunsarfs
Hi Per,
Im inheriting from SystemPageBase, because I want the same look and feel as the rest of the admin interface.
SystemPageBase inherits from PageBase so it cant be that, or could it?
public partial class VideoQueueAdmin : SystemPageBase { ....... }
Yes, SystemPageBase inherits from PageBase, so that should just fine.
It's strange, because our built in plugins don't do anything magical to get the translation to work, so I can't think of anything else you might have missed. The built in admin plugins translate correctly right?
Regards
Per Gunsarfs
Hi Per,
Yes everything else in the admin interface translates correctly.
/Jonas
Hello developers!
Hopefully someone can help me with this one. I’ve developed a custom AdminMenu plugin thats uses EPiServers built in language support. It works fine until I change the user interface language to another language then english. Then my plugin doesn’t get translated to the new language, it remains in english. Although all of the standard admin interface is translated correctly. If it matters my plugin is using this solution, http://labs.episerver.com/en/Blogs/Johano/Dates/2008/6/EPiServer-PlugIns-in-one-single-dll/.
What do I need to do so my AdminMenu plugin gets translated? Any guidelines?