string text = TranslationKeys.MyPage.MyCategory.Intro.GetString(); // instead of // string text = LocalizationService.Current.GetString("/myPage/myCategory/intro");
UPDATE: EPiServer 6 & 7 supported
Localization package support both EPiServer 6 & 7. To change version change Resources\TranslationKeys.tt
... <#@ import namespace="OpenWaves.EPiServer.Localization.Transformations" #> <# var epiServerVersion = 7; // for EPiServer 6.x version // var epiServerVersion = 6; ...
Benefits
- Intelli Sense support
- Compile time check for correct language keys
- When refactoring all occurrences are renamed
- Supports "Find all usages" of language keys
Usage
NOTE: After changing language file (*.xml) you have to"Run Custom Tool" manually to regenerate translation key classes
4 comments:
Great work. I can evaluate the efforts, because I was working on a kind of the same thing recently: https://github.com/SergVro/Localization-T4, but never had enough time to finish and make it public.
I also have a bug report for you :) It is an edge case issue, but still - if translation key has repetitive parts (like "/admin/tinymce/plugins/epiaccesskeysremove/epiaccesskeysremove") the generated code does not compile.
Thanks for comment. I have fixed this issue.
I have also added Support for EPiServer 6
This is nice plugin! Thanks.
Hi:
I know this is an old post but though I really like the idea of this (all yours) plugins, I am also running into trouble using the localization plugin.
Namely there is no intellisense in visual studio 2010.
Can you help,please?
Post a Comment