From 63e1fe3d557f268a0292a8a037ccc32f2195bc6e Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sun, 22 Dec 2013 18:28:38 +0000 Subject: [PATCH] [loc] persits the user-selected locale * ...since it seems this is what most Rufus users want. * Also fix a typo in the Malay translation (reported by hyxer) * Closes #250 --- res/localization/rufus.loc | 2 +- src/parser.c | 6 +++--- src/rufus.c | 3 ++- src/rufus.rc | 10 +++++----- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/res/localization/rufus.loc b/res/localization/rufus.loc index dd4e352b..c4018e69 100644 --- a/res/localization/rufus.loc +++ b/res/localization/rufus.loc @@ -3872,7 +3872,7 @@ t IDC_START "Mula" m IDC_START +18,0 t IDS_ADVANCED_OPTIONS_GRP "Pilihan Lanjutan" s IDS_ADVANCED_OPTIONS_GRP +19,0 -t IDC_ENABLE_FIXED_DISKS "Senaraiakan cakera keras USB" +t IDC_ENABLE_FIXED_DISKS "Senaraikan cakera keras USB" s IDC_ENABLE_FIXED_DISKS +20,0 # Note: it is acceptable to drop the parenthesis () below if you are running out of space # as there is a tooltip (MSG_169) providing these details diff --git a/src/parser.c b/src/parser.c index 65a5516b..6ee28ab6 100644 --- a/src/parser.c +++ b/src/parser.c @@ -424,7 +424,7 @@ BOOL get_loc_data_file(const char* filename, loc_cmd* lcmd) if (!eol) loc_line_nr += line_nr_incr; get_loc_data_line(buf); - goto out; + break; case '\r': case '\n': if (escape_sequence) { @@ -502,8 +502,8 @@ BOOL get_loc_data_file(const char* filename, loc_cmd* lcmd) } break; } - if (ftell(fd) > end_offset) - goto out; + if ((c == EOF) || (ftell(fd) > end_offset)) + break; // Have at least 2 chars extra, for \r\n sequences if (i >= bufsize-2) { bufsize *= 2; diff --git a/src/rufus.c b/src/rufus.c index 71e71c07..11d68ece 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -2205,7 +2205,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine relaunch: uprintf("localization: using locale '%s'\n", selected_locale->txt[0]); - get_loc_data_file(loc_file, selected_locale); + if (get_loc_data_file(loc_file, selected_locale)) + WriteRegistryKeyStr(REGKEY_HKCU, REGKEY_LOCALE, selected_locale->txt[0]); // Create the main Window hDlg = CreateDialogW(hInstance, MAKEINTRESOURCEW(IDD_DIALOG), NULL, MainCallback); diff --git a/src/rufus.rc b/src/rufus.rc index 95ea958c..f7b5fbce 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 206, 329 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW -CAPTION "Rufus v1.4.2.360" +CAPTION "Rufus v1.4.2.361" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 @@ -288,8 +288,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,2,360 - PRODUCTVERSION 1,4,2,360 + FILEVERSION 1,4,2,361 + PRODUCTVERSION 1,4,2,361 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -306,13 +306,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.4.2.360" + VALUE "FileVersion", "1.4.2.361" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2013 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "1.4.2.360" + VALUE "ProductVersion", "1.4.2.361" END END BLOCK "VarFileInfo"