CB: Translation eingebaut
This commit is contained in:
24
BeWo/MultiLanguage/Markup/TranslateExtension.cs
Normal file
24
BeWo/MultiLanguage/Markup/TranslateExtension.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Windows.Markup;
|
||||
using BS.Shared.Translation;
|
||||
|
||||
namespace BeWo.MultiLanguage.Markup
|
||||
{
|
||||
[MarkupExtensionReturnType]
|
||||
public class TranslateExtension : MarkupExtension
|
||||
{
|
||||
private readonly String key;
|
||||
|
||||
public TranslateExtension() { }
|
||||
|
||||
public TranslateExtension(String key)
|
||||
{
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public override Object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
return Translator.Translate(this.key);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user