mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
"Merged" 0.8 with HEAD, so we can continue developing
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1282 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
174f653a5a
commit
f3b0878b02
539 changed files with 86855 additions and 0 deletions
39
Greenshot/Language.cs
Normal file
39
Greenshot/Language.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue