[loc] display a note in the log when a translation is behind

* Also make sure the messages regarding language pack availability
  are visible to the users in the log
* Also fix a typo in the Malay translation
This commit is contained in:
Pete Batard 2016-02-15 12:50:06 +00:00
parent 5e8a459828
commit 140236acd6
8 changed files with 26 additions and 14 deletions

View File

@ -9795,7 +9795,7 @@ t MSG_080 "Rufus mengesan bahawa Windows masih lagi menarik penimbal ke dalam pe
"Terutamanya untuk fail besar .\n\nKami cadangkan anda biarkan Windows tamat dahulu untuk mengelakkan korupsi."
"Namun, jika anda kesuntukan masa, anda boleh cabutkan peranti anda..."
t MSG_081 "ISO tidak disokong" -> "Imej tidak disokong"
t MSG_082 -> "Imej ini sama ada tidak boleh boot, atau ia menggunakan kaedah boot atau mampatan yang tidak disokong oleh Rufus..."
t MSG_082 "Imej ini sama ada tidak boleh boot, atau ia menggunakan kaedah boot atau mampatan yang tidak disokong oleh Rufus..."
t MSG_083 "Gantikan %s?"
t MSG_084 "Imej ISO ini menggunakan versi '%s' yang telah lapuk.\n"
"Oleh sebab ini, menu boot mungkin tidak dipaparkan dengan betul.\n\n"

View File

@ -602,13 +602,15 @@ WORD get_language_id(loc_cmd* lcmd)
wchar_t wlang[5];
LANGID lang_id = GetUserDefaultUILanguage();
// Log will be reset, so we need to use the buffered uprintf() to get our messages to the user
ubclear();
if (lcmd == NULL)
return MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);
// Find if the selected language is the user default
for (i = 0; i<lcmd->unum_size; i++) {
if (lcmd->unum[i] == lang_id) {
uprintf("localization: will use default UI language 0x%04X", lang_id);
ubpushf("Will use default UI locale 0x%04X", lang_id);
return MAKELANGID(lang_id, SUBLANG_DEFAULT);
}
}
@ -622,11 +624,12 @@ WORD get_language_id(loc_cmd* lcmd)
// boolean to tell us that we found what we were after.
EnumUILanguages(EnumUILanguagesProc, 0x4, (LONG_PTR)wlang); // 0x04 = MUI_LANGUAGE_ID
if (found_lang) {
uprintf("localization: detected installed language pack for 0x%04X", lcmd->unum[i]);
ubpushf("Detected installed Windows Language Pack for 0x%04X (%s)", lcmd->unum[i], lcmd->txt[1]);
return MAKELANGID(lcmd->unum[i], SUBLANG_DEFAULT);
}
}
uprintf("localization: no matching language pack - some messages will be displayed using default locale");
ubpushf("NOTE: No Windows Language Pack is installed for %s on this system.\r\n"
"This means that some controls will still be displayed using the system locale.", lcmd->txt[1]);
return MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);
}

View File

@ -30,8 +30,7 @@
// Attributes that can be set by a translation
#define LOC_RIGHT_TO_LEFT 0x00000001
#define LOC_ARABIC_NUMERALS 0x00000002
#define LOC_JAPANESE_NUMERALS 0x00000004
#define LOC_NEEDS_UPDATE 0x00000002
// The [v]ersion major from a translation must match this number or
// the translation will be ignored

View File

@ -41,8 +41,6 @@ static const char* conversion_error = "Could not convert '%s' to UTF-16";
const struct {char c; int flag;} attr_parse[] = {
{ 'r', LOC_RIGHT_TO_LEFT },
{ 'a', LOC_ARABIC_NUMERALS }, // NOT IMPLEMENTED
{ 'j', LOC_JAPANESE_NUMERALS }, // NOT IMPLEMENTED
};
/*
@ -343,6 +341,7 @@ BOOL get_supported_locales(const char* filename)
LOC_FRAMEWORK_VERSION, loc_base_minor);
} else {
if (lcmd->unum[2] < loc_base_micro) {
last_lcmd->ctrl_id |= LOC_NEEDS_UPDATE;
luprintf("the version of this translation is older than the base one and may result in some messages not being properly translated.\n"
"If you are the translator, please update your translation with the changes that intervened between v%d.%d.%d and v%d.%d.%d.\n"
"See https://github.com/pbatard/rufus/blob/master/res/localization/ChangeLog.txt",

View File

@ -1744,7 +1744,13 @@ void InitDialog(HWND hDlg)
uprintf("Syslinux versions: %s%s, %s%s", embedded_sl_version_str[0], embedded_sl_version_ext[0],
embedded_sl_version_str[1], embedded_sl_version_ext[1]);
uprintf("Grub versions: %s, %s", GRUB4DOS_VERSION, GRUB2_PACKAGE_VERSION);
uprintf("Locale ID: 0x%04X", GetUserDefaultUILanguage());
uprintf("System locale ID: 0x%04X", GetUserDefaultUILanguage());
ubpop();
if (selected_locale->ctrl_id & LOC_NEEDS_UPDATE) {
uprintf("NOTE: The %s translation requires an update, but the current translator hasn't submitted "
"one. Because of this, some messages will only be displayed in English.", selected_locale->txt[1]);
uprintf("If you think you can help update this translation, please e-mail <pete@akeo.ie>.");
}
SetClusterSizeLabels();

View File

@ -113,6 +113,9 @@
#ifdef RUFUS_DEBUG
extern void _uprintf(const char *format, ...);
#define uprintf(...) _uprintf(__VA_ARGS__)
#define ubclear() do { ubuffer[0] = 0; } while (0);
#define ubpushf(...) static_sprintf(ubuffer, __VA_ARGS__)
#define ubpop() uprintf("%s", ubuffer)
#define vuprintf(...) if (verbose) _uprintf(__VA_ARGS__)
#define vvuprintf(...) if (verbose > 1) _uprintf(__VA_ARGS__)
#define suprintf(...) if (!bSilent) _uprintf(__VA_ARGS__)
@ -375,6 +378,7 @@ extern int64_t iso_blocking_status;
extern uint16_t rufus_version[3], embedded_sl_version[2];
extern int nWindowsVersion;
extern char WindowsVersionStr[128];
extern char ubuffer[256];
extern char embedded_sl_version_str[2][12];
extern RUFUS_UPDATE update;
extern int dialog_showing;

View File

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 2.7.855"
CAPTION "Rufus 2.7.856"
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -320,8 +320,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,7,855,0
PRODUCTVERSION 2,7,855,0
FILEVERSION 2,7,856,0
PRODUCTVERSION 2,7,856,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -338,13 +338,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "2.7.855"
VALUE "FileVersion", "2.7.856"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "2.7.855"
VALUE "ProductVersion", "2.7.856"
END
END
BLOCK "VarFileInfo"

View File

@ -38,6 +38,7 @@
* Globals
*/
HWND hStatus;
char ubuffer[256]; // Buffer for ubpushf() messages we don't log right away
#ifdef RUFUS_DEBUG
void _uprintf(const char *format, ...)