[loc] fix various localization issues

* Fix missing [b]ase for Chinese and French
* Fix infinite loop when [b]ase is not available for default
* Fix resizing of main dialog forces forcing pos to 0,0
This commit is contained in:
Pete Batard 2013-10-17 20:12:16 +01:00
parent 1cdb58462b
commit ff28e2027c
7 changed files with 18 additions and 12 deletions

View File

@ -61,6 +61,7 @@ t IDC_QUICKFORMAT "Quick format"
t IDC_BOOT "Create a bootable disk using:"
t IDC_SET_ICON "Create extended label and icon files"
t IDC_ABOUT "About..."
t IDC_LOG "Log"
t IDCANCEL "Close"
t IDC_START "Start"
t IDS_ADVANCED_OPTIONS_GRP "Advanced Options"

View File

@ -274,6 +274,7 @@ t MSG_258 "Rock Ridge support"
################################################################################
l "fr-FR" "Français" 0x040c, 0x080c, 0x0c0c, 0x100c, 0x140c, 0x180c, 0x1c0c, 0x200c, 0x240c, 0x280c, 0x2c0c, 0x300c, 0x340c, 0x380c, 0xe40c
b "en-US"
g IDD_DIALOG
t IDS_DEVICE_TXT "Periphérique"
t IDS_PARTITION_TYPE_TXT "Type de partition et système de destination"
@ -610,6 +611,7 @@ t MSG_258 "Support Rock Ridge"
################################################################################
l "zh-CN" "正體字" 0x0404, 0x0804, 0x0c04, 0x1004, 0x1404
b "en-US"
g IDD_DIALOG
t IDS_DEVICE_TXT "设备"
t IDS_PARTITION_TYPE_TXT "分区计划和目标系统类型"

View File

@ -183,12 +183,12 @@ BOOL dispatch_loc_cmd(loc_cmd* lcmd)
free_loc_cmd(lcmd);
break;
case LC_BASE:
base_locale = get_locale_from_name(lcmd->txt[0]);
base_locale = get_locale_from_name(lcmd->txt[0], FALSE);
if (base_locale != NULL) {
uprintf("localization: using locale base '%s'", lcmd->txt[0]);
uprintf("localization: using locale base '%s'\n", lcmd->txt[0]);
get_loc_data_file(NULL, (long)base_locale->num[0], (long)base_locale->num[1], base_locale->line_nr);
} else {
uprintf("localization: locale base '%s' not found", lcmd->txt[0]);
luprintf("locale base '%s' not found - ignoring", lcmd->txt[0]);
}
free_loc_cmd(lcmd);
break;
@ -349,7 +349,7 @@ loc_cmd* get_locale_from_lcid(int lcid)
return lcmd;
}
loc_cmd* get_locale_from_name(char* locale_name)
loc_cmd* get_locale_from_name(char* locale_name, BOOL default_to_first)
{
loc_cmd* lcmd = NULL;
@ -363,6 +363,9 @@ loc_cmd* get_locale_from_name(char* locale_name)
return lcmd;
}
if (!default_to_first)
return NULL;
lcmd = list_entry(locale_list.next, loc_cmd, list);
uprintf("localization: could not find locale for name '%s'. Will default to '%s'\n", locale_name, lcmd->txt[0]);
return lcmd;

View File

@ -155,4 +155,4 @@ BOOL get_supported_locales(const char* filename);
char* get_loc_data_file(const char* filename, long offset, long end_offset, int start_line);
void free_locale_list(void);
loc_cmd* get_locale_from_lcid(int lcid);
loc_cmd* get_locale_from_name(char* locale_name);
loc_cmd* get_locale_from_name(char* locale_name, BOOL default_to_first);

View File

@ -1979,7 +1979,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
}
if ( (!get_supported_locales(loc_file))
|| ((selected_locale = ((locale_name == NULL)?get_locale_from_lcid(lcid):get_locale_from_name(locale_name))) == NULL) ) {
|| ((selected_locale = ((locale_name == NULL)?get_locale_from_lcid(lcid):get_locale_from_name(locale_name, TRUE))) == NULL) ) {
uprintf("FATAL: Could not access locale!\n");
MessageBoxU(NULL, "The locale data is missing. This application will now exit.",
"Fatal error", MB_ICONSTOP);

View File

@ -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.0.283"
CAPTION "Rufus v1.4.0.284"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -284,8 +284,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,0,283
PRODUCTVERSION 1,4,0,283
FILEVERSION 1,4,0,284
PRODUCTVERSION 1,4,0,284
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -302,13 +302,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.4.0.283"
VALUE "FileVersion", "1.4.0.284"
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.0.283"
VALUE "ProductVersion", "1.4.0.284"
END
END
BLOCK "VarFileInfo"

View File

@ -466,7 +466,7 @@ void ResizeMoveCtrl(HWND hDlg, HWND hCtrl, int dx, int dy, int dw, int dh)
GetWindowRect(hCtrl, &rect);
point.x = rect.left;
point.y = rect.top;
ScreenToClient(hDlg, &point);
ScreenToClient((hDlg==hMainDialog)?hDlg:NULL, &point);
GetClientRect(hCtrl, &rect);
// If we're dealing with a dialog, we must take the border into account