Allows to import translation subtitles into existing subtitles.
コード例 #1
0
ファイル: Document.cs プロジェクト: GNOME/gnome-subtitles
	private void RemoveTranslationFromSubtitles () {
		Translations translations = new Translations();
		translations.Clear(subtitles);
	}
コード例 #2
0
ファイル: Document.cs プロジェクト: GNOME/gnome-subtitles
	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;
	}