fix: translate topbar when no file (#533)

This commit is contained in:
natural-harmonia-gropius
2023-04-26 21:06:19 +08:00
committed by GitHub
parent 6216f64ac8
commit ff88fabdb6

View File

@@ -85,6 +85,10 @@ function TopBar:decide_titles()
self.alt_title = state.alt_title ~= '' and state.alt_title or nil self.alt_title = state.alt_title ~= '' and state.alt_title or nil
self.main_title = state.title ~= '' and state.title or nil self.main_title = state.title ~= '' and state.title or nil
if (self.main_title == 'No file') then
self.main_title = t('No file')
end
-- Fall back to alt title if main is empty -- Fall back to alt title if main is empty
if not self.main_title then if not self.main_title then
self.main_title, self.alt_title = self.alt_title, nil self.main_title, self.alt_title = self.alt_title, nil