2021-11-23 13:20:07 +08:00
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using System;
|
|
|
|
|
|
2022-02-19 22:37:57 +08:00
|
|
|
namespace XCharts.Runtime
|
2021-11-23 13:20:07 +08:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Language.
|
2022-03-24 08:37:06 +08:00
|
|
|
/// |国际化语言表。
|
2021-11-23 13:20:07 +08:00
|
|
|
/// </summary>
|
2022-03-26 21:34:38 +08:00
|
|
|
[Serializable]
|
|
|
|
|
[CreateAssetMenu(menuName = "XCharts/Export Lang")]
|
2021-11-23 13:20:07 +08:00
|
|
|
public class Lang : ScriptableObject
|
|
|
|
|
{
|
|
|
|
|
public string langName = "EN";
|
|
|
|
|
public LangTime time = new LangTime();
|
2021-12-19 20:53:55 +08:00
|
|
|
public LangCandlestick candlestick = new LangCandlestick();
|
2021-11-23 13:20:07 +08:00
|
|
|
|
|
|
|
|
public string GetMonthAbbr(int month)
|
|
|
|
|
{
|
|
|
|
|
if (month < 1 && month > 12) return month.ToString();
|
|
|
|
|
else return time.monthAbbr[month - 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string GetDay(int day)
|
|
|
|
|
{
|
|
|
|
|
day = day - 1;
|
|
|
|
|
if (day >= 0 && day < time.dayOfMonth.Count - 1)
|
|
|
|
|
return time.dayOfMonth[day];
|
|
|
|
|
else
|
|
|
|
|
return day.ToString();
|
|
|
|
|
}
|
2021-12-19 20:53:55 +08:00
|
|
|
|
|
|
|
|
public string GetCandlestickDimensionName(int i)
|
|
|
|
|
{
|
|
|
|
|
if (i >= 0 && i < candlestick.dimensionNames.Count)
|
|
|
|
|
return candlestick.dimensionNames[i];
|
|
|
|
|
else
|
|
|
|
|
return string.Empty;
|
|
|
|
|
}
|
2021-11-23 13:20:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class LangTime
|
|
|
|
|
{
|
|
|
|
|
public List<string> months = new List<string>() {
|
|
|
|
|
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
|
|
|
|
|
public List<string> monthAbbr = new List<string>(){
|
|
|
|
|
"Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
|
|
|
|
|
public List<string> dayOfMonth = new List<string>() {
|
|
|
|
|
"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"};
|
|
|
|
|
public List<string> dayOfWeek = new List<string>() {
|
|
|
|
|
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
|
|
|
|
|
public List<string> dayOfWeekAbbr = new List<string>() {
|
|
|
|
|
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
|
|
|
|
}
|
2021-12-19 20:53:55 +08:00
|
|
|
|
2022-03-26 21:34:38 +08:00
|
|
|
[Serializable]
|
2021-12-19 20:53:55 +08:00
|
|
|
public class LangCandlestick
|
|
|
|
|
{
|
|
|
|
|
public List<string> dimensionNames = new List<string>() { "open", "close", "lowest", "highest" };
|
|
|
|
|
}
|
2021-11-23 13:20:07 +08:00
|
|
|
}
|