mirror of
https://github.com/greenshot/greenshot.git
synced 2025-01-09 15:23:03 -08:00
26fe579d31
Removed a lot of dead code, and remove the old OCR code as we don't even know if it still works.
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using System;
|
|
|
|
namespace GreenshotConfluencePlugin.Support {
|
|
public class TranslationManager {
|
|
private static TranslationManager _translationManager;
|
|
|
|
public event EventHandler LanguageChanged;
|
|
|
|
/*public CultureInfo CurrentLanguage {
|
|
get { return Thread.CurrentThread.CurrentUICulture; }
|
|
set {
|
|
if( value != Thread.CurrentThread.CurrentUICulture) {
|
|
Thread.CurrentThread.CurrentUICulture = value;
|
|
OnLanguageChanged();
|
|
}
|
|
}
|
|
}
|
|
|
|
public IEnumerable<CultureInfo> Languages {
|
|
get {
|
|
if( TranslationProvider != null) {
|
|
return TranslationProvider.Languages;
|
|
}
|
|
return Enumerable.Empty<CultureInfo>();
|
|
}
|
|
}*/
|
|
|
|
public static TranslationManager Instance => _translationManager ??= new TranslationManager();
|
|
|
|
public ITranslationProvider TranslationProvider { get; set; }
|
|
|
|
public object Translate(string key) {
|
|
object translatedValue = TranslationProvider?.Translate(key);
|
|
if( translatedValue != null) {
|
|
return translatedValue;
|
|
}
|
|
return $"!{key}!";
|
|
}
|
|
}
|
|
}
|