public static string Str(int id, params object[] args) { string val = ""; if (id == 0) { return(val); } val = LocalizationCsvData.text(id); if (args != null && args.Length != 0) { val = string.Format(val, args); } return(val); }
public void LoadCsv() { #if UNITY_EDITOR && !HOT_FIX_TEST LocalizationCsvData.Read("Assets/Build/Localization/Localization_" + CurrentLanguage.ToString()); //LocalizationPatchCsvData.Read(GameConfig.GetCurrentCsvTargetPath() + "LocalizationPatch"); #elif HOT_FIX_TEST LocalizationCsvData.Deserialize("LocalizationBin/Localization_" + CurrentLanguage.ToString(), true); LocalizationPatchCsvData.Deserialize("CsvBin/LocalizationPatch", true); #else LocalizationCsvData.Deserialize("LocalizationBin/Localization_" + CurrentLanguage.ToString(), true); LocalizationPatchCsvData.Deserialize("CsvBin/LocalizationPatch", true); #endif // apply localization path for different ship // for(int i = 0; i < LocalizationPatchCsvData.Data.Count; i++) { // if(LocalizationPatchCsvData.Data[i].Source > 0 && LocalizationPatchCsvData.Data[i].Target > 0) { // LocalizationCsvData.Data[LocalizationPatchCsvData.Data[i].Source] = new LocalizationRecord{_ID = LocalizationPatchCsvData.Data[i].Source, _VALUE = LocalizationPatchCsvData.Data[i].Source, text = LocalizationCsvData.Data[LocalizationPatchCsvData.Data[i].Target].text}; // } // } }