mirror of
https://github.com/greenshot/greenshot.git
synced 2025-01-26 07:02:50 -08:00
f3b0878b02
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1282 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
40 lines
963 B
C#
40 lines
963 B
C#
|
|
using System;
|
|
using System.Resources;
|
|
using System.Globalization;
|
|
using System.Threading;
|
|
using Greenshot.Configuration;
|
|
using System.Diagnostics;
|
|
|
|
|
|
namespace Greenshot
|
|
{
|
|
/// <summary>
|
|
/// Description of Language.
|
|
/// </summary>
|
|
public class Language
|
|
{
|
|
private ResourceManager rm;
|
|
private static Language uniqueInstance;
|
|
private Language() {
|
|
rm = new ResourceManager("Greenshot.UI", System.Reflection.Assembly.GetExecutingAssembly());
|
|
SetLanguage(AppConfig.GetInstance().Ui_Language);
|
|
}
|
|
|
|
public static Language GetInstance() {
|
|
if(uniqueInstance == null) {
|
|
uniqueInstance = new Language();
|
|
}
|
|
return uniqueInstance;
|
|
|
|
}
|
|
public void SetLanguage(string cultureInfo) {
|
|
Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureInfo);
|
|
}
|
|
public string GetString(string id) {
|
|
string s = rm.GetString(id);
|
|
return (s != null) ? s : "string ###"+id+"### not found";
|
|
}
|
|
}
|
|
}
|