Skip to content

How can I completely turn off the ToggleTranslation function? #783

@habacksill

Description

@habacksill
private void ToggleTranslation()
		{
			this._isInTranslatedMode = !this._isInTranslatedMode;
			List<KeyValuePair<object, object>> allRegisteredObjects = ExtensionDataHelper.GetAllRegisteredObjects();
			XuaLogger.AutoTranslator.Info(string.Format("Toggling translations of {0} objects.", allRegisteredObjects.Count));
			if (this._isInTranslatedMode)
			{
				using (List<KeyValuePair<object, object>>.Enumerator enumerator = allRegisteredObjects.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						KeyValuePair<object, object> keyValuePair = enumerator.Current;
						object key = keyValuePair.Key;
						try
						{
							TextTranslationInfo textTranslationInfo = keyValuePair.Value as TextTranslationInfo;
							if (textTranslationInfo.GetIsKnownTextComponent() && key.IsComponentActive() && textTranslationInfo != null && textTranslationInfo.IsTranslated)
							{
								this.SetText(key, textTranslationInfo.TranslatedText, true, null, textTranslationInfo);
							}
							if (Settings.EnableTextureTranslation && Settings.EnableTextureToggling && (key is Texture2D || key.IsKnownImageType()))
							{
								this.TranslateTexture(key, null);
							}
						}
						catch (Exception)
						{
							ExtensionDataHelper.Remove(key);
						}
					}
					return;
				}
			}
			foreach (KeyValuePair<object, object> keyValuePair2 in allRegisteredObjects)
			{
				object key2 = keyValuePair2.Key;
				try
				{
					TextTranslationInfo textTranslationInfo2 = keyValuePair2.Value as TextTranslationInfo;
					if (textTranslationInfo2.GetIsKnownTextComponent() && key2.IsComponentActive() && textTranslationInfo2 != null && textTranslationInfo2.IsTranslated)
					{
						this.SetText(key2, textTranslationInfo2.OriginalText, false, null, textTranslationInfo2);
					}
					if (Settings.EnableTextureTranslation && Settings.EnableTextureToggling)
					{
						this.TranslateTexture(key2, null);
					}
				}
				catch (Exception)
				{
					ExtensionDataHelper.Remove(key2);
				}
			}
		}
	}
}

I want to disable them completely!!!!!
i don't want them

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions