Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

> Some of the translation strings were missing from the fallback translation dict. Fixes #17. #23

Open
LittleCyberCortex opened this issue May 20, 2024 · 0 comments

Comments

@LittleCyberCortex
Copy link

          > Some of the translation strings were missing from the fallback translation dict. Fixes #17.

Wrong, it doesn't fix #17, because the extension deletes all hardcoded tables upon closing, so re-opening the window fails due to an ipairs(nil) call.
Overly aggressive cleanup or missing reactivation logic

-- Function triggered when the extension is activated
function activate()
	vlc.msg.dbg(_VERSION) --display Lua version in the VLC message window
	vlc.msg.dbg("[Lyrics Finder] Activating ")
	langcode = getenv_lang() --auto guess
	if dlg then
		dlg:show()
	end
	
	show_dialog()
	return true
end

function close()
	deactivate()
end

-- Function triggered when the extension is deactivated
function deactivate()
	reset_variables()
	vlc.deactivate()
	vlc.msg.dbg("[Lyrics Finder] Deactivated")
	return true
end

Specifically the method "reset_variables()":

-- Resets dialog
function reset_variables()
	dlg = nil
	title = nil
	artist = nil
	lyric = nil
	source_label = nil
	languages = nil
	translation = nil
end

The "languages" and "translation" KV tables are defined at the beginning of the lua file and get emptied in memory upon unloading the window.

Originally posted by @LittleCyberCortex in #19 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant