summaryrefslogtreecommitdiff
path: root/Thronefall_1_57/Decompile/I2.Loc/LocalizedString.cs
blob: 51ff1950231907782e670df3e07533d628e7817d (plain)
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
37
38
39
40
41
42
43
44
45
using System;

namespace I2.Loc;

[Serializable]
public struct LocalizedString
{
	public string mTerm;

	public bool mRTL_IgnoreArabicFix;

	public int mRTL_MaxLineLength;

	public bool mRTL_ConvertNumbers;

	public bool m_DontLocalizeParameters;

	public static implicit operator string(LocalizedString s)
	{
		return s.ToString();
	}

	public static implicit operator LocalizedString(string term)
	{
		LocalizedString result = default(LocalizedString);
		result.mTerm = term;
		return result;
	}

	public LocalizedString(LocalizedString str)
	{
		mTerm = str.mTerm;
		mRTL_IgnoreArabicFix = str.mRTL_IgnoreArabicFix;
		mRTL_MaxLineLength = str.mRTL_MaxLineLength;
		mRTL_ConvertNumbers = str.mRTL_ConvertNumbers;
		m_DontLocalizeParameters = str.m_DontLocalizeParameters;
	}

	public override string ToString()
	{
		string translation = TextTranslator.Translate(mTerm, !mRTL_IgnoreArabicFix, mRTL_MaxLineLength, !mRTL_ConvertNumbers);
		LocalizationManager.ApplyLocalizationParams(ref translation, !m_DontLocalizeParameters);
		return translation;
	}
}