-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLocalizedStrings.cs
36 lines (33 loc) · 1.17 KB
/
LocalizedStrings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using WpfCalava.Assets;
namespace WpfCalava
{
/// <summary>
/// Localized strings.
/// </summary>
public class LocalizedStrings
{
static private readonly StringResources _resources = new StringResources();
/// <summary>
/// String resources.
/// </summary>
static public StringResources Resources
{
get { return _resources; }
}
/// <summary>
/// Format the specified text template filling it with the specified arguments.
/// </summary>
/// <remarks>This is just a wrapper for <c>String.Format</c> using the culture
/// of this object resources.</remarks>
/// <param name="sTemplate">template</param>
/// <param name="args">arguments</param>
/// <returns>formatted string</returns>
/// <exception cref="ArgumentNullException">null template</exception>
static public string Format(string sTemplate, params object[] args)
{
if (sTemplate == null) throw new ArgumentNullException("sTemplate");
return String.Format(StringResources.Culture, sTemplate, args);
}
}
}