github tonikelope/megabasterd v8.51
MegaBasterd 8.51

5 hours ago

TL;DR

  • Fixes #771 -- on a brand-new install, MegaBasterd now autodetects the OS language and starts up in that locale instead of always defaulting to English. Existing installs are unaffected: anyone who has launched 8.27 or later already has settings rows persisted, so the autodetect path is skipped on upgrade. No popup, no restart prompt -- the GUI is built directly in the detected language.
  • Detection covers the eight currently bundled locales (EN/ES/IT/TR/ZH/VI/DE/HU). Any other OS locale falls back to English, same as today.

New in 8.51

#771 -- First-run OS language autodetection

  • What changed. On a true first run -- the SQLite settings table has zero rows immediately after setupSqliteTables() -- a new block in the MainPanel constructor reads Locale.getDefault().getLanguage(), maps the ISO 639-1 code to MegaBasterd's internal language code (es->ES, it->IT, tr->TU, zh->CH, vi->VI, de->GE, hu->HU, en->EN) and writes the result as language=XX into the settings table. The downstream loadUserSettings() reads that row through the normal lookup path, so when LabelTranslatorSingleton initialises and MainPanelView builds, the locale is already correct and the very first paint comes out localised. Locales with no bundled translation fall back to EN.

  • Why not in loadUserSettings(). That was the obvious place but it does not work: by the time loadUserSettings() runs (line 413 of the constructor), the v8.27 verify_down_file_migrated_v827 migration block has already inserted a row, so any "is the settings table empty?" check would return false on a real first run. The autodetect block is therefore positioned between setupSqliteTables() and the v8.27 migration -- the only window when an empty table is still observable.

  • No regression for existing users. Anyone who has launched 8.27 or later has verify_down_file_migrated_v827=yes in their settings table, so isSettingsTableEmpty() returns false and the autodetect is skipped. loadUserSettings() then resolves the language as before: explicit value if the user had chosen one, otherwise DEFAULT_LANGUAGE="EN".

  • No popup, no restart. The detection runs before _view = new MainPanelView(this) and before the first LabelTranslatorSingleton.getInstance() call, so the locale is set on the very first label lookup. Users only need a restart when changing language after the GUI is already built (i.e. from the Settings dialog), which is the existing behaviour.

Other

  • Version bumped to 8.51 in pom.xml and MainPanel.VERSION.
  • New helper DBTools.isSettingsTableEmpty() -- a single SELECT 1 FROM settings LIMIT 1 under the same synchronized / SqliteSingleton pattern as the rest of DBTools; returns false on SQLException so the safe "not a first run" path wins.

Don't miss a new megabasterd release

NewReleases is sending notifications on new releases.