Allows to import translation subtitles into existing subtitles.
Exemplo n.º 1
0
	private void RemoveTranslationFromSubtitles () {
		Translations translations = new Translations();
		translations.Clear(subtitles);
	}
Exemplo n.º 2
0
	public void OpenTranslation (string path, Encoding encoding) {
		if (this.IsTranslationLoaded)
			CloseTranslation();

		SubtitleFactory factory = new SubtitleFactory();
		factory.Verbose = true;
		factory.Encoding = encoding;
		factory.FallbackEncoding = GetFallbackEncoding();

		SubLib.Core.Domain.Subtitles openedTranslation = factory.Open(path);
		FileProperties newTranslationFile = factory.FileProperties;
		AddExtraSubtitles(openedTranslation);

		Translations translations = new Translations();
		translations.Import(subtitles, openedTranslation, Base.Config.PrefsTimingsTimeBetweenSubtitles);

		if (newTranslationFile.SubtitleType != SubtitleType.Unknown)
			canTranslationBeSaved = true;

		this.translationFile = newTranslationFile;
		this.isTranslationLoaded = true;
	}