diff --git a/out/locale/en/LC_MESSAGES/default.po b/out/locale/en/LC_MESSAGES/default.po index 87852dba..489499a2 100644 --- a/out/locale/en/LC_MESSAGES/default.po +++ b/out/locale/en/LC_MESSAGES/default.po @@ -1,15 +1,16 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# +# # Translators: msgid "" msgstr "" "Project-Id-Version: HeidiSQL\n" "POT-Creation-Date: 2012-11-05 21:40\n" -"PO-Revision-Date: 2012-11-09 10:37+0000\n" -"Last-Translator: david.proweb \n" -"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n" +"PO-Revision-Date: 2012-11-26 06:40+0100\n" +"Last-Translator: Ansgar Becker \n" +"Language-Team: English (http://www.transifex.com/projects/p/heidisql/" +"language/en/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -179,6 +180,7 @@ msgstr "Session name" #. MainForm..panelTop..pnlRight..PageControlMain..tabHost..PageControlHost..tabProcessList..ListProcesses......WideText #. UserManagerForm..pnlLeft..listUsers......WideText #: connections.dfm:128 main.dfm:601 main.dfm:874 usermanager.dfm:136 +#: tabletools.pas:1197 msgid "Host" msgstr "Host" @@ -190,7 +192,7 @@ msgstr "User" #. connform..ListSessions......WideText #. MainForm..panelTop..pnlRight..PageControlMain..tabDatabase..ListTables......WideText -#: connections.dfm:138 main.dfm:1136 +#: connections.dfm:138 main.dfm:1136 tabletools.pas:1200 msgid "Version" msgstr "Version" @@ -250,7 +252,7 @@ msgid "Password:" msgstr "Password:" #. connform..PageControlDetails..tabSettings..lblHost..Caption -#: connections.dfm:253 +#: connections.dfm:253 connections.pas:986 msgid "Hostname / IP:" msgstr "Hostname / IP:" @@ -311,7 +313,9 @@ msgstr "Use Windows authentication" msgid "" "Use your client time zone in date/time SQL functions, e.g. NOW(), for MySQL " "4.1.3+" -msgstr "Use your client time zone in date/time SQL functions, e.g. NOW(), for MySQL 4.1.3+" +msgstr "" +"Use your client time zone in date/time SQL functions, e.g. NOW(), for MySQL " +"4.1.3+" #. connform..PageControlDetails..tabSettings..chkLocalTimeZone..Caption #: connections.dfm:408 @@ -472,7 +476,7 @@ msgid "Recent filters" msgstr "Recent filters" #. CreateDatabaseForm..Caption -#: createdatabase.dfm:5 +#: createdatabase.dfm:5 createdatabase.pas:92 msgid "Create database ..." msgstr "Create database ..." @@ -842,9 +846,9 @@ msgstr "Database, table:" #. frmInsertFiles..grpSelectObject..lblFilecontents....Caption #: insertfiles.dfm:76 msgid "" -"Column values (Hint: Assign \"%filecontent%\" value to a BLOB or TEXT " -"column)" -msgstr "Column values (Hint: Assign \"%filecontent%\" value to a BLOB or TEXT column)" +"Column values (Hint: Assign \"%filecontent%\" value to a BLOB or TEXT column)" +msgstr "" +"Column values (Hint: Assign \"%filecontent%\" value to a BLOB or TEXT column)" #. frmInsertFiles..grpSelectObject..ListColumns......WideText #: insertfiles.dfm:129 @@ -935,9 +939,11 @@ msgstr "Clear" #. frmInsertFiles..OpenDialog....Filter #: insertfiles.dfm:269 msgid "" -"All files (*.*)|*.*|Common images (*.jpg, *.gif, *.bmp, " -"*.png)|*.jpg;*.gif;*.bmp;*.png" -msgstr "All files (*.*)|*.*|Common images (*.jpg, *.gif, *.bmp, *.png)|*.jpg;*.gif;*.bmp;*.png" +"All files (*.*)|*.*|Common images (*.jpg, *.gif, *.bmp, *.png)|*.jpg;*.gif;*." +"bmp;*.png" +msgstr "" +"All files (*.*)|*.*|Common images (*.jpg, *.gif, *.bmp, *.png)|*.jpg;*.gif;*." +"bmp;*.png" #. loaddataform..Caption #: loaddata.dfm:4 @@ -1141,7 +1147,9 @@ msgstr "Data" msgid "" "Database filter|A list of databases, separated by semicolon. Can contain " "regular expressions, e.g. \"mydb;test.*;project\\d+\"." -msgstr "Database filter|A list of databases, separated by semicolon. Can contain regular expressions, e.g. \"mydb;test.*;project\\d+\"." +msgstr "" +"Database filter|A list of databases, separated by semicolon. Can contain " +"regular expressions, e.g. \"mydb;test.*;project\\d+\"." #. MainForm..panelTop..pnlLeft..comboDBFilter..TextHint #: main.dfm:393 @@ -1363,7 +1371,7 @@ msgid "Rows" msgstr "Rows" #. MainForm..panelTop..pnlRight..PageControlMain..tabDatabase..ListTables......WideText -#: main.dfm:1116 +#: main.dfm:1116 tabletools.pas:1201 msgid "Created" msgstr "Created" @@ -1457,7 +1465,7 @@ msgstr "Sorting" #. MainForm..panelTop..pnlRight..PageControlMain..tabData..pnlDataTop..tlbDataButtons..tbtnDataColumns..Caption #. frmTableEditor..PageControlMain..tabForeignKeys..pnlNoForeignKeys..listForeignKeys......WideText -#: main.dfm:1298 table_editor.dfm:587 +#: main.dfm:1298 table_editor.dfm:587 copytable.pas:254 msgid "Columns" msgstr "Columns" @@ -2196,7 +2204,9 @@ msgstr "Reformat SQL" msgid "" "Automatically reformat disordered SQL in active editor to make it more " "readable" -msgstr "Automatically reformat disordered SQL in active editor to make it more readable" +msgstr "" +"Automatically reformat disordered SQL in active editor to make it more " +"readable" #. MainForm..ActionList1..actBlobAsText..Caption #. MainForm..ActionList1..actBlobAsText..Hint @@ -2395,6 +2405,15 @@ msgstr "SQL files (*.sql)|*.sql" msgid "SQL-Scripts (*.sql)|*.sql|All files (*.*)|*.*" msgstr "SQL-Scripts (*.sql)|*.sql|All files (*.*)|*.*" +#: tabletools.pas:1061 main.pas:2855 connections.pas:1047 +msgid "SQL files" +msgstr "SQL files" + +#: tabletools.pas:1061 main.pas:2855 main.pas:2653 bineditor.pas:146 +#: connections.pas:1047 connections.pas:1049 exportgrid.pas:274 +msgid "All files" +msgstr "All files" + #. MainForm..popupDataGrid..DataInsertValue..Caption #: main.dfm:8757 msgid "Insert value" @@ -2512,7 +2531,7 @@ msgid "Generate DELETE ..." msgstr "Generate DELETE ..." #. MainForm..popupRefresh..menuAutoRefresh..Caption -#: main.dfm:9270 +#: main.dfm:9270 main.pas:5308 msgid "Auto refresh" msgstr "Auto refresh" @@ -2556,7 +2575,9 @@ msgstr "Restore last used database on startup" msgid "" "Automatically check for updates / Interval [days]:\n" "(0 = each time the application is started)" -msgstr "Automatically check for updates / Interval [days]:\n(0 = each time the application is started)" +msgstr "" +"Automatically check for updates / Interval [days]:\n" +"(0 = each time the application is started)" #. optionsform..pagecontrolMain..tabMisc..chkUpdateCheckBuilds..Caption #: options.dfm:116 @@ -2569,7 +2590,10 @@ msgid "" "Count in usage statistics. This option, if enabled, will cause HeidiSQL to " "ping heidisql.com at most once every month. This is used to count the used " "HeidiSQL and MySQL versions." -msgstr "Count in usage statistics. This option, if enabled, will cause HeidiSQL to ping heidisql.com at most once every month. This is used to count the used HeidiSQL and MySQL versions." +msgstr "" +"Count in usage statistics. This option, if enabled, will cause HeidiSQL to " +"ping heidisql.com at most once every month. This is used to count the used " +"HeidiSQL and MySQL versions." #. optionsform..pagecontrolMain..tabMisc..chkAllowMultiInstances..Caption #: options.dfm:141 @@ -3197,7 +3221,7 @@ msgid "Convert data" msgstr "Convert data" #. frmTableEditor..PageControlMain..tabIndexes..Caption -#: table_editor.dfm:385 +#: table_editor.dfm:385 copytable.pas:255 msgid "Indexes" msgstr "Indexes" @@ -3243,7 +3267,7 @@ msgid "Down" msgstr "Down" #. frmTableEditor..PageControlMain..tabForeignKeys..Caption -#: table_editor.dfm:499 +#: table_editor.dfm:499 copytable.pas:256 msgid "Foreign keys" msgstr "Foreign keys" @@ -3444,27 +3468,27 @@ msgid "Load textfile" msgstr "Load textfile" #. frmTextEditor..popupLinebreaks..menuWindowsLB..Caption -#: texteditor.dfm:109 +#: texteditor.dfm:109 texteditor.pas:133 msgid "Windows linebreaks" msgstr "Windows linebreaks" #. frmTextEditor..popupLinebreaks..menuUnixLB..Caption -#: texteditor.dfm:114 +#: texteditor.dfm:114 texteditor.pas:134 msgid "UNIX linebreaks" msgstr "UNIX linebreaks" #. frmTextEditor..popupLinebreaks..menuMacLB..Caption -#: texteditor.dfm:119 +#: texteditor.dfm:119 texteditor.pas:135 msgid "Mac OS linebreaks" msgstr "Mac OS linebreaks" #. frmTextEditor..popupLinebreaks..menuWideLB..Caption -#: texteditor.dfm:124 +#: texteditor.dfm:124 texteditor.pas:136 msgid "Unicode linebreaks" msgstr "Unicode linebreaks" #. frmTextEditor..popupLinebreaks..menuMixedLB..Caption -#: texteditor.dfm:129 +#: texteditor.dfm:129 texteditor.pas:137 msgid "Mixed linebreaks" msgstr "Mixed linebreaks" @@ -3708,3 +3732,1588 @@ msgstr "Check option for updates" #: view.dfm:134 msgid "None" msgstr "None" + +#: about.pas:73 +msgid "Compiled on:" +msgstr "Compiled on:" + +#: bineditor.pas:175 texteditor.pas:259 +msgid "Apply modifications?" +msgstr "Apply modifications?" + +#: connections.pas:347 +msgid "Enter new session name ..." +msgstr "Enter new session name ..." + +#: connections.pas:351 +msgid "Clone session ..." +msgstr "Clone session ..." + +#: connections.pas:351 +msgid "New session name:" +msgstr "New session name:" + +#: connections.pas:355 +msgid "Session name \"%s\" already in use." +msgstr "Session name \"%s\" already in use." + +#: connections.pas:386 +msgid "" +"Imported sessions could not be detected. Restarting HeidiSQL may solve that." +msgstr "" +"Imported sessions could not be detected. Restarting HeidiSQL may solve that." + +#: connections.pas:440 +msgid "Delete session \"%s\"?" +msgstr "Delete session \"%s\"?" + +#: connections.pas:649 connections.pas:821 +msgid "Session \"%s\" already exists!" +msgstr "Session \"%s\" already exists!" + +#: connections.pas:658 +msgid "Error while moving registry key: %s" +msgstr "Error while moving registry key: %s" + +#: connections.pas:707 +msgid "" +"New here? In order to connect to a server, you have to create a so called " +"\"session\" at first. Just click the \"New\" button on the bottom left to " +"create your first session. Give it a friendly name (e.g. \"Local DB server" +"\") so you'll recall it the next time you start %s." +msgstr "" +"New here? In order to connect to a server, you have to create a so called " +"\"session\" at first. Just click the \"New\" button on the bottom left to " +"create your first session. Give it a friendly name (e.g. \"Local DB server" +"\") so you'll recall it the next time you start %s." + +#: connections.pas:711 +msgid "" +"Please click a session on the left list to edit parameters, doubleclick to " +"open it." +msgstr "" +"Please click a session on the left list to edit parameters, doubleclick to " +"open it." + +#: connections.pas:759 +msgid "unknown or never" +msgstr "unknown or never" + +#: connections.pas:765 +msgid "not available" +msgstr "not available" + +#: connections.pas:789 +msgid "Successful connects: %d" +msgstr "Successful connects: %d" + +#: connections.pas:791 +msgid "unsuccessful" +msgstr "unsuccessful" + +#: connections.pas:793 +msgid "Unsuccessful connects: %d" +msgstr "Unsuccessful connects: %d" + +#: connections.pas:954 +msgid "Save modifications?" +msgstr "Save modifications?" + +#: connections.pas:954 +msgid "Settings for \"%s\" were changed." +msgstr "Settings for \"%s\" were changed." + +#: connections.pas:984 +msgid "Socket name:" +msgstr "Socket name:" + +#: connections.pas:1049 +msgid "Executables" +msgstr "Executables" + +#: connections.pas:1051 +msgid "PuTTY private key" +msgstr "PuTTY private key" + +#: connections.pas:1053 +msgid "Privacy Enhanced Mail certificates" +msgstr "Privacy Enhanced Mail certificates" + +#: connections.pas:1053 +msgid "Certificates" +msgstr "Certificates" + +#: copytable.pas:138 +msgid "Neither table nor view: %s" +msgstr "Neither table nor view: %s" + +#: copytable.pas:257 +msgid "Data (%s rows)" +msgstr "Data (%s rows)" + +#: copytable.pas:376 +msgid "Target table exists. Drop it and overwrite?" +msgstr "Target table exists. Drop it and overwrite?" + +#: copytable.pas:384 +msgid "Generating SQL code ..." +msgstr "Generating SQL code ..." + +#: copytable.pas:475 +msgid "Creating table ..." +msgstr "Creating table ..." + +#: createdatabase.pas:98 +msgid "Alter database ..." +msgstr "Alter database ..." + +#: createdatabase.pas:196 +msgid "Creating database \"%s\" failed." +msgstr "Creating database \"%s\" failed." + +#: createdatabase.pas:220 +msgid "Database \"%s\" contains stored routine(s), which cannot be moved." +msgstr "Database \"%s\" contains stored routine(s), which cannot be moved." + +#: createdatabase.pas:226 +msgid "Database \"%s\" exists and has objects with same names as in \"%s\"" +msgstr "Database \"%s\" exists and has objects with same names as in \"%s\"" + +#: createdatabase.pas:236 +msgid "" +"Database \"%s\" exists. But it does not contain objects with same names as " +"in \"%s\", so it's uncritical to move everything. Move all objects to \"%s\"?" +msgstr "" +"Database \"%s\" exists. But it does not contain objects with same names as " +"in \"%s\", so it's uncritical to move everything. Move all objects to \"%s\"?" + +#: createdatabase.pas:265 +msgid "Altering database \"%s\" failed." +msgstr "Altering database \"%s\" failed." + +#: data_sorting.pas:161 +msgid "Toggle the sort direction for this column." +msgstr "Toggle the sort direction for this column." + +#: data_sorting.pas:174 +msgid "Drops sorting by this column." +msgstr "Drops sorting by this column." + +#: dbconnection.pas:669 +msgid "Error: Session \"%s\" not found in registry." +msgstr "Error: Session \"%s\" not found in registry." + +#: dbconnection.pas:680 +msgid "Broken \"NetType\" value (%d) found in settings for session \"%s\"." +msgstr "Broken \"NetType\" value (%d) found in settings for session \"%s\"." + +#: dbconnection.pas:681 +msgid "" +"Please report that on http://code.google.com/p/heidisql/issues/detail?id=2958" +msgstr "" +"Please report that on http://code.google.com/p/heidisql/issues/detail?id=2958" + +#. Comes into SQL log when assigning dll procedures from libmysql.dll +#: dbconnection.pas:1038 +msgid "Assign procedure \"%s\"" +msgstr "Assign procedure \"%s\"" + +#: dbconnection.pas:1047 +msgid "" +"Your %s is out-dated or somehow incompatible to %s. Please use the one from " +"the installer, or just reinstall %s." +msgstr "" +"Your %s is out-dated or somehow incompatible to %s. Please use the one from " +"the installer, or just reinstall %s." + +#: dbconnection.pas:1121 +msgid "SSL parameters successfully set." +msgstr "SSL parameters successfully set." + +#: dbconnection.pas:1151 +msgid "Attempt to create plink.exe process, waiting %ds for response ..." +msgstr "Attempt to create plink.exe process, waiting %ds for response ..." + +#: dbconnection.pas:1162 +msgid "PLink exited unexpected. Command line was: %s" +msgstr "PLink exited unexpected. Command line was: %s" + +#: dbconnection.pas:1165 +msgid "Could not execute PLink: %s" +msgstr "Could not execute PLink: %s" + +#: dbconnection.pas:1207 dbconnection.pas:1316 +msgid "Connected. Thread-ID: %d" +msgstr "Connected. Thread-ID: %d" + +#: dbconnection.pas:1286 +msgid "On Wine, you can try to install MDAC:" +msgstr "On Wine, you can try to install MDAC:" + +#: dbconnection.pas:1343 +msgid "OLE DB property \"%s\": %s" +msgstr "OLE DB property \"%s\": %s" + +#: dbconnection.pas:1389 +msgid "Loading library file %s ..." +msgstr "Loading library file %s ..." + +#: dbconnection.pas:1392 +msgid "" +"Cannot find a usable %s. Please launch %s from the directory where you have " +"installed it." +msgstr "" +"Cannot find a usable %s. Please launch %s from the directory where you have " +"installed it." + +#: dbconnection.pas:1430 +msgid "Login to %s:" +msgstr "Login to %s:" + +#: dbconnection.pas:1442 +msgid "Connecting to %s via %s, username %s, using password: %s ..." +msgstr "Connecting to %s via %s, username %s, using password: %s ..." + +#: dbconnection.pas:1530 dbconnection.pas:1553 +msgid "Ping server ..." +msgstr "Ping server ..." + +#: dbconnection.pas:1582 +msgid "Closing plink.exe process #%d ..." +msgstr "Closing plink.exe process #%d ..." + +#: dbconnection.pas:1600 dbconnection.pas:1706 +msgid "Waiting for running query to finish ..." +msgstr "Waiting for running query to finish ..." + +#: dbconnection.pas:1654 dbconnection.pas:1749 +msgid "Database \"%s\" selected" +msgstr "Database \"%s\" selected" + +#: dbconnection.pas:1820 +msgid "Unhandled list node type in %s.GetCreateCode" +msgstr "Unhandled list node type in %s.GetCreateCode" + +#: dbconnection.pas:2193 +msgid "Database names not available due to missing privileges for user %s." +msgstr "Database names not available due to missing privileges for user %s." + +#: dbconnection.pas:2625 +msgid "" +"The server did not return a non-zero value for the max_allowed_packet " +"variable. Assuming 1M now." +msgstr "" +"The server did not return a non-zero value for the max_allowed_packet " +"variable. Assuming 1M now." + +#: dbconnection.pas:2757 +msgid "Not implemented for this DBMS" +msgstr "Not implemented for this DBMS" + +#: dbconnection.pas:3180 +msgid "Real Hostname" +msgstr "Real Hostname" + +#: dbconnection.pas:3181 tabletools.pas:1199 +msgid "Server OS" +msgstr "Server OS" + +#: dbconnection.pas:3182 tabletools.pas:1198 +msgid "Server version" +msgstr "Server version" + +#: dbconnection.pas:3183 +msgid "Connection port" +msgstr "Connection port" + +#: dbconnection.pas:3184 +msgid "Compressed protocol" +msgstr "Compressed protocol" + +#: dbconnection.pas:3185 +msgid "Unicode enabled" +msgstr "Unicode enabled" + +#: dbconnection.pas:3186 +msgid "SSL enabled" +msgstr "SSL enabled" + +#: dbconnection.pas:3191 +msgid "Client version (libmysql)" +msgstr "Client version (libmysql)" + +#: dbconnection.pas:3494 +msgid "" +"Regular expression did not match the VIEW code in ParseViewStructure(): %s" +msgstr "" +"Regular expression did not match the VIEW code in ParseViewStructure(): %s" + +#: dbconnection.pas:3909 +msgid "Unknown data type for column #%d - %s: %d" +msgstr "Unknown data type for column #%d - %s: %d" + +#: dbconnection.pas:4144 +msgid "Column \"%s\" not available." +msgstr "Column \"%s\" not available." + +#: dbconnection.pas:4577 +msgid "Internal error: Cannot post modifications before editing was prepared." +msgstr "Internal error: Cannot post modifications before editing was prepared." + +#: dbconnection.pas:4781 +msgid "More than one table involved." +msgstr "More than one table involved." + +#: dbconnection.pas:4788 dbconnection.pas:4812 +msgid "Could not determine name of table." +msgstr "Could not determine name of table." + +#: dbconnection.pas:4859 +msgid "Column #%d has an undefined origin: %s" +msgstr "Column #%d has an undefined origin: %s" + +#: dbconnection.pas:4877 +msgid "Cannot compose WHERE clause - column missing: %s" +msgstr "Cannot compose WHERE clause - column missing: %s" + +#: dbconnection.pas:5043 +msgid "Unknown, should never appear" +msgstr "Unknown, should never appear" + +#: dbconnection.pas:5316 +msgid "Unsupported type (%d) in mysql_authentication_dialog_ask." +msgstr "Unsupported type (%d) in mysql_authentication_dialog_ask." + +#: editvar.pas:90 +msgid "Could not find %s variable in internal mapping." +msgstr "Could not find %s variable in internal mapping." + +#: exportgrid.pas:73 +msgid "Excel CSV" +msgstr "Excel CSV" + +#: exportgrid.pas:345 +msgid "Selection (%d rows, %s)" +msgstr "Selection (%d rows, %s)" + +#: exportgrid.pas:346 +msgid "Complete (%d rows, %s)" +msgstr "Complete (%d rows, %s)" + +#: exportgrid.pas:422 +msgid "File exists" +msgstr "File exists" + +#: exportgrid.pas:422 +msgid "Overwrite file %s?" +msgstr "Overwrite file %s?" + +#: exportgrid.pas:595 +msgid "Exporting row %s of %s (%d%%, %s)" +msgstr "Exporting row %s of %s (%d%%, %s)" + +#: exportgrid.pas:790 +msgid "Freeing data..." +msgstr "Freeing data..." + +#: grideditlinks.pas:218 +msgid "" +"Wrong constructor called: %s.Create. Instead, please call the overloaded " +"version %s.Create(VirtualStringTree)." +msgstr "" +"Wrong constructor called: %s.Create. Instead, please call the overloaded " +"version %s.Create(VirtualStringTree)." + +#: grideditlinks.pas:1022 +msgid "Edit text in popup editor ..." +msgstr "Edit text in popup editor ..." + +#: grideditlinks.pas:1156 +msgid "No default value" +msgstr "No default value" + +# grideditlinks.pas:1165 +# TODO: rephrase +# msgid "Custom:" +# msgstr "Custom:" +#: helpers.pas:1045 +msgid "days" +msgstr "days" + +#: helpers.pas:1728 +msgid "%s month ago" +msgstr "%s month ago" + +#: helpers.pas:1728 +msgid "%s months ago" +msgstr "%s months ago" + +#: helpers.pas:1728 +msgid "%s day ago" +msgstr "%s day ago" + +#: helpers.pas:1728 +msgid "%s days ago" +msgstr "%s days ago" + +#: helpers.pas:1728 +msgid "%s hour ago" +msgstr "%s hour ago" + +#: helpers.pas:1728 +msgid "%s hours ago" +msgstr "%s hours ago" + +#: helpers.pas:1728 +msgid "%s minute ago" +msgstr "%s minute ago" + +#: helpers.pas:1728 +msgid "%s minutes ago" +msgstr "%s minutes ago" + +#: helpers.pas:1728 +msgid "less than a minute ago" +msgstr "less than a minute ago" + +#: helpers.pas:1922 +msgid "Initializing editor ..." +msgstr "Initializing editor ..." + +#: helpers.pas:1964 +msgid "Save modified %s \"%s\"?" +msgstr "Save modified %s \"%s\"?" + +#: helpers.pas:1966 +msgid "Save new %s?" +msgstr "Save new %s?" + +#: helpers.pas:2821 +msgid "Could not open URL: %s" +msgstr "Could not open URL: %s" + +#: helpers.pas:2829 +msgid "Server did not send required \"Content-Length\" header: %s" +msgstr "Server did not send required \"Content-Length\" header: %s" + +#: helpers.pas:2837 +msgid "Got HTTP status %d from %s" +msgstr "Got HTTP status %d from %s" + +#: helpers.pas:3251 +msgid "No path set, won't delete root key %s" +msgstr "No path set, won't delete root key %s" + +#: helpers.pas:3266 +msgid "No path set, won't move root key %s" +msgstr "No path set, won't move root key %s" + +#: helpers.pas:3332 +msgid "Attempt to read session setting without session path" +msgstr "Attempt to read session setting without session path" + +#: helpers.pas:3406 +msgid "Attempt to write session setting without session path" +msgstr "Attempt to write session setting without session path" + +#: insertfiles.pas:488 +msgid "%u files, %s, %u files selected." +msgstr "%u files, %s, %u files selected." + +#: loaddata.pas:176 +msgid "Let server/database decide" +msgstr "Let server/database decide" + +#: loaddata.pas:201 +msgid "Unsupported by this server" +msgstr "Unsupported by this server" + +#: loaddata.pas:315 +msgid "" +"Your file was imported but the server returned %s warnings and/or notes. See " +"the log panel for details." +msgstr "" +"Your file was imported but the server returned %s warnings and/or notes. See " +"the log panel for details." + +#: loaddata.pas:321 +msgid "No rows were imported" +msgstr "No rows were imported" + +#: loaddata.pas:322 +msgid "This can have several causes:" +msgstr "This can have several causes:" + +#: loaddata.pas:323 +msgid " - File is empty" +msgstr " - File is empty" + +#: loaddata.pas:324 +msgid " - Wrong file encoding was selected or detected" +msgstr " - Wrong file encoding was selected or detected" + +#: loaddata.pas:325 +msgid " - Field and/or line terminator do not fit to the file contents" +msgstr " - Field and/or line terminator do not fit to the file contents" + +#: loaddata.pas:428 +msgid "Importing textfile, row %s, %d%%" +msgstr "Importing textfile, row %s, %d%%" + +#: loaddata.pas:532 +msgid "Reading textfile (%s) ..." +msgstr "Reading textfile (%s) ..." + +#: loaddata.pas:588 +msgid "" +"MySQL CSV files (*.csv)|*.csv|Text files (*.txt)|*.txt|All files (*.*)|*.*" +msgstr "" +"MySQL CSV files (*.csv)|*.csv|Text files (*.txt)|*.txt|All files (*.*)|*.*" + +#: loaddata.pas:588 +msgid "CSV files" +msgstr "CSV files" + +#: loaddata.pas:588 +msgid "Text files" +msgstr "Text files" + +#: main.pas:1181 +msgid "" +"Tables have been flushed and read lock acquired. Perform backup or snapshot " +"of table data files now. Press OK to unlock when done..." +msgstr "" +"Tables have been flushed and read lock acquired. Perform backup or snapshot " +"of table data files now. Press OK to unlock when done..." + +#: main.pas:1496 +msgid "Show next %s rows ..." +msgstr "Show next %s rows ..." + +#: main.pas:1497 +msgid "About %s" +msgstr "About %s" + +#: main.pas:1582 +msgid "Auto detect (may fail)" +msgstr "Auto detect (may fail)" + +#: main.pas:2071 +msgid "Export %s settings to file ..." +msgstr "Export %s settings to file ..." + +#: main.pas:2078 +msgid "Settings successfully exported to %s" +msgstr "Settings successfully exported to %s" + +#: main.pas:2092 +msgid "Import %s settings from file ..." +msgstr "Import %s settings from file ..." + +#: main.pas:2093 +msgid "Registry dump, deprecated" +msgstr "Registry dump, deprecated" + +#: main.pas:2101 +msgid "Settings successfully restored from %s" +msgstr "Settings successfully restored from %s" + +#: main.pas:2142 +msgid "Splitting SQL queries ..." +msgstr "Splitting SQL queries ..." + +#: main.pas:2166 +msgid "" +"Query profiling requires MySQL 5.0.37 or later, and the server must not be " +"configured with --disable-profiling." +msgstr "" +"Query profiling requires MySQL 5.0.37 or later, and the server must not be " +"configured with --disable-profiling." + +#: main.pas:2185 +msgid "query" +msgstr "query" + +#: main.pas:2186 +msgid "queries #%s to #%s" +msgstr "queries #%s to #%s" + +#: main.pas:2187 +msgid "Executing %s of %s ..." +msgstr "Executing %s of %s ..." + +#: main.pas:2203 +msgid "Setting up result grid(s) ..." +msgstr "Setting up result grid(s) ..." + +#: main.pas:2220 +msgid "Result" +msgstr "Result" + +#: main.pas:2310 +msgid "Found rows" +msgstr "Found rows" + +#: main.pas:2310 +msgid "Warnings" +msgstr "Warnings" + +#: main.pas:2310 +msgid "Duration for" +msgstr "Duration for" + +#: main.pas:2346 +msgid "Your query produced %s warnings." +msgstr "Your query produced %s warnings." + +#: main.pas:2351 +msgid "Warnings from last query:" +msgstr "Warnings from last query:" + +#: main.pas:2352 +msgid "First %s warnings:" +msgstr "First %s warnings:" + +#: main.pas:2361 +msgid "Show all warnings in a new query tab?" +msgstr "Show all warnings in a new query tab?" + +#: main.pas:2364 +msgid "" +"The server variable @@max_error_count is currently set to %d, so you won't " +"see all warnings." +msgstr "" +"The server variable @@max_error_count is currently set to %d, so you won't " +"see all warnings." + +#: main.pas:2379 +msgid "Updating query history ..." +msgstr "Updating query history ..." + +#: main.pas:2557 +msgid "Loading contents into image viewer ..." +msgstr "Loading contents into image viewer ..." + +#: main.pas:2558 +msgid "Loading ..." +msgstr "Loading ..." + +#: main.pas:2611 +msgid "No image detected." +msgstr "No image detected." + +#: main.pas:2711 +msgid "Drop Database \"%s\"?" +msgstr "Drop Database \"%s\"?" + +#: main.pas:2711 +msgid "WARNING: You will lose all objects in database %s!" +msgstr "WARNING: You will lose all objects in database %s!" + +#: main.pas:2753 +msgid "Drop %d object(s) in database \"%s\"?" +msgstr "Drop %d object(s) in database \"%s\"?" + +#: main.pas:2712 +msgid "WARNING: You will lose all objects in database %s" +msgstr "WARNING: You will lose all objects in database %s" + +#: main.pas:2790 +msgid "Command line only works on MySQL connections." +msgstr "Command line only works on MySQL connections." + +#: main.pas:2802 +msgid "" +"You need to tell %s where your MySQL binaries reside, in Tools > Preferences " +"> Miscellaneous." +msgstr "" +"You need to tell %s where your MySQL binaries reside, in Tools > Preferences " +"> Miscellaneous." + +#: main.pas:2803 +msgid "Current setting is: \"%s\"" +msgstr "Current setting is: \"%s\"" + +#: main.pas:2836 +msgid "Launching command line: %s" +msgstr "Launching command line: %s" + +#: main.pas:2916 +msgid "Opening large files" +msgstr "Opening large files" + +#: main.pas:2917 +msgid "Selected files have a size of %s" +msgstr "Selected files have a size of %s" + +#: main.pas:2918 +msgid "File list" +msgstr "File list" + +#: main.pas:2924 +msgid "Run file(s) directly" +msgstr "Run file(s) directly" + +#: main.pas:2925 +msgid "... without loading into the editor" +msgstr "... without loading into the editor" + +#: main.pas:2928 +msgid "Load file(s) into the editor" +msgstr "Load file(s) into the editor" + +#: main.pas:2929 +msgid "Can cause large memory usage" +msgstr "Can cause large memory usage" + +#: main.pas:2937 +msgid "One or more of the selected files are larger than %s:" +msgstr "One or more of the selected files are larger than %s:" + +#: main.pas:2940 +msgid "" +"Just run these files to avoid loading them into the query-editor (= memory)?" +msgstr "" +"Just run these files to avoid loading them into the query-editor (= memory)?" + +#: main.pas:2941 +msgid "Press" +msgstr "Press" + +#: main.pas:2942 +msgid " [Yes] to run file(s) without loading it into the editor" +msgstr " [Yes] to run file(s) without loading it into the editor" + +#: main.pas:2943 +msgid " [No] to load file(s) into the query editor" +msgstr " [No] to load file(s) into the query editor" + +#: main.pas:2944 +msgid " [Cancel] to cancel file opening." +msgstr " [Cancel] to cancel file opening." + +#: main.pas:2945 +msgid "Execute query file(s)?" +msgstr "Execute query file(s)?" + +#: main.pas:2968 +msgid "Could not load file(s):" +msgstr "Could not load file(s):" + +#: main.pas:3088 +msgid "Startup script file not found: %s" +msgstr "Startup script file not found: %s" + +#: main.pas:3102 +msgid "SSL not used." +msgstr "SSL not used." + +#: main.pas:3103 +msgid "" +"Your SSL settings were not accepted by the server, or the server does not " +"support any SSL configuration." +msgstr "" +"Your SSL settings were not accepted by the server, or the server does not " +"support any SSL configuration." + +#: main.pas:3127 +msgid "No rows selected" +msgstr "No rows selected" + +#: main.pas:3127 +msgid "Please select one or more rows to delete them." +msgstr "Please select one or more rows to delete them." + +#: main.pas:3136 +msgid "Delete %s row(s)?" +msgstr "Delete %s row(s)?" + +#: main.pas:3136 +msgid "Deleting row #%s of %s ..." +msgstr "Deleting row #%s of %s ..." + +#: main.pas:3146 +msgid "Clean up ..." +msgstr "Clean up ..." + +#: main.pas:3163 main.pas:3909 main.pas:7878 +msgid "Grid editing error" +msgstr "Grid editing error" + +#: main.pas:3227 +msgid "No table(s) selected." +msgstr "No table(s) selected." + +#: main.pas:3228 +msgid "Empty %d table(s) and/or view(s)?" +msgstr "Empty %d table(s) and/or view(s)?" + +#: main.pas:3285 +msgid "No stored procedure selected." +msgstr "No stored procedure selected." + +#: main.pas:3285 +msgid "Please select one or more stored function(s) or routine(s)." +msgstr "Please select one or more stored function(s) or routine(s)." + +#: main.pas:3304 +msgid "Parameter" +msgstr "Parameter" + +#: main.pas:3389 +msgid "Searching ..." +msgstr "Searching ..." + +#: main.pas:3399 +msgid "Text \"%s\" %s times replaced." +msgstr "Text \"%s\" %s times replaced." + +#: main.pas:3403 +msgid "Text \"%s\" not found." +msgstr "Text \"%s\" not found." + +#: main.pas:3412 +msgid "Replace this occurrence of \"%s\"?" +msgstr "Replace this occurrence of \"%s\"?" + +#: main.pas:3513 +msgid "SQL help not available." +msgstr "SQL help not available." + +#: main.pas:3513 +msgid "HELP requires MySQL 4.1 or newer." +msgstr "HELP requires MySQL 4.1 or newer." + +#: main.pas:3531 routine_editor.pas:474 +msgid "Overwrite \"%s\"?" +msgstr "Overwrite \"%s\"?" + +#: main.pas:3531 +msgid "This file is already open in query tab #%d." +msgstr "This file is already open in query tab #%d." + +#: main.pas:3575 +msgid "Save snippet" +msgstr "Save snippet" + +#: main.pas:3575 +msgid "Snippet name:" +msgstr "Snippet name:" + +#: main.pas:3583 +msgid "Overwrite existing snippet %s?" +msgstr "Overwrite existing snippet %s?" + +#: main.pas:3669 +msgid "Remove absent files" +msgstr "Remove absent files" + +#: main.pas:3674 +msgid "Clear file list" +msgstr "Clear file list" + +#: main.pas:3775 +msgid "Set delimiter" +msgstr "Set delimiter" + +#: main.pas:3775 +msgid "SQL statement delimiter (default is \";\"):" +msgstr "SQL statement delimiter (default is \";\"):" + +#: main.pas:3798 +msgid "Empty value." +msgstr "Empty value." + +#: main.pas:3803 +msgid "Start-of-comment tokens or string literal markers are not allowed." +msgstr "Start-of-comment tokens or string literal markers are not allowed." + +#: main.pas:3806 +msgid "Error setting delimiter to \"%s\": %s" +msgstr "Error setting delimiter to \"%s\": %s" + +#: main.pas:3811 +msgid "Delimiter changed to %s" +msgstr "Delimiter changed to %s" + +#: main.pas:4058 +msgid "large SQL query (%s), snipped at %s characters" +msgstr "large SQL query (%s), snipped at %s characters" + +#: main.pas:4094 +msgid "Error writing to session log file." +msgstr "Error writing to session log file." + +#: main.pas:4094 main.pas:6415 +msgid "Logging is disabled now." +msgstr "Logging is disabled now." + +#: main.pas:4309 +msgid "Fetching rows ..." +msgstr "Fetching rows ..." + +#: main.pas:4322 +msgid "Data in this table will be read-only." +msgstr "Data in this table will be read-only." + +#: main.pas:4332 +msgid "Setting up columns ..." +msgstr "Setting up columns ..." + +#: main.pas:4390 main.pas:4389 +msgid "" +"Browsing is currently limited to a maximum of %s rows. To see more rows, " +"increase this maximum in Tools > Preferences > Data." +msgstr "" +"Browsing is currently limited to a maximum of %s rows. To see more rows, " +"increase this maximum in Tools > Preferences > Data." + +#: main.pas:4439 +msgid "rows total" +msgstr "rows total" + +#: main.pas:4439 +msgid "approximately" +msgstr "approximately" + +#: main.pas:4439 +msgid "limited to" +msgstr "limited to" + +#: main.pas:4442 +msgid "all rows match to filter" +msgstr "all rows match to filter" + +#: main.pas:4442 +msgid "rows match to filter" +msgstr "rows match to filter" + +#: main.pas:4558 +msgid "Displaying objects from \"%s\" ..." +msgstr "Displaying objects from \"%s\" ..." + +#: main.pas:4784 +msgid "Ignoring own process id #%s when trying to kill it." +msgstr "Ignoring own process id #%s when trying to kill it." + +#: main.pas:5158 +msgid "Uptime" +msgstr "Uptime" + +#: main.pas:5158 connections.pas:762 +msgid "unknown" +msgstr "unknown" + +#: main.pas:5261 +msgid "Specify filter-value..." +msgstr "Specify filter-value..." + +#: main.pas:5308 +msgid "Refresh list every ... second(s):" +msgstr "Refresh list every ... second(s):" + +#: main.pas:5315 +msgid "Seconds must be between 0 and %d." +msgstr "Seconds must be between 0 and %d." + +#: main.pas:5410 +msgid "Unspecified source control in drag'n drop operation!" +msgstr "Unspecified source control in drag'n drop operation!" + +#: main.pas:5783 +msgid "Fetching distinct values ..." +msgstr "Fetching distinct values ..." + +#: main.pas:5819 +msgid "UNIX Timestamp" +msgstr "UNIX Timestamp" + +#: main.pas:5824 +msgid "Default value" +msgstr "Default value" + +msgid "Table node \"%s\" not found in tree." +msgstr "Table node \"%s\" not found in tree." + +#: main.pas:6090 +msgid "Delete snippet file?" +msgstr "Delete snippet file?" + +#: main.pas:6099 +msgid "Failed deleting %s" +msgstr "Failed deleting %s" + +#: main.pas:6135 +msgid "Snippets folder does not exist" +msgstr "Snippets folder does not exist" + +#: main.pas:6135 +msgid "The folder \"%s\" is normally created when you install %s." +msgstr "The folder \"%s\" is normally created when you install %s." + +#: main.pas:6135 +msgid "Shall it be created now?" +msgstr "Shall it be created now?" + +#: main.pas:6153 +msgid "Clear query history?" +msgstr "Clear query history?" + +#: main.pas:6153 +msgid "%s history items will be deleted." +msgstr "%s history items will be deleted." + +#: main.pas:6415 +msgid "Error opening session log file" +msgstr "Error opening session log file" + +#: main.pas:6418 +msgid "Writing to session log file now: %s" +msgstr "Writing to session log file now: %s" + +#: main.pas:6427 +msgid "Writing to session log file disabled now" +msgstr "Writing to session log file disabled now" + +#: main.pas:6577 +msgid "Please select a process in the above list." +msgstr "Please select a process in the above list." + +#: main.pas:6990 +msgid "Reading Databases..." +msgstr "Reading Databases..." + +#: main.pas:7005 +msgid "Reading objects ..." +msgstr "Reading objects ..." + +#: main.pas:7192 +msgid "Entering session \"%s\"" +msgstr "Entering session \"%s\"" + +#: main.pas:7454 +msgid "Could not find node to focus." +msgstr "Could not find node to focus." + +#: main.pas:7870 +msgid "Could not load full row data." +msgstr "Could not load full row data." + +#: main.pas:8462 +msgid "Not available on %s" +msgstr "Not available on %s" + +#: main.pas:9579 +msgid "Save changes to file %s ?" +msgstr "Save changes to file %s ?" + +#: main.pas:9581 +msgid "Save content of tab \"%s\"?" +msgstr "Save content of tab \"%s\"?" + +#: main.pas:9582 +msgid "Modified query" +msgstr "Modified query" + +#: main.pas:9732 +msgid "" +"Could not apply SynEdit keystroke shortcut \"%s\" (or secondary: \"%s\") to " +"%s. %s. Please go to Tools > Preferences > Shortcuts to change this settings." +msgstr "" +"Could not apply SynEdit keystroke shortcut \"%s\" (or secondary: \"%s\") to " +"%s. %s. Please go to Tools > Preferences > Shortcuts to change this settings." + +#: main.pas:9759 +msgid "Cannot reformat" +msgstr "Cannot reformat" + +#: main.pas:9759 +msgid "Please select a non-readonly SQL editor first." +msgstr "Please select a non-readonly SQL editor first." + +#: main.pas:9768 +msgid "The current editor is empty." +msgstr "The current editor is empty." + +#: main.pas:9950 +msgid "" +"Preventing second application instance - disabled in Tools > Preferences > " +"Miscellaneous." +msgstr "" +"Preventing second application instance - disabled in Tools > Preferences > " +"Miscellaneous." + +#: main.pas:10047 +msgid "Sorting grid nodes ..." +msgstr "Sorting grid nodes ..." + +#: main.pas:10074 +msgid "Sorting cancelled." +msgstr "Sorting cancelled." + +#: main.pas:10075 +msgid "Helper connection" +msgstr "Helper connection" + +#: main.pas:10375 +msgid "Parameters in %s" +msgstr "Parameters in %s" + +#: main.pas:10376 +msgid "Columns in %s" +msgstr "Columns in %s" + +#: main.pas:10379 +msgid "SQL functions" +msgstr "SQL functions" + +#: main.pas:10380 +msgid "SQL keywords" +msgstr "SQL keywords" + +#: main.pas:10382 +msgid "Query history" +msgstr "Query history" + +#: main.pas:10384 +msgid "Query profile" +msgstr "Query profile" + +#: main.pas:10404 +msgid "today" +msgstr "today" + +#: main.pas:10406 +msgid "yesterday" +msgstr "yesterday" + +#: main.pas:10548 +msgid "Error with snippets directory: %s" +msgstr "Error with snippets directory: %s" + +#: main.pas:10790 +msgid "Close file and query tab?" +msgstr "Close file and query tab?" + +#: main.pas:10790 +msgid "File was deleted from outside: %s" +msgstr "File was deleted from outside: %s" + +#: main.pas:10822 +msgid "Reload file?" +msgstr "Reload file?" + +#: main.pas:10822 +msgid "File was modified from outside: %s" +msgstr "File was modified from outside: %s" + +#: main.pas:10845 +msgid "Loading file \"%s\" (%s) into query tab #%d" +msgstr "Loading file \"%s\" (%s) into query tab #%d" + +#: main.pas:10870 +msgid "" +"This file contains mixed linebreaks. They have been converted to Windows " +"linebreaks (CR+LF)." +msgstr "" +"This file contains mixed linebreaks. They have been converted to Windows " +"linebreaks (CR+LF)." + +#: main.pas:10891 +msgid "Saving file ..." +msgstr "Saving file ..." + +#: options.pas:386 +msgid "Active line background" +msgstr "Active line background" + +#: options.pas:395 +msgid "SQL editing" +msgstr "SQL editing" + +#: options.pas:527 tabletools.pas:1070 +msgid "Select output directory" +msgstr "Select output directory" + +#: options.pas:545 +msgid "Find mysql.exe directory" +msgstr "Find mysql.exe directory" + +#: options.pas:661 +msgid "Reset all preference options to default values?" +msgstr "Reset all preference options to default values?" + +#: options.pas:662 +msgid "This also applies to automatic settings, e.g. toolbar positions." +msgstr "This also applies to automatic settings, e.g. toolbar positions." + +#: routine_editor.pas:109 +msgid "Procedure (doesn't return a result)" +msgstr "Procedure (doesn't return a result)" + +#: routine_editor.pas:110 +msgid "Function (returns a result)" +msgstr "Function (returns a result)" + +#: routine_editor.pas:156 view.pas:70 trigger_editor.pas:89 +msgid "Current user (%s)" +msgstr "Current user (%s)" + +#: routine_editor.pas:157 view.pas:71 trigger_editor.pas:90 +msgid "Leave empty for current user (%s)" +msgstr "Leave empty for current user (%s)" + +#: routine_editor.pas:411 +msgid "" +"A stored function can only have IN parameters so context editing is blocked." +msgstr "" +"A stored function can only have IN parameters so context editing is blocked." + +#: routine_editor.pas:474 +msgid "Routine \"%s\" already exists." +msgstr "Routine \"%s\" already exists." + +#: runsqlfile.pas:138 +msgid "Error while reading file \"%s\"" +msgstr "Error while reading file \"%s\"" + +#: searchreplace.pas:60 +msgid "Search patterns:" +msgstr "Search patterns:" + +#: searchreplace.pas:60 +msgid "Start of line" +msgstr "Start of line" + +#: searchreplace.pas:60 +msgid "End of lin" +msgstr "End of lin" + +#: searchreplace.pas:60 +msgid "Any word characte" +msgstr "Any word characte" + +#: searchreplace.pas:60 +msgid "Digit" +msgstr "Digit" + +#: searchreplace.pas:60 +msgid "Whitespace" +msgstr "Whitespace" + +#: searchreplace.pas:60 +msgid "Replacement patterns:" +msgstr "Replacement patterns:" + +#: searchreplace.pas:60 +msgid "Callback parentheses" +msgstr "Callback parentheses" + +#: sqlhelp.pas:140 +msgid "No help available for this keyword or no keyword was selected." +msgstr "No help available for this keyword or no keyword was selected." + +#: sqlhelp.pas:142 +msgid "No example available or no keyword was selected." +msgstr "No example available or no keyword was selected." + +#: syncdb.pas:126 +msgid "Select server session ..." +msgstr "Select server session ..." + +#: syncdb.pas:153 syncdb.pas:182 +msgid "Same as source" +msgstr "Same as source" + +#: syncdb.pas:427 +msgid "Create missing %s" +msgstr "Create missing %s" + +#. TODO +#: tabletools.pas:155 +msgid "Skipped" +msgstr "Skipped" + +#. TODO +#: tabletools.pas:156 +msgid "One big file" +msgstr "One big file" + +#. TODO +#: tabletools.pas:158 +msgid "Directory - one file per object in database subdirectories" +msgstr "Directory - one file per object in database subdirectories" + +#. TODO +#: tabletools.pas:161 +msgid "No data" +msgstr "No data" + +#. TODO +#: tabletools.pas:162 +msgid "truncate existing data" +msgstr "truncate existing data" + +#. TODO +#: tabletools.pas:164 +msgid "do not update existing" +msgstr "do not update existing" + +#. TODO +#: tabletools.pas:165 +msgid "existing data" +msgstr "existing data" + +#: tabletools.pas:192 +msgid "All data types" +msgstr "All data types" + +#: tabletools.pas:370 +msgid "Selected objects size: %s" +msgstr "Selected objects size: %s" + +#: tabletools.pas:725 +msgid "%s%s doesn't have columns of selected type (%s)." +msgstr "%s%s doesn't have columns of selected type (%s)." + +#: tabletools.pas:850 +msgid "Selected objects size: %s. %s%% done." +msgstr "Selected objects size: %s. %s%% done." + +#: tabletools.pas:986 +msgid "Same as on source server" +msgstr "Same as on source server" + +#: tabletools.pas:1046 +msgid "Processing cancelled by user, waiting for current object to finish ..." +msgstr "Processing cancelled by user, waiting for current object to finish ..." + +#: tabletools.pas:1219 +msgid "Dumping database structure for %s" +msgstr "Dumping database structure for %s" + +#: tabletools.pas:1242 +msgid "Dumping structure for %s %s.%s" +msgstr "Dumping structure for %s %s.%s" + +#: tabletools.pas:1283 +msgid "Creating temporary table to overcome VIEW dependency errors" +msgstr "Creating temporary table to overcome VIEW dependency errors" + +#: tabletools.pas:1298 +msgid "Removing temporary table and create final VIEW structure" +msgstr "Removing temporary table and create final VIEW structure" + +#: tabletools.pas:1361 +msgid "Data exporting was unselected." +msgstr "Data exporting was unselected." + +#: tabletools.pas:1363 +msgid "" +"Table data not exported because this is a %s table which holds its data in " +"separate tables." +msgstr "" +"Table data not exported because this is a %s table which holds its data in " +"separate tables." + +#: tabletools.pas:1368 +msgid "Dumping data for table %s.%s: %s" +msgstr "Dumping data for table %s.%s: %s" + +#: tabletools.pas:1539 +msgid "Done" +msgstr "Done" + +#: tabletools.pas:1540 +msgid "Success" +msgstr "Success" + +#: tabletools.pas:1542 +msgid "Nothing to do" +msgstr "Nothing to do" + +#: tabletools.pas:1543 +msgid "Selected operations cannot be applied to a %s" +msgstr "Selected operations cannot be applied to a %s" + +#: tabletools.pas:1563 +msgid "Unhandled tree level" +msgstr "Unhandled tree level" + +#: table_editor.pas:476 +msgid "Composing ALTER statement ..." +msgstr "Composing ALTER statement ..." + +#: table_editor.pas:1041 +msgid "No default" +msgstr "No default" + +#: table_editor.pas:1137 +msgid "Column \"%s\" already exists." +msgstr "Column \"%s\" already exists." + +#: table_editor.pas:1758 +msgid "Add duplicated column to index?" +msgstr "Add duplicated column to index?" + +#: table_editor.pas:1758 +msgid "" +"Index \"%s\" already contains the column \"%s\". It is possible to add a " +"column twice into a index, but total nonsense in practice." +msgstr "" +"Index \"%s\" already contains the column \"%s\". It is possible to add a " +"column twice into a index, but total nonsense in practice." + +#: table_editor.pas:1815 +msgid "The selected table engine (%s) does not support foreign keys." +msgstr "The selected table engine (%s) does not support foreign keys." + +#: table_editor.pas:1946 +msgid "Key already exists. Really create another identical one?" +msgstr "Key already exists. Really create another identical one?" + +#: table_editor.pas:1947 +msgid "" +"This will increase disk usage and probably slow down queries on this table." +msgstr "" +"This will increase disk usage and probably slow down queries on this table." + +#: table_editor.pas:2056 +msgid "Please select a reference table before selecting foreign columns." +msgstr "Please select a reference table before selecting foreign columns." + +#: table_editor.pas:2063 +msgid "Reference table \"%s\" seems to be missing, broken or non-accessible." +msgstr "Reference table \"%s\" seems to be missing, broken or non-accessible." + +#: trigger_editor.pas:122 +msgid "Trigger definition not found!" +msgstr "Trigger definition not found!" + +#: updatecheck.pas:76 +msgid "Initializing" +msgstr "Initializing" + +#: updatecheck.pas:77 +msgid "Check for %s updates" +msgstr "Check for %s updates" + +#: updatecheck.pas:93 +msgid "Downloading check file" +msgstr "Downloading check file" + +#: updatecheck.pas:95 +msgid "Reading check file" +msgstr "Reading check file" + +#: updatecheck.pas:100 +msgid "Error: Cannot determine current revision. Using a developer version?" +msgstr "Error: Cannot determine current revision. Using a developer version?" + +#: updatecheck.pas:102 +msgid "Your %s is up-to-date (no update available)." +msgstr "Your %s is up-to-date (no update available)." + +#: updatecheck.pas:104 +msgid "Updates available." +msgstr "Updates available." + +#: updatecheck.pas:147 +msgid "Version %s (yours: %s)" +msgstr "Version %s (yours: %s)" + +#: updatecheck.pas:148 +msgid "Released: %s" +msgstr "Released: %s" + +#: updatecheck.pas:152 +msgid "Download version %s" +msgstr "Download version %s" + +#: updatecheck.pas:168 +msgid "Revision %d (yours: %d)" +msgstr "Revision %d (yours: %d)" + +#: updatecheck.pas:170 +msgid "Compiled: %s (yours: %s)" +msgstr "Compiled: %s (yours: %s)" + +#: updatecheck.pas:173 +msgid "Notes" +msgstr "Notes" + +#: updatecheck.pas:174 +msgid "Download and install build %d" +msgstr "Download and install build %d" + +#: updatecheck.pas:222 +msgid "Downloaded file not found: %s" +msgstr "Downloaded file not found: %s" + +#: updatecheck.pas:224 +msgid "Update in progress" +msgstr "Update in progress" + +#: updatecheck.pas:264 +msgid "Downloading: %s / %s" +msgstr "Downloading: %s / %s" + +#: usermanager.pas:435 +msgid "Save modified user?" +msgstr "Save modified user?" + +#: usermanager.pas:511 +msgid "Starting the server without %s may solve this issue." +msgstr "Starting the server without %s may solve this issue." + +#: usermanager.pas:811 +msgid "This user has an empty password." +msgstr "This user has an empty password." + +#: usermanager.pas:813 +msgid "" +"This user is inactive due to an invalid length of its encrypted password. " +"Please fix that in the %s table." +msgstr "" +"This user is inactive due to an invalid length of its encrypted password. " +"Please fix that in the %s table." + +#: usermanager.pas:815 +msgid "" +"This user is inactive due to having a host name, while the server runs with " +"%s." +msgstr "" +"This user is inactive due to having a host name, while the server runs with " +"%s." + +#: usermanager.pas:817 +msgid "This user is inactive due to some unknown reason." +msgstr "This user is inactive due to some unknown reason." + +#: usermanager.pas:926 +msgid "Global privileges" +msgstr "Global privileges" + +#: usermanager.pas:1048 +msgid "Objects of type %s cannot be part of privileges." +msgstr "Objects of type %s cannot be part of privileges." + +#: usermanager.pas:1054 +msgid "Selected object is already accessible." +msgstr "Selected object is already accessible." + +#: usermanager.pas:1125 +msgid "User <%s@%s> already exists." +msgstr "User <%s@%s> already exists." + +#: usermanager.pas:1130 +msgid "Repeated password does not match first one." +msgstr "Repeated password does not match first one." + +#: usermanager.pas:1155 +msgid "Unhandled privilege object: %s" +msgstr "Unhandled privilege object: %s" + +#: usermanager.pas:1297 +msgid "Delete user %s@%s?" +msgstr "Delete user %s@%s?" diff --git a/source/about.pas b/source/about.pas index 8049873e..ac029739 100644 --- a/source/about.pas +++ b/source/about.pas @@ -67,10 +67,10 @@ begin InheritFont(lblAppWebpage.Font); // Assign text - Caption := 'About '+AppName; - lblAppName.Caption := AppName; - lblAppVersion.Caption := 'Version '+Mainform.AppVersion; - lblAppCompiled.Caption := 'Compiled on: ' + DateTimeToStr(GetImageLinkTimeStamp(Application.ExeName)); + Caption := f_('About %s', [APPNAME]); + lblAppName.Caption := APPNAME; + lblAppVersion.Caption := _('Version') + ' ' + Mainform.AppVersion; + lblAppCompiled.Caption := _('Compiled on:') + ' ' + DateTimeToStr(GetImageLinkTimeStamp(Application.ExeName)); lblAppWebpage.Caption := AppDomain; lblAppWebpage.Hint := AppDomain; // Avoid scroll by removing blank line outside visible area in Authors text box diff --git a/source/bineditor.pas b/source/bineditor.pas index da8e84e0..297a52b6 100644 --- a/source/bineditor.pas +++ b/source/bineditor.pas @@ -143,7 +143,7 @@ var d: TOpenDialog; begin d := TOpenDialog.Create(Self); - d.Filter := 'All binary files (*.*)|*.*'; + d.Filter := _('All files')+' (*.*)|*.*'; d.FilterIndex := 0; if d.Execute then try Screen.Cursor := crHourglass; @@ -172,7 +172,7 @@ begin Exit; FStopping := True; if Modified then - DoPost := MessageDialog('Apply modifications?', mtConfirmation, [mbYes, mbNo]) = mrYes + DoPost := MessageDialog(_('Apply modifications?'), mtConfirmation, [mbYes, mbNo]) = mrYes else DoPost := False; if DoPost then diff --git a/source/connections.pas b/source/connections.pas index 46adb61d..7a9395e7 100644 --- a/source/connections.pas +++ b/source/connections.pas @@ -343,15 +343,15 @@ var SessionNames: TStringList; begin // Save session as ... - newName := 'Enter new session name ...'; + newName := _('Enter new session name ...'); NameOK := False; SessionNames := NodeSessionNames(ListSessions.FocusedNode.Parent, ParentKey); while not NameOK do begin - if not InputQuery('Clone session ...', 'New session name:', newName) then + if not InputQuery(_('Clone session ...'), _('New session name:'), newName) then Exit; // Cancelled NameOK := SessionNames.IndexOf(newName) = -1; if not NameOK then - ErrorDialog('Session name '''+ParentKey+newName+''' already in use.') + ErrorDialog(f_('Session name "%s" already in use.', [ParentKey+newName])) else begin // Create the key and save its values NewSess := CurrentParams; @@ -382,7 +382,7 @@ begin timerSettingsImport.Enabled := False; if FSettingsImportWaitTime >= 10000 then begin timerSettingsImport.Enabled := False; - MessageDialog('Imported sessions could not be detected. Restarting HeidiSQL may solve that.', mtWarning, [mbOK]); + MessageDialog(_('Imported sessions could not be detected. Restarting HeidiSQL may solve that.'), mtWarning, [mbOK]); end; end; @@ -436,7 +436,7 @@ var begin Node := ListSessions.FocusedNode; Sess := ListSessions.GetNodeData(Node); - if MessageDialog('Delete session "' + Sess.SessionName + '" ?', mtConfirmation, [mbYes, mbCancel]) = mrYes then + if MessageDialog(f_('Delete session "%s"?', [Sess.SessionName]), mtConfirmation, [mbYes, mbCancel]) = mrYes then begin AppSettings.SessionPath := Sess.SessionPath; AppSettings.DeleteCurrentKey; @@ -639,7 +639,7 @@ begin SiblingSessions := NodeSessionNames(ParentNode, ParentKey); // Test if target folder has an equal named node if SiblingSessions.IndexOf(FocusedSess.SessionName) > -1 then - ErrorDialog('Session "'+ParentKey+FocusedSess.SessionName+'" already exists!') + ErrorDialog(f_('Session "%s" already exists!', [ParentKey+FocusedSess.SessionName])) else begin try AppSettings.SessionPath := FocusedSess.SessionPath; @@ -648,7 +648,7 @@ begin FocusedSess.SessionPath := ParentKey+FocusedSess.SessionName; except on E:Exception do - ErrorDialog('Error while moving registry key: '+E.Message); + ErrorDialog(f_('Error while moving registry key: %s', [E.Message])); end; end; SiblingSessions.Free; @@ -697,11 +697,11 @@ begin if not SessionFocused then begin PageControlDetails.ActivePage := tabStart; if ListSessions.RootNodeCount = 0 then - lblHelp.Caption := 'New here? In order to connect to a server, you have to create a so called '+ - '"session" at first. Just click the "New" button on the bottom left to create your first session.'+CRLF+CRLF+ - 'Give it a friendly name (e.g. "Local DB server") so you''ll recall it the next time you start '+APPNAME+'.' + lblHelp.Caption := f_('New here? In order to connect to a server, you have to create a so called '+ + '"session" at first. Just click the "New" button on the bottom left to create your first session.'+ + 'Give it a friendly name (e.g. "Local DB server") so you''ll recall it the next time you start %s.', [APPNAME]) else - lblHelp.Caption := 'Please click a session on the left list to edit parameters, doubleclick to open it.'; + lblHelp.Caption := _('Please click a session on the left list to edit parameters, doubleclick to open it.'); end else begin PageControlDetails.ActivePage := tabSettings; @@ -749,13 +749,13 @@ var Connects, Refused: Integer; begin // Continuously update statistics labels - lblLastConnectRight.Caption := 'unknown or never'; + lblLastConnectRight.Caption := _('unknown or never'); lblLastConnectRight.Hint := ''; lblLastConnectRight.Enabled := False; - lblCreatedRight.Caption := 'unknown'; + lblCreatedRight.Caption := _('unknown'); lblCreatedRight.Hint := ''; lblCreatedRight.Enabled := False; - lblCounterRight.Caption := 'not available'; + lblCounterRight.Caption := _('not available'); lblCounterRight.Enabled := False; if not Assigned(ListSessions.FocusedNode) then @@ -779,11 +779,11 @@ begin Refused := AppSettings.ReadInt(asRefusedCount); lblCounterRight.Enabled := Connects + Refused > 0; if Connects > 0 then begin - lblCounterRight.Caption := 'Successful connects: '+IntToStr(Connects); + lblCounterRight.Caption := f_('Successful connects: %d', [Connects]); if Refused > 0 then - lblCounterRight.Caption := lblCounterRight.Caption + ', unsuccessful: '+IntToStr(Refused); + lblCounterRight.Caption := lblCounterRight.Caption + ', '+_('unsuccessful')+': '+IntToStr(Refused); end else if Refused > 0 then - lblCounterRight.Caption := 'Unsuccessful connects: '+IntToStr(Refused); + lblCounterRight.Caption := f_('Unsuccessful connects: %d', [Refused]); Invalidate; end; @@ -811,7 +811,7 @@ begin Sess := Sender.GetNodeData(Node); SiblingSessions := NodeSessionNames(Node.Parent, ParentKey); if SiblingSessions.IndexOf(NewText) > -1 then begin - ErrorDialog('Session "'+ParentKey+NewText+'" already exists!'); + ErrorDialog(f_('Session "%s" already exists!', [ParentKey+NewText])); NewText := Sess.SessionName; end else begin AppSettings.SessionPath := Sess.SessionPath; @@ -944,7 +944,7 @@ end; procedure Tconnform.FinalizeModifications(var CanProceed: Boolean); begin if FSessionModified and (not FOnlyPasswordModified) then begin - case MessageDialog('Save modifications?', 'Settings for "'+SelectedSessionPath+'" were changed.', mtConfirmation, [mbYes, mbNo, mbCancel]) of + case MessageDialog(_('Save modifications?'), f_('Settings for "%s" were changed.', [SelectedSessionPath]), mtConfirmation, [mbYes, mbNo, mbCancel]) of mrYes: begin btnSave.OnClick(Self); CanProceed := True; @@ -974,9 +974,9 @@ begin if SessionFocused then begin // Validate session GUI stuff if Params.NetType = ntMySQL_NamedPipe then - lblHost.Caption := 'Socket name:' + lblHost.Caption := _('Socket name:') else - lblHost.Caption := 'Hostname / IP:'; + lblHost.Caption := _('Hostname / IP:'); chkWindowsAuth.Enabled := Params.NetTypeGroup = ngMSSQL; lblUsername.Enabled := ((not chkLoginPrompt.Checked) or (not chkLoginPrompt.Enabled)) and ((not chkWindowsAuth.Checked) or (not chkWindowsAuth.Enabled)); @@ -1037,13 +1037,13 @@ begin Selector := TOpenDialog.Create(Self); Selector.FileName := editStartupScript.Text; if Edit = editStartupScript then - Selector.Filter := 'SQL-files (*.sql)|*.sql|All files (*.*)|*.*' + Selector.Filter := _('SQL-files')+' (*.sql)|*.sql|'+_('All files')+' (*.*)|*.*' else if Edit = editSSHPlinkExe then - Selector.Filter := 'Executables (*.exe)|*.exe|All files (*.*)|*.*' + Selector.Filter := _('Executables')+' (*.exe)|*.exe|'+_('All files')+' (*.*)|*.*' else if Edit = editSSHPrivateKey then - Selector.Filter := 'PuTTY private key (*.ppk)|*.ppk|All files (*.*)|*.*' + Selector.Filter := _('PuTTY private key')+' (*.ppk)|*.ppk|'+_('All files')+' (*.*)|*.*' else - Selector.Filter := 'Privacy Enhanced Mail certificates (*.pem)|*.pem|Certificates (*.crt)|*.crt|All files (*.*)|*.*'; + Selector.Filter := _('Privacy Enhanced Mail certificates')+' (*.pem)|*.pem|'+_('Certificates')+' (*.crt)|*.crt|'+_('All files')+' (*.*)|*.*'; // Find relevant label and set open dialog's title for i:=0 to Edit.Parent.ControlCount - 1 do begin Control := Edit.Parent.Controls[i]; diff --git a/source/copytable.pas b/source/copytable.pas index 143c7156..afe6b450 100644 --- a/source/copytable.pas +++ b/source/copytable.pas @@ -135,7 +135,7 @@ begin case FDBObj.NodeType of lntTable: FDBObj.Connection.ParseTableStructure(FDBObj.CreateCode, FColumns, FKeys, FForeignKeys); lntView: FDBObj.Connection.ParseViewStructure(FDBObj.CreateCode, FDBObj.Name, FColumns, Dummy, Dummy, Dummy, Dummy, Dummy); - else raise Exception.Create('Neither table nor view: '+FDBObj.Name); + else raise Exception.CreateFmt(_('Neither table nor view: %s'), [FDBObj.Name]); end; // Reset options tree @@ -251,10 +251,10 @@ begin case Sender.GetNodeLevel(Node) of 0: begin case Node.Index of - nColumns: CellText := 'Columns'; - nKeys: CellText := 'Indexes'; - nForeignKeys: CellText := 'Foreign keys'; - nData: CellText := 'Data ('+FormatNumber(FDBObj.Rows)+' rows)'; + nColumns: CellText := _('Columns'); + nKeys: CellText := _('Indexes'); + nForeignKeys: CellText := _('Foreign keys'); + nData: CellText := f_('Data (%s rows)', [FormatNumber(FDBObj.Rows)]); else raise Exception.Create(SUnhandledNodeIndex); end; if Node.Index <> nData then begin @@ -373,7 +373,7 @@ begin TargetTable := FDBObj.Connection.QuoteIdent(comboDatabase.Text)+'.'+FDBObj.Connection.QuoteIdent(editNewTablename.Text); TableExistance := FDBObj.Connection.GetVar('SHOW TABLES FROM '+FDBObj.Connection.QuoteIdent(comboDatabase.Text)+' LIKE '+esc(editNewTablename.Text)); if TableExistance <> '' then begin - if MessageDialog('Target table exists. Drop it and overwrite?', mtConfirmation, [mbYes, mbCancel]) = mrCancel then begin + if MessageDialog(_('Target table exists. Drop it and overwrite?'), mtConfirmation, [mbYes, mbCancel]) = mrCancel then begin ModalResult := mrNone; Exit; end; @@ -381,7 +381,7 @@ begin end; Screen.Cursor := crHourglass; - MainForm.ShowStatusMsg('Generating SQL code ...'); + MainForm.ShowStatusMsg(_('Generating SQL code ...')); DataCols := ''; SelectedColumns := TTableColumnList.Create(False); SelectedKeys := TTableKeyList.Create(False); @@ -472,7 +472,7 @@ begin // Run query and refresh list try - MainForm.ShowStatusMsg('Creating table ...'); + MainForm.ShowStatusMsg(_('Creating table ...')); MainForm.ActiveConnection.Query(CreateCode); if InsertCode <> '' then MainForm.ActiveConnection.Query(InsertCode); diff --git a/source/createdatabase.pas b/source/createdatabase.pas index ccbaf953..8d328a74 100644 --- a/source/createdatabase.pas +++ b/source/createdatabase.pas @@ -89,13 +89,13 @@ begin if modifyDB = '' then begin - Caption := 'Create database ...'; + Caption := _('Create database ...'); editDBName.Text := ''; editDBName.SetFocus; selectCharset := defaultCharset; end else begin - Caption := 'Alter database ...'; + Caption := _('Alter database ...'); editDBName.Text := modifyDB; editDBName.SetFocus; editDBName.SelectAll; @@ -193,7 +193,7 @@ begin ModalResult := mrOK; except on E:EDatabaseError do - ErrorDialog('Creating database "'+editDBName.Text+'" failed.', E.Message); + ErrorDialog(f_('Creating database "%s" failed.', [editDBName.Text]), E.Message); // Keep form open end else try sql := 'ALTER DATABASE ' + FConnection.QuoteIdent( modifyDB ); @@ -217,13 +217,13 @@ begin // Warn if there are tables with same names in new db for i:=0 to ObjectsInOldDb.Count-1 do begin if not (ObjectsInOldDb[i].NodeType in [lntTable, lntView]) then - Raise Exception.Create('Database "'+modifyDB+'" contains stored routine(s), which cannot be moved.'); + Raise Exception.CreateFmt(_('Database "%s" contains stored routine(s), which cannot be moved.'), [modifyDB]); if Assigned(ObjectsInNewDb) then begin for j:=0 to ObjectsInNewDb.Count-1 do begin if (ObjectsInOldDb[i].Name = ObjectsInNewDb[j].Name) and (ObjectsInOldDb[i].NodeType = ObjectsInNewDb[j].NodeType) then begin // One or more objects have a naming conflict - Raise Exception.Create('Database "'+editDBName.Text+'" exists and has objects with same names as in "'+modifyDB+'"'); + Raise Exception.CreateFmt(_('Database "%s" exists and has objects with same names as in "%s"'), [editDBName.Text, modifyDB]); end; end; end; @@ -233,8 +233,7 @@ begin // Target db does not exist - create it FConnection.Query(GetCreateStatement); end else begin - if MessageDialog('Database "'+editDBName.Text+'" exists. But it does not contain objects with same names as in '+ - '"'+modifyDB+'", so it''s uncritical to move everything.'+CRLF+CRLF+'Move all objects to "'+editDBName.Text+'"?', + if MessageDialog(f_('Database "%s" exists. But it does not contain objects with same names as in "%s", so it''s uncritical to move everything. Move all objects to "%s"?', [editDBName.Text, modifyDB, editDBName.Text]), mtConfirmation, [mbYes, mbCancel]) <> mrYes then Exit; end; @@ -262,7 +261,7 @@ begin ModalResult := mrOK; except on E:Exception do - ErrorDialog('Altering database "'+editDBName.Text+'" failed.', E.Message); + ErrorDialog(f_('Altering database "%s" failed.', [editDBName.Text]), E.Message); // Keep form open end; diff --git a/source/data_sorting.pas b/source/data_sorting.pas index a63a5135..7ef461a9 100644 --- a/source/data_sorting.pas +++ b/source/data_sorting.pas @@ -158,7 +158,7 @@ begin buttonOrder.Caption := TXT_DESC; buttonOrder.Down := True; end; - buttonOrder.Hint := 'Toggle the sort direction for this column.'; + buttonOrder.Hint := _('Toggle the sort direction for this column.'); buttonOrder.Tag := i+1; buttonOrder.OnClick := buttonOrderClick; Inc( xPosition, buttonOrder.Width + MARGIN ); @@ -171,7 +171,7 @@ begin buttonDelete.Left := xPosition; buttonDelete.Top := topPosition; buttonDelete.Caption := 'X'; - buttonDelete.Hint := 'Drops sorting by this column.'; + buttonDelete.Hint := _('Drops sorting by this column.'); buttonDelete.Tag := i+1; buttonDelete.OnClick := buttonDeleteClick; Inc( xPosition, buttonDelete.Width + MARGIN ); diff --git a/source/dbconnection.pas b/source/dbconnection.pas index 7978a439..fb87bcb9 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -4,7 +4,8 @@ interface uses Classes, SysUtils, windows, mysql_structures, SynRegExpr, Generics.Collections, Generics.Defaults, - DateUtils, Types, Math, Dialogs, ADODB, DB, DBCommon, ComObj, Graphics, ExtCtrls; + DateUtils, Types, Math, Dialogs, ADODB, DB, DBCommon, ComObj, Graphics, ExtCtrls, + gnugettext; type @@ -650,7 +651,7 @@ begin Create; if not AppSettings.SessionPathExists(SessionRegPath) then - raise Exception.Create('Error: Session "'+SessionRegPath+'" not found in registry.'); + raise Exception.Create(f_('Error: Session "%s" not found in registry.', [SessionRegPath])); FSessionPath := SessionRegPath; AppSettings.SessionPath := SessionRegPath; @@ -661,8 +662,10 @@ begin FSessionColor := AppSettings.ReadInt(asTreeBackground); FNetType := TNetType(AppSettings.ReadInt(asNetType)); if (FNetType > High(TNetType)) or (FNetType < Low(TNetType)) then begin - ErrorDialog('Broken "NetType" value ('+IntToStr(Integer(FNetType))+') found in settings for session "'+FSessionPath+'".'+CRLF+CRLF+ - 'Please report that on http://code.google.com/p/heidisql/issues/detail?id=2958'); + ErrorDialog(f_('Broken "NetType" value (%d) found in settings for session "%s".', [Integer(FNetType), FSessionPath]) + +CRLF+CRLF+ + _('Please report that on http://code.google.com/p/heidisql/issues/detail?id=2958') + ); FNetType := ntMySQL_TCPIP; end; FHostname := AppSettings.ReadString(asHost); @@ -969,7 +972,7 @@ var ClientVersion: String; begin // Map library procedure to internal procedure - Log(lcDebug, 'Assign procedure "'+Name+'"'); + Log(lcDebug, f_('Assign procedure "%s"', [Name])); Proc := GetProcAddress(LibMysqlHandle, Name); if Proc = nil then begin if @mysql_get_client_info = nil then @@ -978,7 +981,7 @@ begin if @mysql_get_client_info <> nil then ClientVersion := ' ('+DecodeApiString(mysql_get_client_info)+')'; LibMysqlHandle := 0; - raise EDatabaseError.Create('Your '+LibMysqlPath+ClientVersion+' is out-dated or somehow incompatible to '+APPNAME+'. Please use the one from the installer, or just reinstall '+APPNAME+'.'); + raise EDatabaseError.Create(f_('Your %s is out-dated or somehow incompatible to %s. Please use the one from the installer, or just reinstall %s.', [LibMysqlPath+ClientVersion, APPNAME, APPNAME])); end; end; @@ -1052,7 +1055,7 @@ begin sslca, nil, nil); - Log(lcInfo, 'SSL parameters successfully set.'); + Log(lcInfo, _('SSL parameters successfully set.')); end; end; @@ -1082,7 +1085,7 @@ begin rx.Expression := '(-pw\s+")[^"]*(")'; PlinkCmdDisplay := rx.Replace(PlinkCmd, '${1}******${2}', True); rx.Free; - Log(lcInfo, 'Attempt to create plink.exe process, waiting '+FormatNumber(FParameters.SSHTimeout)+'s for response ...'); + Log(lcInfo, f_('Attempt to create plink.exe process, waiting %ds for response ...', [FParameters.SSHTimeout])); // Create plink.exe process FillChar(FPlinkProcInfo, SizeOf(TProcessInformation), 0); FillChar(StartupInfo, SizeOf(TStartupInfo), 0); @@ -1093,10 +1096,10 @@ begin WaitForSingleObject(FPlinkProcInfo.hProcess, FParameters.SSHTimeout*1000); GetExitCodeProcess(FPlinkProcInfo.hProcess, ExitCode); if ExitCode <> STILL_ACTIVE then - raise EDatabaseError.Create('PLink exited unexpected. Command line was:'+CRLF+PlinkCmdDisplay); + raise EDatabaseError.CreateFmt(_('PLink exited unexpected. Command line was: %s'), [CRLF+PlinkCmdDisplay]); end else begin ClosePlink; - raise EDatabaseError.Create('Couldn''t execute PLink: '+CRLF+PlinkCmdDisplay); + raise EDatabaseError.CreateFmt(_('Could not execute PLink: %s'), [CRLF+PlinkCmdDisplay]); end; FinalHost := 'localhost'; FinalPort := FParameters.SSHLocalPort; @@ -1133,7 +1136,7 @@ begin raise EDatabaseError.Create(Error); end else begin FActive := True; - Log(lcInfo, 'Connected. Thread-ID: '+IntToStr(ThreadId)); + Log(lcInfo, f_('Connected. Thread-ID: %d', [ThreadId])); CharacterSet := 'utf8'; CurCharset := CharacterSet; Log(lcDebug, 'Characterset: '+CurCharset); @@ -1202,7 +1205,7 @@ begin except on E:Exception do raise EDatabaseError.Create(E.Message+CRLF+CRLF+ - 'On Wine, you can try to install MDAC:'+CRLF+ + _('On Wine, you can try to install MDAC:')+CRLF+ '> wget http://winetricks.org/winetricks'+CRLF+ '> chmod +x winetricks'+CRLF+ '> sh winetricks mdac28'); @@ -1232,7 +1235,7 @@ begin FAdoHandle.Connected := True; FConnectionStarted := GetTickCount div 1000; FActive := True; - Log(lcInfo, 'Connected. Thread-ID: '+IntToStr(ThreadId)); + Log(lcInfo, f_('Connected. Thread-ID: %d', [ThreadId])); // No need to set a charset for MS SQL // CharacterSet := 'utf8'; // CurCharset := CharacterSet; @@ -1259,7 +1262,7 @@ begin // Show up dynamic connection properties, probably useful for debugging for i:=0 to FAdoHandle.Properties.Count-1 do - Log(lcDebug, 'OLE DB property "'+FAdoHandle.Properties[i].Name+'": '+String(FAdoHandle.Properties[i].Value)); + Log(lcDebug, f_('OLE DB property "%s": %s', [FAdoHandle.Properties[i].Name, String(FAdoHandle.Properties[i].Value)])); DoAfterConnect; @@ -1304,7 +1307,7 @@ begin // Prompt for password on initial connect if FParameters.LoginPrompt and (not FLoginPromptDone) then begin Dialog := TfrmLogin.Create(Self); - Dialog.lblPrompt.Caption := 'Login to '+FParameters.Hostname+':'; + Dialog.lblPrompt.Caption := f_('Login to %s:', [FParameters.Hostname]); Dialog.editUsername.Text := FParameters.Username; Dialog.editPassword.Text := FParameters.Password; Dialog.ShowModal; @@ -1316,9 +1319,9 @@ begin // Prepare connection if FParameters.Password <> '' then UsingPass := 'Yes' else UsingPass := 'No'; - Log(lcInfo, 'Connecting to '+FParameters.Hostname+' via '+FParameters.NetTypeName(FParameters.NetType, True)+ - ', username '+FParameters.Username+ - ', using password: '+UsingPass+' ...'); + Log(lcInfo, f_('Connecting to %s via %s, username %s, using password: %s ...', + [FParameters.Hostname, FParameters.NetTypeName(FParameters.NetType, True), FParameters.Username, UsingPass] + )); end; @@ -1327,10 +1330,10 @@ begin // Init libmysql before actually connecting. // Each connection has its own library handle if LibMysqlHandle = 0 then begin - Log(lcDebug, 'Loading library file '+LibMysqlPath+' ...'); + Log(lcDebug, f_('Loading library file %s ...', [LibMysqlPath])); LibMysqlHandle := LoadLibrary(PWideChar(LibMysqlPath)); if LibMysqlHandle = 0 then - raise EDatabaseError.Create('Can''t find a usable '+LibMysqlPath+'. Please launch '+ExtractFileName(ParamStr(0))+' from the directory where you have installed it.') + raise EDatabaseError.CreateFmt(_('Cannot find a usable %s. Please launch %s from the directory where you have installed it.'), [LibMysqlPath, ExtractFileName(ParamStr(0))]) else begin AssignProc(@mysql_affected_rows, 'mysql_affected_rows'); AssignProc(@mysql_character_set_name, 'mysql_character_set_name'); @@ -1442,7 +1445,7 @@ end; function TMySQLConnection.Ping(Reconnect: Boolean): Boolean; begin - Log(lcDebug, 'Ping server ...'); + Log(lcDebug, _('Ping server ...')); if (FHandle=nil) or (mysql_ping(FHandle) <> 0) then begin // Be sure to release some stuff before reconnecting Active := False; @@ -1458,7 +1461,7 @@ end; function TAdoDBConnection.Ping(Reconnect: Boolean): Boolean; begin - Log(lcDebug, 'Ping server ...'); + Log(lcDebug, _('Ping server ...')); if FActive then try FAdoHandle.Execute('SELECT 1'); except @@ -1487,7 +1490,7 @@ end; procedure TMySQLConnection.ClosePlink; begin if FPlinkProcInfo.hProcess <> 0 then begin - Log(lcInfo, 'Closing plink.exe process #'+IntToStr(FPlinkProcInfo.dwProcessId)+' ...'); + Log(lcInfo, f_('Closing plink.exe process #%d ...', [FPlinkProcInfo.dwProcessId])); TerminateProcess(FPlinkProcInfo.hProcess, 0); CloseHandle(FPlinkProcInfo.hProcess); end; @@ -1505,7 +1508,7 @@ var QueryResult: PMYSQL_RES; begin if (FLockedByThread <> nil) and (FLockedByThread.ThreadID <> GetCurrentThreadID) then begin - Log(lcDebug, 'Waiting for running query to finish ...'); + Log(lcDebug, _('Waiting for running query to finish ...')); try FLockedByThread.WaitFor; except @@ -1559,7 +1562,7 @@ begin if UpperCase(Copy(SQL, 1, 3)) = 'USE' then begin FDatabase := Trim(Copy(SQL, 4, Length(SQL)-3)); FDatabase := DeQuoteIdent(FDatabase); - Log(lcDebug, 'Database "'+FDatabase+'" selected'); + Log(lcDebug, f_('Database "%s" selected', [FDatabase])); if Assigned(FOnDatabaseChanged) then FOnDatabaseChanged(Self, Database); end; @@ -1605,7 +1608,7 @@ var Affected: Int64; begin if (FLockedByThread <> nil) and (FLockedByThread.ThreadID <> GetCurrentThreadID) then begin - Log(lcDebug, 'Waiting for running query to finish ...'); + Log(lcDebug, _('Waiting for running query to finish ...')); try FLockedByThread.WaitFor; except @@ -1648,7 +1651,7 @@ begin if UpperCase(Copy(SQL, 1, 3)) = 'USE' then begin FDatabase := Trim(Copy(SQL, 4, Length(SQL)-3)); FDatabase := DeQuoteIdent(FDatabase); - Log(lcDebug, 'Database "'+FDatabase+'" selected'); + Log(lcDebug, f_('Database "%s" selected', [FDatabase])); if Assigned(FOnDatabaseChanged) then FOnDatabaseChanged(Self, Database); end; @@ -1708,7 +1711,7 @@ begin lntTable, lntView: Column := 1; lntFunction, lntProcedure, lntTrigger: Column := 2; lntEvent: Column := 3; - else Exception.Create('Unhandled list node type in '+ClassName+'.GetCreateCode'); + else Exception.CreateFmt(_('Unhandled list node type in %s.GetCreateCode'), [ClassName]); end; if NodeType = lntView then Result := GetCreateViewCode(Database, Name) @@ -2035,7 +2038,7 @@ begin except on E:EDatabaseError do begin FAllDatabases := TStringList.Create; - Log(lcError, 'Database names not available due to missing privileges for user '+CurrentUserHostCombination+'.'); + Log(lcError, f_('Database names not available due to missing privileges for user %s.', [CurrentUserHostCombination])); end; end; end; @@ -2508,7 +2511,7 @@ begin Vars.Next; end; if Result = 0 then begin - Log(lcError, 'The server did not return a non-zero value for the max_allowed_packet variable. Assuming 1M now.'); + Log(lcError, _('The server did not return a non-zero value for the max_allowed_packet variable. Assuming 1M now.')); Result := SIZE_MB; end; @@ -2613,7 +2616,7 @@ end; function TDBConnection.ExplainAnalyzer(SQL, DatabaseName: String): Boolean; begin Result := False; - MessageDialog('Not implemented for this DBMS', mtError, [mbOK]); + MessageDialog(_('Not implemented for this DBMS'), mtError, [mbOK]); end; @@ -3063,18 +3066,18 @@ begin Ping(False); Result.Values['Connected'] := EvalBool(FActive); if FActive then begin - Result.Values['Real Hostname'] := FRealHostname; - Result.Values['Server OS'] := ServerOS; - Result.Values['Server version'] := FServerVersionUntouched; - Result.Values['Connection port'] := IntToStr(Parameters.Port); - Result.Values['Compressed protocol'] := EvalBool(Parameters.Compressed); - Result.Values['Unicode enabled'] := EvalBool(IsUnicode); - Result.Values['SSL enabled'] := EvalBool(IsSSL); + Result.Values[_('Real Hostname')] := FRealHostname; + Result.Values[_('Server OS')] := ServerOS; + Result.Values[_('Server version')] := FServerVersionUntouched; + Result.Values[_('Connection port')] := IntToStr(Parameters.Port); + Result.Values[_('Compressed protocol')] := EvalBool(Parameters.Compressed); + Result.Values[_('Unicode enabled')] := EvalBool(IsUnicode); + Result.Values[_('SSL enabled')] := EvalBool(IsSSL); if Assigned(FServerVariables) then Result.Values['max_allowed_packet'] := FormatByteNumber(MaxAllowedPacket); case Parameters.NetTypeGroup of ngMySQL: begin - Result.Values['Client version (libmysql)'] := DecodeApiString(mysql_get_client_info); + Result.Values[_('Client version (libmysql)')] := DecodeApiString(mysql_get_client_info); Infos := DecodeApiString(mysql_stat((Self as TMySQLConnection).FHandle)); rx := TRegExpr.Create; rx.ModifierG := False; @@ -3377,7 +3380,7 @@ begin CheckOption := Trim(rx.Match[13]); SelectCode := rx.Match[11]; end else - raise Exception.Create('Regular expression did not match the VIEW code in ParseViewStructure(): '+CRLF+CRLF+CreateCode); + raise Exception.CreateFmt(_('Regular expression did not match the VIEW code in ParseViewStructure(): %s'), [CRLF+CRLF+CreateCode]); rx.Free; end; @@ -3780,7 +3783,7 @@ begin ftDateTime: TypeIndex := dtDateTime; else - raise EDatabaseError.Create('Unknown data type for column #'+IntToStr(i)+' - '+FColumnNames[i]+': '+IntToStr(Integer(LastResult.Fields[i].DataType))); + raise EDatabaseError.CreateFmt(_('Unknown data type for column #%d - %s: %d'), [i, FColumnNames[i], Integer(LastResult.Fields[i].DataType)]); end; for j:=0 to High(FConnection.DataTypes) do begin if TypeIndex = FConnection.DataTypes[j].Index then @@ -4003,7 +4006,7 @@ begin if idx > -1 then Result := Col(idx) else if not IgnoreErrors then - Raise EDatabaseError.CreateFmt('Column "%s" not available.', [ColumnName]); + Raise EDatabaseError.CreateFmt(_('Column "%s" not available.'), [ColumnName]); end; @@ -4089,7 +4092,7 @@ var begin Result := nil; if (Column = -1) or (Column >= FColumnOrgNames.Count) then - raise EDatabaseError.Create('Column #'+IntToStr(Column)+' not available.'); + raise EDatabaseError.CreateFmt(_('Column #%s not available.'), [IntToStr(Column)]); if FEditingPrepared then begin for i:=0 to FColumns.Count-1 do begin if FColumns[i].Name = FColumnOrgNames[Column] then begin @@ -4407,7 +4410,7 @@ var begin Result := True; if not FEditingPrepared then - raise EDatabaseError.Create('Internal error: Cannot post modifications before editing was prepared.'); + raise EDatabaseError.Create(_('Internal error: Cannot post modifications before editing was prepared.')); for Row in FUpdateData do begin // Prepare update and insert queries @@ -4605,14 +4608,14 @@ begin end; if (Field.org_table <> '') and (tbl <> '') and ((tbl <> Field.org_table) or (db <> Field.db)) then - raise EDatabaseError.Create('More than one table involved.'); + raise EDatabaseError.Create(_('More than one table involved.')); if Field.org_table <> '' then begin tbl := Field.org_table; db := Field.db; end; end; if tbl = '' then - raise EDatabaseError.Create('Could not determine name of table.') + raise EDatabaseError.Create(_('Could not determine name of table.')) else Result := Connection.DecodeAPIString(tbl) end; @@ -4677,7 +4680,7 @@ begin // All column names must be present in order to send valid INSERT/UPDATE/DELETE queries for i:=0 to FColumnOrgNames.Count-1 do begin if FColumnOrgNames[i] = '' then - raise EDatabaseError.Create('Column #'+IntToStr(i)+' has an undefined origin: '+ColumnNames[i]); + raise EDatabaseError.CreateFmt(_('Column #%d has an undefined origin: %s'), [i, ColumnNames[i]]); end; end; @@ -4695,7 +4698,7 @@ begin for i:=0 to NeededCols.Count-1 do begin j := FColumnOrgNames.IndexOf(NeededCols[i]); if j = -1 then - raise EDatabaseError.Create('Cannot compose WHERE clause - column missing: '+NeededCols[i]); + raise EDatabaseError.CreateFmt(_('Cannot compose WHERE clause - column missing: %s'), [NeededCols[i]]); if Result <> '' then Result := Result + ' AND'; Result := Result + ' ' + Connection.QuoteIdent(FColumnOrgNames[j]); @@ -4861,7 +4864,7 @@ begin lntTrigger: Result := 'Trigger'; lntEvent: Result := 'Event'; lntColumn: Result := 'Column'; - else Result := 'Unknown, should never appear'; + else Result := _('Unknown, should never appear'); end; end; @@ -5134,7 +5137,7 @@ begin case _type of 1: Result := PAnsiChar(AnsiString(Dialog.editUsername.Text)); 2: Result := PAnsiChar(AnsiString(Dialog.editPassword.Text)); - else raise EDatabaseError.Create('Unsupported type ('+IntToStr(_type)+') in mysql_authentication_dialog_ask.'); + else raise EDatabaseError.CreateFmt(_('Unsupported type (%d) in mysql_authentication_dialog_ask.'), [_type]); end; Dialog.Free; end; diff --git a/source/editvar.pas b/source/editvar.pas index d8f57c1b..26318c3f 100644 --- a/source/editvar.pas +++ b/source/editvar.pas @@ -87,7 +87,7 @@ begin end; end; if not Found then - raise EVariableError.Create('Could not find '+Value+' variable in internal mapping.'); + raise EVariableError.CreateFmt(_('Could not find %s variable in internal mapping.'), [Value]); end; diff --git a/source/exportgrid.pas b/source/exportgrid.pas index 08dd01f3..e73db085 100644 --- a/source/exportgrid.pas +++ b/source/exportgrid.pas @@ -271,7 +271,7 @@ begin Dialog.Filter := ''; for ef:=Low(TGridExportFormat) to High(TGridExportFormat) do Dialog.Filter := Dialog.Filter + FFormatToDescription[ef] + ' (*.'+FFormatToFileExtension[ef]+')|*.'+FFormatToFileExtension[ef]+'|'; - Dialog.Filter := Dialog.Filter + 'All files (*.*)|*.*'; + Dialog.Filter := Dialog.Filter + _('All files')+' (*.*)|*.*'; Dialog.OnTypeChange := SaveDialogTypeChange; Dialog.FilterIndex := grpFormat.ItemIndex+1; Dialog.OnTypeChange(Dialog); @@ -342,8 +342,8 @@ begin end; Node := GetNextNode(Grid, Node, False); end; - grpSelection.Items[0] := 'Selection ('+FormatNumber(Grid.SelectedCount)+' rows, '+FormatByteNumber(SelectionSize)+')'; - grpSelection.Items[1] := 'Complete ('+FormatNumber(Grid.RootNodeCount)+' rows, '+FormatByteNumber(AllSize)+')'; + grpSelection.Items[0] := f_('Selection (%d rows, %s)', [FormatNumber(Grid.SelectedCount), FormatByteNumber(SelectionSize)]); + grpSelection.Items[1] := f_('Complete (%d rows, %s)', [FormatNumber(Grid.RootNodeCount), FormatByteNumber(AllSize)]); end; @@ -419,7 +419,7 @@ begin // Confirmation dialog if file exists if radioOutputFile.Checked and FileExists(editFilename.Text) - and (MessageDialog('File exists', 'Overwrite file '+editFilename.Text+'?', mtConfirmation, [mbYes, mbCancel]) = mrCancel) + and (MessageDialog(_('File exists'), f_('Overwrite file %s?', [editFilename.Text]), mtConfirmation, [mbYes, mbCancel]) = mrCancel) then begin ModalResult := mrNone; Exit; @@ -592,9 +592,12 @@ begin while Assigned(Node) do begin // Update status once in a while. if (Node.Index+1) mod 100 = 0 then begin - Mainform.ShowStatusMsg('Exporting row '+FormatNumber(Node.Index+1)+' of '+FormatNumber(NodeCount)+ - ' ('+IntToStr(Trunc((Node.Index+1) / NodeCount *100))+'%, '+FormatByteNumber(S.Size)+')' - ); + MainForm.ShowStatusMsg(f_('Exporting row %s of %s (%d%%, %s)', + [FormatNumber(Node.Index+1), + FormatNumber(NodeCount), + Trunc((Node.Index+1) / NodeCount *100), + FormatByteNumber(S.Size)] + )); MainForm.ProgressStep; end; RowNum := Grid.GetNodeData(Node); @@ -787,7 +790,7 @@ begin end; Mainform.DisableProgress; - Mainform.ShowStatusMsg('Freeing data...'); + Mainform.ShowStatusMsg(_('Freeing data...')); FreeAndNil(S); Mainform.ShowStatusMsg; Screen.Cursor := crDefault; diff --git a/source/grideditlinks.pas b/source/grideditlinks.pas index b853b7cc..9caef875 100644 --- a/source/grideditlinks.pas +++ b/source/grideditlinks.pas @@ -7,7 +7,7 @@ interface uses Windows, Forms, Graphics, Messages, VirtualTrees, ComCtrls, SysUtils, Classes, StdCtrls, ExtCtrls, CheckLst, Controls, Types, Dialogs, Mask, DateUtils, Math, - dbconnection, mysql_structures, helpers, texteditor, bineditor; + dbconnection, mysql_structures, helpers, texteditor, bineditor, gnugettext; type // Radio buttons and checkboxes which do not pass key to their parent control @@ -215,8 +215,8 @@ end; constructor TBaseGridEditorLink.Create; begin - raise Exception.Create('Wrong constructor called: ' + Self.ClassName + '.Create.' + CRLF + - 'Instead, please call the overloaded version ' + Self.ClassName + '.Create(VirtualStringTree).'); + raise Exception.CreateFmt(_('Wrong constructor called: %s.Create. Instead, please call the overloaded version %s.Create(VirtualStringTree).'), + [Self.ClassName, Self.ClassName]); end; constructor TBaseGridEditorLink.Create(Tree: TVirtualStringTree); @@ -1019,7 +1019,7 @@ begin FButton.Parent := FPanel; FButton.TabStop := False; FButton.Caption := '…'; - FButton.Hint := 'Edit text in popup editor ...'; + FButton.Hint := _('Edit text in popup editor ...'); FButton.ShowHint := True; FButton.OnClick := ButtonClick; end; @@ -1153,7 +1153,7 @@ begin FRadioNothing.Width := FRadioNothing.Parent.Width - 2 * FRadioNothing.Left; FRadioNothing.OnClick := RadioClick; FRadioNothing.OnKeyDown := DoKeyDown; - FRadioNothing.Caption := 'No default value'; + FRadioNothing.Caption := _('No default value'); FRadioText := TAllKeysRadioButton.Create(FPanel); FRadioText.Parent := FPanel; diff --git a/source/helpers.pas b/source/helpers.pas index 9b18532d..9fbda203 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -12,7 +12,7 @@ uses Classes, SysUtils, Graphics, GraphUtil, ClipBrd, Dialogs, Forms, Controls, ShellApi, Windows, ShlObj, ActiveX, VirtualTrees, SynRegExpr, Messages, Math, Registry, DateUtils, Generics.Collections, StrUtils, AnsiStrings, TlHelp32, Types, - dbconnection, mysql_structures, SynMemo, Menus, WinInet, synacode; + dbconnection, mysql_structures, SynMemo, Menus, WinInet, synacode, gnugettext; type @@ -323,6 +323,7 @@ type function GetHTMLCharsetByEncoding(Encoding: TEncoding): String; procedure ParseCommandLine(Parameters: TStringlist; var ConnectionParams: TConnectionParameters; var FileNames: TStringList); + function f_(const Pattern: string; const Args: array of const): string; var AppSettings: TAppSettings; @@ -1041,9 +1042,9 @@ begin s := s mod 60; if d > 0 then begin if DisplaySeconds then - Result := Format('%d days, %.2d:%.2d:%.2d', [d, h, m, s]) + Result := Format('%d '+_('days')+', %.2d:%.2d:%.2d', [d, h, m, s]) else - Result := Format('%d days, %.2d:%.2d h', [d, h, m]); + Result := Format('%d '+_('days')+', %.2d:%.2d h', [d, h, m]); end else begin if DisplaySeconds then Result := Format('%.2d:%.2d:%.2d', [h, m, s]) @@ -1716,15 +1717,15 @@ begin DaysAgo := DaysBetween(Now, d); HoursAgo := HoursBetween(Now, d); MinutesAgo := MinutesBetween(Now, d); - if MonthsAgo = 1 then Result := FormatNumber(MonthsAgo)+' month ago' - else if MonthsAgo > 1 then Result := FormatNumber(MonthsAgo)+' months ago' - else if DaysAgo = 1 then Result := FormatNumber(DaysAgo)+' day ago' - else if DaysAgo > 1 then Result := FormatNumber(DaysAgo)+' days ago' - else if HoursAgo = 1 then Result := FormatNumber(HoursAgo)+' hour ago' - else if HoursAgo > 1 then Result := FormatNumber(HoursAgo)+' hours ago' - else if MinutesAgo = 1 then Result := FormatNumber(MinutesAgo)+' minute ago' - else if MinutesAgo > 0 then Result := FormatNumber(MinutesAgo)+' minutes ago' - else Result := 'less than a minute ago'; + if MonthsAgo = 1 then Result := f_('%s month ago', [FormatNumber(MonthsAgo)]) + else if MonthsAgo > 1 then Result := f_('%s months ago', [FormatNumber(MonthsAgo)]) + else if DaysAgo = 1 then Result := f_('%s day ago', [FormatNumber(DaysAgo)]) + else if DaysAgo > 1 then Result := f_('%s days ago', [FormatNumber(DaysAgo)]) + else if HoursAgo = 1 then Result := f_('%s hour ago', [FormatNumber(HoursAgo)]) + else if HoursAgo > 1 then Result := f_('%s hours ago', [FormatNumber(HoursAgo)]) + else if MinutesAgo = 1 then Result := f_('%s minute ago', [FormatNumber(MinutesAgo)]) + else if MinutesAgo > 0 then Result := f_('%s minutes ago', [FormatNumber(MinutesAgo)]) + else Result := _('less than a minute ago'); end; @@ -1918,7 +1919,7 @@ var popup: TPopupMenu; Item: TMenuItem; begin - Mainform.ShowStatusMsg('Initializing editor ...'); + Mainform.ShowStatusMsg(_('Initializing editor ...')); Mainform.LogSQL(Self.ClassName+'.Init, using object "'+Obj.Name+'"', lcDebug); DBObject := TDBObject.Create(Obj.Connection); DBObject.Assign(Obj); @@ -1960,9 +1961,9 @@ begin if Modified then begin ObjType := LowerCase(DBObject.ObjType); if DBObject.Name <> '' then - Msg := 'Save modified '+ObjType+' "'+DBObject.Name+'"?' + Msg := f_('Save modified %s "%s"?', [ObjType, DBObject.Name]) else - Msg := 'Save new '+ObjType+'?'; + Msg := f_('Save new %s?', [ObjType]); Result := MessageDialog(Msg, mtConfirmation, [mbYes, mbNo, mbCancel]); case Result of mrYes: Result := ApplyModifications; @@ -2530,6 +2531,13 @@ begin end; +function f_(const Pattern: string; const Args: array of const): string; +begin + // Helper for translation, replacement for Format(_()) + Result := Format(_(Pattern), Args); +end; + + { Threading stuff } constructor TQueryThread.Create(Connection: TDBConnection; Batch: TSQLBatch; TabNumber: Integer); @@ -2817,7 +2825,7 @@ begin try UrlHandle := InternetOpenURL(NetHandle, PChar(FURL), nil, 0, INTERNET_FLAG_RELOAD, 0); if not Assigned(UrlHandle) then - raise Exception.Create('Could not open URL: '+FURL); + raise Exception.CreateFmt(_('Could not open URL: %s'), [FURL]); // Detect content length HeadSize := SizeOf(Head); @@ -2825,7 +2833,7 @@ begin if HttpQueryInfo(UrlHandle, HTTP_QUERY_CONTENT_LENGTH, @Head, HeadSize, Reserved) then FContentLength := StrToIntDef(Head, -1) else - raise Exception.Create('Server did not send required "Content-Length" header: '+FURL); + raise Exception.CreateFmt(_('Server did not send required "Content-Length" header: %s'), [FURL]); // Check if we got HTTP status 200 HeadSize := SizeOf(Head); @@ -2833,7 +2841,7 @@ begin if HttpQueryInfo(UrlHandle, HTTP_QUERY_STATUS_CODE, @Head, HeadSize, Reserved) then begin HttpStatus := StrToIntDef(Head, -1); if HttpStatus <> 200 then - raise Exception.Create('Got HTTP status '+IntToStr(HttpStatus)+' from '+FURL); + raise Exception.CreateFmt(_('Got HTTP status %d from %s'), [HttpStatus, FURL]); end; // Create local file @@ -3247,7 +3255,7 @@ var begin PrepareRegistry; if IsEmpty(FSessionPath) then - raise Exception.Create('No path set, won''t delete root key '+FRegistry.CurrentPath) + raise Exception.CreateFmt(_('No path set, won''t delete root key %s'), [FRegistry.CurrentPath]) else begin KeyPath := REGKEY_SESSIONS + '\' + FSessionPath; ResetPath; @@ -3262,7 +3270,7 @@ var begin PrepareRegistry; if IsEmpty(FSessionPath) then - raise Exception.Create('No path set, won''t move root key '+FRegistry.CurrentPath) + raise Exception.CreateFmt(_('No path set, won''t move root key %s'), [FRegistry.CurrentPath]) else begin KeyPath := REGKEY_SESSIONS + '\' + FSessionPath; ResetPath; @@ -3328,7 +3336,7 @@ begin if FormatName <> '' then ValueName := Format(ValueName, [FormatName]); if FSettings[Index].Session and IsEmpty(FSessionPath) then - raise Exception.Create('Attempt to read session setting without session path'); + raise Exception.Create(_('Attempt to read session setting without session path')); if (not FSettings[Index].Session) and IsNotEmpty(FSessionPath) then FSessionPath := ''; PrepareRegistry; @@ -3402,7 +3410,7 @@ begin if FormatName <> '' then ValueName := Format(ValueName, [FormatName]); if FSettings[Index].Session and IsEmpty(FSessionPath) then - raise Exception.Create('Attempt to write session setting without session path'); + raise Exception.Create(_('Attempt to write session setting without session path')); if (not FSettings[Index].Session) and IsNotEmpty(FSessionPath) then FSessionPath := ''; PrepareRegistry; diff --git a/source/insertfiles.pas b/source/insertfiles.pas index 8699ec25..a4d188d0 100644 --- a/source/insertfiles.pas +++ b/source/insertfiles.pas @@ -5,7 +5,7 @@ interface uses Windows, Messages, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ImgList, ShellApi, Math, Graphics, ComCtrls, ToolWin, - dbconnection, mysql_structures, VirtualTrees, grideditlinks, SynRegExpr, gnugettext; + dbconnection, mysql_structures, VirtualTrees, grideditlinks, SynRegExpr, gnugettext, helpers; type TColInfo = class @@ -101,7 +101,7 @@ type implementation -uses main, helpers; +uses main; const ColColname = 0; @@ -485,7 +485,7 @@ begin CheckState := csMixedNormal; Grid.Header.Columns[ColBinary].CheckState := CheckState; - lblFileCount.Caption := Format('%u files, %s, %u files selected.', [Grid.RootNodeCount, FormatByteNumber(Bytes), Grid.SelectedCount]); + lblFileCount.Caption := f_('%u files, %s, %u files selected.', [Grid.RootNodeCount, FormatByteNumber(Bytes), Grid.SelectedCount]); Modified; end; diff --git a/source/loaddata.pas b/source/loaddata.pas index 56c435b3..9e634c5d 100644 --- a/source/loaddata.pas +++ b/source/loaddata.pas @@ -173,7 +173,7 @@ begin Charset := MainForm.GetCharsetByEncoding(Encoding); try // Detect db charset - DefCharset := 'Let server/database decide'; + DefCharset := _('Let server/database decide'); dbcreate := FConnection.GetVar('SHOW CREATE DATABASE '+FConnection.QuoteIdent(comboDatabase.Text), 1); rx := TRegExpr.Create; rx.ModifierG := True; @@ -198,7 +198,7 @@ begin SelectedCharsetIndex := 0; comboEncoding.ItemIndex := SelectedCharsetIndex; end else begin - comboEncoding.Items.Add('Unsupported by this server'); + comboEncoding.Items.Add(_('Unsupported by this server')); comboEncoding.ItemIndex := 0; end; end else begin @@ -312,17 +312,17 @@ begin Warnings.Next; end; if Warnings.RecordCount > 0 then begin - ErrorDialog('Your file was imported but the server returned '+FormatNumber(Warnings.RecordCount)+' warnings and/or notes. See the log panel for details.'); + ErrorDialog(f_('Your file was imported but the server returned %s warnings and/or notes. See the log panel for details.', [FormatNumber(Warnings.RecordCount)])); ModalResult := mrNone; end; end; // Hint user if zero rows were detected in file if (ModalResult <> mrNone) and (RowCount = 0) then begin - ErrorDialog('No rows were imported', - 'This can have several causes:'+CRLF+ - ' - File is empty'+CRLF+ - ' - Wrong file encoding was selected or detected'+CRLF+ - ' - Field and/or line terminator do not fit to the file contents' + ErrorDialog(_('No rows were imported'), + _('This can have several causes:')+CRLF+ + _(' - File is empty')+CRLF+ + _(' - Wrong file encoding was selected or detected')+CRLF+ + _(' - Field and/or line terminator do not fit to the file contents') ); ModalResult := mrNone; end; @@ -425,7 +425,7 @@ var Inc(ProgressChars); if ProgressChars >= ProgressCharsPerStep then begin Mainform.ProgressStep; - Mainform.ShowStatusMsg('Importing textfile, row '+FormatNumber(RowCount-IgnoreLines)+', '+IntToStr(Mainform.ProgressBarStatus.Position)+'%'); + Mainform.ShowStatusMsg(f_('Importing textfile, row %s, %d%%', [FormatNumber(RowCount-IgnoreLines), Mainform.ProgressBarStatus.Position])); ProgressChars := 0; end; end; @@ -529,7 +529,7 @@ begin Value := ''; OutStream := TMemoryStream.Create; - MainForm.ShowStatusMsg('Reading textfile ('+FormatByteNumber(_GetFileSize(editFilename.Text))+') ...'); + MainForm.ShowStatusMsg(f_('Reading textfile (%s) ...', [FormatByteNumber(_GetFileSize(editFilename.Text))])); Contents := ReadTextfile(editFilename.Text, Encoding); ContentLen := Length(Contents); MainForm.ShowStatusMsg; @@ -585,7 +585,7 @@ var TestStream: TFileStream; begin Dialog := TOpenTextFileDialog.Create(Self); - Dialog.Filter := 'MySQL CSV files (*.csv)|*.csv|Text files (*.txt)|*.txt|All files (*.*)|*.*'; + Dialog.Filter := _('CSV files')+' (*.csv)|*.csv|'+_('Text files')+' (*.txt)|*.txt|'+_('All files')+' (*.*)|*.*'; Dialog.DefaultExt := 'csv'; Dialog.Encodings.Assign(Mainform.FileEncodings); Dialog.EncodingIndex := 0; diff --git a/source/main.pas b/source/main.pas index 6cdbf3db..faea2348 100644 --- a/source/main.pas +++ b/source/main.pas @@ -1178,9 +1178,7 @@ begin ActiveConnection.Query('FLUSH ' + flushwhat); if Sender = actFlushTableswithreadlock then begin MessageDialog( - 'Tables have been flushed and read lock acquired.'#10 + - 'Perform backup or snapshot of table data files now.'#10 + - 'Press OK to unlock when done...', + _('Tables have been flushed and read lock acquired. Perform backup or snapshot of table data files now. Press OK to unlock when done...'), mtInformation, [mbOk] ); ActiveConnection.Query('UNLOCK TABLES'); @@ -1493,8 +1491,8 @@ begin SynMemoSQLLog.Height := Max(AppSettings.ReadInt(asLogHeight), spltTopBottom.MinSize); // Force status bar position to below log memo StatusBar.Top := SynMemoSQLLog.Top + SynMemoSQLLog.Height; - actDataShowNext.Hint := 'Show next '+FormatNumber(AppSettings.ReadInt(asDatagridRowsPerStep))+' rows ...'; - actAboutBox.Caption := 'About '+APPNAME+' '+AppVersion; + actDataShowNext.Hint := f_('Show next %s rows ...', [FormatNumber(AppSettings.ReadInt(asDatagridRowsPerStep))]); + actAboutBox.Caption := f_('About %s', [APPNAME+' '+AppVersion]); // Activate logging LogToFile := AppSettings.ReadBool(asLogToFile); if AppSettings.ReadBool(asLogHorizontalScrollbar) then @@ -1579,7 +1577,7 @@ begin FTreeRefreshInProgress := False; - FileEncodings := Explode(',', 'Auto detect (may fail),ANSI,ASCII,Unicode,Unicode Big Endian,UTF-8,UTF-7'); + FileEncodings := Explode(',', _('Auto detect (may fail)')+',ANSI,ASCII,Unicode,Unicode Big Endian,UTF-8,UTF-7'); end; @@ -2068,13 +2066,13 @@ var begin // Export settings to .txt file Dialog := TSaveDialog.Create(Self); - Dialog.Title := 'Export '+APPNAME+' settings to file ...'; + Dialog.Title := f_('Export %s settings to file ...', [APPNAME]); Dialog.DefaultExt := 'txt'; - Dialog.Filter := 'Textfiles (*.txt)|*.txt|All files (*.*)|*.*'; + Dialog.Filter := _('Text files')+' (*.txt)|*.txt|'+_('All files')+' (*.*)|*.*'; Dialog.Options := Dialog.Options + [ofOverwritePrompt]; if Dialog.Execute then try AppSettings.ExportSettings(Dialog.FileName); - MessageDialog('Settings successfully exported to '+Dialog.FileName, mtInformation, [mbOK]); + MessageDialog(f_('Settings successfully exported to %s', [Dialog.FileName]), mtInformation, [mbOK]); except on E:Exception do ErrorDialog(E.Message); @@ -2089,15 +2087,15 @@ var begin // Import settings from .txt or .reg file Dialog := TOpenDialog.Create(Self); - Dialog.Title := 'Import '+APPNAME+' settings from file ...'; - Dialog.Filter := 'Textfiles (*.txt)|*.txt|Registry dump, deprecated (*.reg)|*.reg|All files (*.*)|*.*'; + Dialog.Title := f_('Import %s settings from file ...', [APPNAME]); + Dialog.Filter := _('Text files')+' (*.txt)|*.txt|'+_('Registry dump, deprecated')+' (*.reg)|*.reg|'+_('All files')+' (*.*)|*.*'; ImportSettingsDone := False; if Dialog.Execute then try if LowerCase(ExtractFileExt(Dialog.FileName)) = 'reg' then ShellExec('regedit.exe', '', '"'+Dialog.FileName+'"') else begin AppSettings.ImportSettings(Dialog.FileName); - MessageDialog('Settings successfully restored from '+Dialog.FileName, mtInformation, [mbOK]); + MessageDialog(f_('Settings successfully restored from %s', [Dialog.FileName]), mtInformation, [mbOK]); end; ImportSettingsDone := True; except @@ -2138,7 +2136,7 @@ begin Tab := ActiveQueryTab; OperationRunning(True); - ShowStatusMsg('Splitting SQL queries ...'); + ShowStatusMsg(_('Splitting SQL queries ...')); Batch := TSQLBatch.Create; if Sender = actExecuteSelection then begin Batch.SQL := Tab.Memo.SelText; @@ -2162,7 +2160,7 @@ begin ActiveConnection.Query('SET profiling=1'); except on E:EDatabaseError do begin - ErrorDialog('Query profiling requires MySQL 5.0.37 or later, and the server must not be configured with --disable-profiling.', E.Message); + ErrorDialog(_('Query profiling requires MySQL 5.0.37 or later, and the server must not be configured with --disable-profiling.'), E.Message); Tab.DoProfile := False; end; end; @@ -2181,10 +2179,10 @@ var Text: String; begin // Update GUI stuff - Text := 'query #' + FormatNumber(Thread.BatchPosition+1); + Text := _('query')+' #' + FormatNumber(Thread.BatchPosition+1); if Thread.QueriesInPacket > 1 then - Text := 'queries #' + FormatNumber(Thread.BatchPosition+1) + ' to #' + FormatNumber(Thread.BatchPosition+Thread.QueriesInPacket); - ShowStatusMsg('Executing '+Text+' of '+FormatNumber(Thread.Batch.Count)+' ...'); + Text := f_('queries #%s to #%s', [FormatNumber(Thread.BatchPosition+1), FormatNumber(Thread.BatchPosition+Thread.QueriesInPacket)]); + ShowStatusMsg(f_('Executing %s of %s ...', [Text, FormatNumber(Thread.Batch.Count)])); SetProgressPosition(Thread.BatchPosition); end; @@ -2200,7 +2198,7 @@ var begin // Single query or query packet has finished - ShowStatusMsg('Setting up result grid(s) ...'); + ShowStatusMsg(_('Setting up result grid(s) ...')); Tab := GetQueryTabByNumber(Thread.TabNumber); // Create result tabs @@ -2217,7 +2215,7 @@ begin TabCaption := NewTab.Results.TableName + ' #' + IntToStr(i); end; except on E:EDatabaseError do - TabCaption := 'Result #'+IntToStr(Tab.ResultTabs.Count); + TabCaption := _('Result')+' #'+IntToStr(Tab.ResultTabs.Count); end; Tab.tabsetQuery.Tabs.Add(TabCaption); @@ -2307,9 +2305,9 @@ begin // Gather meta info for logging MetaInfo := 'Affected rows: '+FormatNumber(Thread.RowsAffected)+ - ' Found rows: '+FormatNumber(Thread.RowsFound)+ - ' Warnings: '+FormatNumber(Thread.WarningCount)+ - ' Duration for ' + FormatNumber(Thread.BatchPosition); + ' '+_('Found rows')+': '+FormatNumber(Thread.RowsFound)+ + ' '+_('Warnings')+': '+FormatNumber(Thread.WarningCount)+ + ' '+_('Duration for')+' ' + FormatNumber(Thread.BatchPosition); if Thread.BatchPosition < Thread.Batch.Count then MetaInfo := MetaInfo + ' of ' + FormatNumber(Thread.Batch.Count); if Thread.Batch.Count = 1 then @@ -2343,13 +2341,13 @@ begin // Show warnings if Thread.WarningCount > 0 then begin - MsgTitle := 'Your query produced '+FormatNumber(Thread.WarningCount)+' warnings.'; + MsgTitle := f_('Your query produced %s warnings.', [FormatNumber(Thread.WarningCount)]); MsgText := ''; Warnings := Thread.Connection.GetResults('SHOW WARNINGS LIMIT 5'); if Warnings.RecordCount < 5 then - MsgText := MsgText + 'Warnings from last query:'+CRLF + MsgText := MsgText + _('Warnings from last query:')+CRLF else if Warnings.RecordCount < Thread.WarningCount then - MsgText := MsgText + 'First '+FormatNumber(Warnings.RecordCount)+' warnings:'+CRLF; + MsgText := MsgText + f_('First %s warnings:', [FormatNumber(Warnings.RecordCount)])+CRLF; while not Warnings.Eof do begin MsgText := MsgText + Warnings.Col('Level') + ': ' + Warnings.Col('Message') + CRLF; Warnings.Next; @@ -2358,10 +2356,10 @@ begin if (Warnings.RecordCount = Thread.WarningCount) or (Warnings.RecordCount < 5) then MessageDialog(MsgTitle, MsgText, mtWarning, [mbOk]) else begin - MsgText := MsgText + CRLF+CRLF + 'Show all warnings in a new query tab?'; + MsgText := MsgText + CRLF+CRLF + _('Show all warnings in a new query tab?'); MaxWarnings := MakeInt(Thread.Connection.GetVar('SELECT @@max_error_count')); if MaxWarnings < Thread.WarningCount then - MsgText := MsgText + CRLF+CRLF+ 'The server variable @@max_error_count is currently set to '+IntToStr(MaxWarnings)+', so you won''t see all warnings.'; + MsgText := MsgText + CRLF+CRLF+ f_('The server variable @@max_error_count is currently set to %d, so you won''t see all warnings.', [MaxWarnings]); if MessageDialog(MsgTitle, MsgText, mtWarning, [mbYes, mbNo]) = mrYes then begin actNewQueryTab.Execute; WarningsTab := QueryTabs[QueryTabs.Count-1]; @@ -2375,7 +2373,7 @@ begin // Store successful query packet in history if it's not a batch. // Assume that a bunch of up to 5 queries is not a batch. if IsEmpty(Thread.ErrorMessage) and (Thread.Batch.Count <= 5) and (Thread.Batch.Size <= SIZE_MB) then begin - ShowStatusMsg('Updating query history ...'); + ShowStatusMsg(_('Updating query history ...')); // Load all items so we can clean up History := TQueryHistory.Create(Thread.Connection.Parameters.SessionPath); @@ -2553,8 +2551,8 @@ begin Exit; Screen.Cursor := crHourGlass; try - ShowStatusMsg('Loading contents into image viewer ...'); - lblPreviewTitle.Caption := 'Loading ...'; + ShowStatusMsg(_('Loading contents into image viewer ...')); + lblPreviewTitle.Caption := _('Loading ...'); lblPreviewTitle.Repaint; imgPreview.Picture := nil; AnyGridEnsureFullRow(Grid, Grid.FocusedNode); @@ -2607,7 +2605,7 @@ begin end; FreeAndNil(ContentStream); end else - lblPreviewTitle.Caption := 'No image detected.'; + lblPreviewTitle.Caption := _('No image detected.'); finally lblPreviewTitle.Hint := lblPreviewTitle.Caption; ShowStatusMsg; @@ -2649,7 +2647,7 @@ begin Grid := ActiveGrid; Results := GridResult(Grid); Dialog := TSaveDialog.Create(Self); - Dialog.Filter := 'All files (*.*)|*.*'; + Dialog.Filter := _('All files')+' (*.*)|*.*'; Dialog.FileName := Results.ColumnOrgNames[Grid.FocusedColumn]; if not (Results.DataType(Grid.FocusedColumn).Category in [dtcBinary, dtcSpatial]) then Dialog.FileName := Dialog.FileName + '.txt'; @@ -2708,7 +2706,7 @@ begin // drop table selected in tree view. case ActiveDBObj.NodeType of lntDb: begin - if MessageDialog('Drop Database "'+Conn.Database+'"?', 'WARNING: You will lose all objects in database '+Conn.Database+'!', mtConfirmation, [mbok,mbcancel]) <> mrok then + if MessageDialog(f_('Drop Database "%s"?', [Conn.Database]), f_('WARNING: You will lose all objects in database %s!', [Conn.Database]), mtConfirmation, [mbok,mbcancel]) <> mrok then Abort; try db := Conn.Database; @@ -2750,7 +2748,7 @@ begin for DBObject in ObjectList do msg := msg + DBObject.Name + ', '; Delete(msg, Length(msg)-1, 2); - if MessageDialog('Drop ' + IntToStr(ObjectList.Count) + ' object(s) in database "'+Conn.Database+'"?', msg, mtConfirmation, [mbok,mbcancel]) = mrOk then begin + if MessageDialog(f_('Drop %d object(s) in database "%s"?', [ObjectList.Count, Conn.Database]), msg, mtConfirmation, [mbok,mbcancel]) = mrOk then begin try // Disable foreign key checks to avoid SQL errors if Conn.ServerVersionInt >= 40014 then @@ -2786,7 +2784,7 @@ begin // Launch mysql.exe Conn := ActiveConnection; if Conn.Parameters.NetTypeGroup <> ngMySQL then - ErrorDialog('Command line only works on MySQL connections.') + ErrorDialog(_('Command line only works on MySQL connections.')) else begin if FIsWine then begin cmd := 'mysql'; @@ -2799,8 +2797,8 @@ begin if (Length(path)>0) and (path[Length(path)] <> sep) then path := path + sep; if not FileExists(path+cmd, true) then begin - ErrorDialog('You need to tell '+APPNAME+' where your MySQL binaries reside, in Tools > Preferences > Miscellaneous.'+ - CRLF+CRLF+'Current setting is: '+CRLF+'"'+path+'"'); + ErrorDialog(f_('You need to tell %s where your MySQL binaries reside, in Tools > Preferences > Miscellaneous.', [APPNAME])+ + CRLF+CRLF+f_('Current setting is: "%s"', [path])); end else begin p := ''; if FIsWine then begin @@ -2832,7 +2830,7 @@ begin rx.Expression := '(\-\-password\=")([^"]*)(")'; log := path + cmd + p; log := rx.Replace(log, '$1********$3', true); - LogSQL('Launching command line: '+log, lcInfo); + LogSQL(f_('Launching command line: %s', [log]), lcInfo); rx.Free; ShellExec(cmd, path, p); end; @@ -2851,7 +2849,7 @@ var begin Dialog := TOpenTextFileDialog.Create(Self); Dialog.Options := Dialog.Options + [ofAllowMultiSelect]; - Dialog.Filter := 'SQL-Scripts (*.sql)|*.sql|All files (*.*)|*.*'; + Dialog.Filter := _('SQL files')+' (*.sql)|*.sql|'+_('All files')+' (*.*)|*.*'; Dialog.DefaultExt := 'sql'; Dialog.Encodings.Assign(FileEncodings); Dialog.EncodingIndex := 0; @@ -2912,36 +2910,36 @@ begin if DoRunFiles then begin if (Win32MajorVersion >= 6) and ThemeServices.ThemesEnabled then begin Dialog := TTaskDialog.Create(Self); - Dialog.Caption := 'Opening large files'; - Dialog.Text := 'Selected files have a size of '+FormatByteNumber(FilesizeSum, 1); - Dialog.ExpandButtonCaption := 'File list'; + Dialog.Caption := _('Opening large files'); + Dialog.Text := f_('Selected files have a size of %s', [FormatByteNumber(FilesizeSum, 1)]); + Dialog.ExpandButtonCaption := _('File list'); Dialog.ExpandedText := PopupFileList.Text; Dialog.Flags := [tfUseCommandLinks, tfExpandFooterArea]; Dialog.CommonButtons := []; Dialog.MainIcon := tdiWarning; Btn := TTaskDialogButtonItem(Dialog.Buttons.Add); - Btn.Caption := 'Run file(s) directly'; - Btn.CommandLinkHint := '... without loading into the editor'; + Btn.Caption := _('Run file(s) directly'); + Btn.CommandLinkHint := _('... without loading into the editor'); Btn.ModalResult := mrYes; Btn := TTaskDialogButtonItem(Dialog.Buttons.Add); - Btn.Caption := 'Load file(s) into the editor'; - Btn.CommandLinkHint := 'Can cause large memory usage'; + Btn.Caption := _('Load file(s) into the editor'); + Btn.CommandLinkHint := _('Can cause large memory usage'); Btn.ModalResult := mrNo; Btn := TTaskDialogButtonItem(Dialog.Buttons.Add); - Btn.Caption := 'Cancel'; + Btn.Caption := _('Cancel'); Btn.ModalResult := mrCancel; Dialog.Execute; DialogResult := Dialog.ModalResult; Dialog.Free; end else begin - msgtext := 'One or more of the selected files are larger than '+FormatByteNumber(RunFileSize, 0)+':' + CRLF + + msgtext := f_('One or more of the selected files are larger than %s:', [FormatByteNumber(RunFileSize, 0)]) + CRLF + ImplodeStr(CRLF, PopupFileList) + CRLF + CRLF + - 'Just run these files to avoid loading them into the query-editor (= memory)?' + CRLF + CRLF + - 'Press' + CRLF + - ' [Yes] to run file(s) without loading it into the editor' + CRLF + - ' [No] to load file(s) into the query editor' + CRLF + - ' [Cancel] to cancel file opening.'; - DialogResult := MessageDialog('Execute query file(s)?', msgtext, mtWarning, [mbYes, mbNo, mbCancel]); + _('Just run these files to avoid loading them into the query-editor (= memory)?') + CRLF + CRLF + + _('Press') + CRLF + + _(' [Yes] to run file(s) without loading it into the editor') + CRLF + + _(' [No] to load file(s) into the query editor') + CRLF + + _(' [Cancel] to cancel file opening.'); + DialogResult := MessageDialog(_('Execute query file(s)?'), msgtext, mtWarning, [mbYes, mbNo, mbCancel]); end; case DialogResult of @@ -2964,7 +2962,7 @@ begin end; if AbsentFiles.Count > 0 then - ErrorDialog('Could not load file(s):', AbsentFiles.Text); + ErrorDialog(_('Could not load file(s):'), AbsentFiles.Text); AbsentFiles.Free; PopupFileList.Free; end; @@ -3084,7 +3082,7 @@ begin StartupScript := Trim(Connection.Parameters.StartupScriptFilename); if StartupScript <> '' then begin if not FileExists(StartupScript) then - ErrorDialog('Startup script file not found: '+StartupScript) + ErrorDialog(f_('Startup script file not found: %s', [StartupScript])) else begin StartupBatch := TSQLBatch.Create; StartupBatch.SQL := ReadTextfile(StartupScript, nil); @@ -3098,8 +3096,8 @@ begin end; if Params.WantSSL and not Connection.IsSSL then begin - MessageDialog('SSL not used.', - 'Your SSL settings were not accepted by the server, or the server does not support any SSL configuration.', + MessageDialog(_('SSL not used.'), + _('Your SSL settings were not accepted by the server, or the server does not support any SSL configuration.'), mtWarning, [mbOK] ); @@ -3123,17 +3121,17 @@ begin Grid := ActiveGrid; Results := GridResult(Grid); if Grid.SelectedCount = 0 then - ErrorDialog('No rows selected', 'Please select one or more rows to delete them.') + ErrorDialog(_('No rows selected'), _('Please select one or more rows to delete them.')) else try Results.CheckEditable; - if MessageDialog('Delete '+IntToStr(Grid.SelectedCount)+' row(s)?', + if MessageDialog(f_('Delete %s row(s)?', [FormatNumber(Grid.SelectedCount)]), mtConfirmation, [mbOK, mbCancel]) = mrOK then begin FocusAfterDelete := nil; EnableProgress(Grid.SelectedCount); Node := GetNextNode(Grid, nil, True); while Assigned(Node) do begin RowNum := Grid.GetNodeData(Node); - ShowStatusMsg('Deleting row #'+FormatNumber(ProgressBarStatus.Position+1)+' of '+FormatNumber(ProgressBarStatus.Max)+' ...'); + ShowStatusMsg(f_('Deleting row #%s of %s ...', [FormatNumber(ProgressBarStatus.Position+1), FormatNumber(ProgressBarStatus.Max)])); Results.RecNo := RowNum^; Results.DeleteRow; ProgressStep; @@ -3142,7 +3140,7 @@ begin FocusAfterDelete := Node; Node := GetNextNode(Grid, Node, True); end; - ShowStatusMsg('Clean up ...'); + ShowStatusMsg(_('Clean up ...')); if Assigned(FocusAfterDelete) then FocusAfterDelete := Grid.GetNext(FocusAfterDelete); // Remove nodes and select some nearby node @@ -3159,7 +3157,7 @@ begin end; except on E:EDatabaseError do begin SetProgressState(pbsError); - ErrorDialog('Grid editing error', E.Message); + ErrorDialog(_('Grid editing error'), E.Message); end; end; DisableProgress; @@ -3223,9 +3221,9 @@ begin Names := ActiveDbObj.Name; end; if Objects.Count = 0 then - ErrorDialog('No table(s) selected.') + ErrorDialog(_('No table(s) selected.')) else begin - if MessageDialog('Empty '+IntToStr(Objects.count)+' table(s) and/or view(s) ?', Names, + if MessageDialog(f_('Empty %d table(s) and/or view(s)?', [Objects.count]), Names, mtConfirmation, [mbOk, mbCancel]) = mrOk then begin Screen.Cursor := crHourglass; EnableProgress(Objects.Count); @@ -3281,7 +3279,7 @@ begin Objects.Add(ActiveDbObj); if Objects.Count = 0 then - ErrorDialog('No stored procedure selected.', 'Please select one or more stored function(s) or routine(s).'); + ErrorDialog(_('No stored procedure selected.'), _('Please select one or more stored function(s) or routine(s).')); for Obj in Objects do begin actNewQueryTab.Execute; @@ -3300,7 +3298,7 @@ begin Query := Query + Obj.QuotedName; Params := TStringList.Create; for Param in Parameters do begin - ParamValue := InputBox(Obj.Name, 'Parameter "'+Param.Name+'" ('+Param.Datatype+')', ''); + ParamValue := InputBox(Obj.Name, _('Parameter')+' "'+Param.Name+'" ('+Param.Datatype+')', ''); ParamValue := Obj.Connection.EscapeString(ParamValue); Params.Add(ParamValue); end; @@ -3385,7 +3383,7 @@ begin FSearchReplaceDialog.Editor.BeginUpdate; - ShowStatusMsg('Searching ...'); + ShowStatusMsg(_('Searching ...')); Occurences := FSearchReplaceDialog.Editor.SearchReplace( FSearchReplaceDialog.comboSearch.Text, Replacement, @@ -3396,11 +3394,11 @@ begin ShowStatusMsg; if ssoReplaceAll in FSearchReplaceDialog.Options then - ShowStatusMsg('Text "'+FSearchReplaceDialog.comboSearch.Text+'" '+FormatNumber(Occurences)+' times replaced.', 0) + ShowStatusMsg(f_('Text "%s" %s times replaced.', [FSearchReplaceDialog.comboSearch.Text, FormatNumber(Occurences)]), 0) else begin if (OldCaretXY.Char = FSearchReplaceDialog.Editor.CaretXY.Char) and (OldCaretXY.Line = FSearchReplaceDialog.Editor.CaretXY.Line) then - MessageDialog('Text "'+FSearchReplaceDialog.comboSearch.Text+'" not found.', mtInformation, [mbOk]); + MessageDialog(f_('Text "%s" not found.', [FSearchReplaceDialog.comboSearch.Text]), mtInformation, [mbOk]); end; end; @@ -3409,7 +3407,7 @@ procedure TMainForm.SynMemoQueryReplaceText(Sender: TObject; const ASearch, AReplace: string; Line, Column: Integer; var Action: TSynReplaceAction); begin // Fires when "Replace all" in search dialog was pressed with activated "Prompt on replace" - case MessageDialog('Replace this occurrence of "'+sstr(ASearch, 100)+'"?', mtConfirmation, [mbYes, mbYesToAll, mbNo, mbCancel]) of + case MessageDialog(f_('Replace this occurrence of "%s"?', [sstr(ASearch, 100)]), mtConfirmation, [mbYes, mbYesToAll, mbNo, mbCancel]) of mrYes: Action := raReplace; mrYesToAll: Action := raReplaceAll; mrNo: Action := raSkip; @@ -3509,7 +3507,7 @@ begin Dialog.Show; Dialog.Keyword := keyword; end else - ErrorDialog('SQL help not available.', 'HELP required MySQL 4.1 or newer.'); + ErrorDialog(_('SQL help not available.'), _('HELP requires MySQL 4.1 or newer.')); end; @@ -3527,7 +3525,7 @@ begin CanSave := mrYes; for i:=0 to QueryTabs.Count-1 do begin if QueryTabs[i].MemoFilename = SaveDialogSQLFile.FileName then begin - CanSave := MessageDialog('Overwrite "'+SaveDialogSQLFile.FileName+'"?', 'This file is already open in query tab #'+IntToStr(QueryTabs[i].Number)+'.', + CanSave := MessageDialog(f_('Overwrite "%s"?', [SaveDialogSQLFile.FileName]), f_('This file is already open in query tab #%d.', [QueryTabs[i].Number]), mtWarning, [mbYes, mbNo, mbCancel]); break; end; @@ -3571,7 +3569,7 @@ var Text, LB: String; begin // Save snippet - if InputQuery( 'Save snippet', 'Snippet name:', snippetname) then + if InputQuery(_('Save snippet'), _('Snippet name:'), snippetname) then begin if Copy( snippetname, Length(snippetname)-4, 4 ) <> '.sql' then snippetname := snippetname + '.sql'; @@ -3579,7 +3577,7 @@ begin snippetname := DirnameSnippets + goodfilename(snippetname); if FileExists( snippetname ) then begin - if MessageDialog('Overwrite existing snippet '+snippetname+'?', mtConfirmation, [mbOK, mbCancel]) <> mrOK then + if MessageDialog(f_('Overwrite existing snippet %s?', [snippetname]), mtConfirmation, [mbOK, mbCancel]) <> mrOK then exit; end; Screen.Cursor := crHourglass; @@ -3665,12 +3663,12 @@ begin popupQueryLoad.Items.Add(menuitem); menuitem := TMenuItem.Create( popupQueryLoad ); - menuitem.Caption := 'Remove absent files'; + menuitem.Caption := _('Remove absent files'); menuitem.OnClick := PopupQueryLoadRemoveAbsentFiles; popupQueryLoad.Items.Add(menuitem); menuitem := TMenuItem.Create( popupQueryLoad ); - menuitem.Caption := 'Clear file list'; + menuitem.Caption := _('Clear file list'); menuitem.OnClick := PopupQueryLoadRemoveAllFiles; popupQueryLoad.Items.Add(menuitem); @@ -3771,7 +3769,7 @@ begin ok := False; while not ok do begin newVal := delimiter; - if InputQuery('Set delimiter', 'SQL statement delimiter (default is ";"):', newVal) then try + if InputQuery(_('Set delimiter'), _('SQL statement delimiter (default is ";"):'), newVal) then try // Set new value Delimiter := newVal; ok := True; @@ -3794,20 +3792,20 @@ begin Value := Trim(Value); Msg := ''; if Value = '' then - Msg := 'Empty value.' + Msg := _('Empty value.') else begin rx := TRegExpr.Create; rx.Expression := '(/\*|--|#|\''|\"|`)'; if rx.Exec(Value) then - Msg := 'Start-of-comment tokens or string literal markers are not allowed.' + Msg := _('Start-of-comment tokens or string literal markers are not allowed.') end; if Msg <> '' then begin - Msg := 'Error setting delimiter to "'+Value+'": '+Msg; + Msg := f_('Error setting delimiter to "%s": %s', [Value, Msg]); LogSQL(Msg, lcError); ErrorDialog(Msg); end else begin FDelimiter := Value; - LogSQL('Delimiter changed to '+FDelimiter, lcInfo); + LogSQL(f_('Delimiter changed to %s', [FDelimiter]), lcInfo); actSetDelimiter.Hint := actSetDelimiter.Caption + ' (current value: '+FDelimiter+')'; end; end; @@ -3905,7 +3903,7 @@ begin end; end; except on E:EDatabaseError do - ErrorDialog('Grid editing error', E.Message); + ErrorDialog(_('Grid editing error'), E.Message); end; end; @@ -4055,9 +4053,7 @@ begin if snip then begin Msg := Copy(Msg, 0, MaxLineWidth) + - '/* large SQL query ('+FormatByteNumber(Len)+'), snipped at ' + - FormatNumber(MaxLineWidth) + - ' characters */'; + '/* '+f_('large SQL query (%s), snipped at %s characters', [FormatByteNumber(Len), FormatNumber(MaxLineWidth)]) + ' */'; end else if (not snip) and IsSQL then Msg := Msg + Delimiter; if not IsSQL then @@ -4090,7 +4086,7 @@ begin on E:Exception do begin LogToFile := False; AppSettings.WriteBool(asLogToFile, False); - ErrorDialog('Error writing to session log file.', E.Message+CRLF+'Filename: '+FFileNameSessionLog+CRLF+CRLF+'Logging is disabled now.'); + ErrorDialog(_('Error writing to session log file.'), E.Message+CRLF+_('Filename')+': '+FFileNameSessionLog+CRLF+CRLF+_('Logging is disabled now.')); end; end; end; @@ -4305,7 +4301,7 @@ begin vt.Clear; try - ShowStatusMsg('Fetching rows ...'); + ShowStatusMsg(_('Fetching rows ...')); // Result object must be of the right vendor type if not RefreshingData then begin FreeAndNil(DataGridResult); @@ -4318,7 +4314,7 @@ begin try DataGridResult.PrepareEditing; except on E:EDatabaseError do // Do not annoy user with popup when accessing tables in information_schema - LogSQL('Data in this table will be read-only.'); + LogSQL(_('Data in this table will be read-only.')); end; editFilterVT.Clear; @@ -4328,7 +4324,7 @@ begin vt.RootNodeCount := DataGridResult.RecordCount; // Set up grid column headers - ShowStatusMsg('Setting up columns ...'); + ShowStatusMsg(_('Setting up columns ...')); VisibleColumns := 0; for i:=0 to WantedColumns.Count-1 do begin InitColumn(i, WantedColumns[i]); @@ -4386,8 +4382,7 @@ begin EnumerateRecentFilters; ColWidths.Free; if Integer(vt.RootNodeCount) = MaximumRows then - LogSQL('Browsing is currently limited to a maximum of '+FormatNumber(MaximumRows)+' rows. To see more rows, increase this maximum in Tools > Preferences > Data .', lcInfo); - + LogSQL(f_('Browsing is currently limited to a maximum of %s rows. To see more rows, increase this maximum in Tools > Preferences > Data.', [FormatNumber(MaximumRows)]), lcInfo); end; vt.Tag := VTREE_LOADED; DataGridFullRowMode := False; @@ -4430,17 +4425,17 @@ begin else RowsTotal := MakeInt(DBObject.Connection.GetVar('SELECT COUNT(*) FROM '+DBObject.QuotedName)); if RowsTotal > -1 then begin - cap := cap + ': ' + FormatNumber(RowsTotal) + ' rows total'; + cap := cap + ': ' + FormatNumber(RowsTotal) + ' ' + _('rows total'); if DBObject.Engine = 'InnoDB' then - cap := cap + ' (approximately)'; + cap := cap + ' ('+_('approximately')+')'; // Display either LIMIT or WHERE effect, not both at the same time if IsLimited then - cap := cap + ', limited to ' + FormatNumber(Datagrid.RootNodeCount) + cap := cap + ', '+_('limited to') + ' ' + FormatNumber(Datagrid.RootNodeCount) else if IsFiltered then begin if Datagrid.RootNodeCount = RowsTotal then - cap := cap + ', all rows match to filter' + cap := cap + ', '+_('all rows match to filter') else - cap := cap + ', ' + FormatNumber(Datagrid.RootNodeCount) + ' rows match to filter'; + cap := cap + ', ' + FormatNumber(Datagrid.RootNodeCount) + ' '+_('rows match to filter'); end; end; end; @@ -4554,7 +4549,7 @@ begin vt.Clear; Msg := ''; if Conn <> nil then begin - ShowStatusMsg( 'Displaying objects from "' + Conn.Database + '" ...' ); + ShowStatusMsg(f_('Displaying objects from "%s" ...', [Conn.Database])); Objects := Conn.GetDBObjects(Conn.Database, vt.Tag = VTREE_NOTLOADED_PURGECACHE, FActiveObjectGroup); vt.RootNodeCount := Objects.Count; @@ -4780,7 +4775,7 @@ begin pid := ListProcesses.Text[Node, ListProcesses.Header.MainColumn]; // Don't kill own process if pid = IntToStr(Conn.ThreadId) then - LogSQL('Ignoring own process id #'+pid+' when trying to kill it.') + LogSQL(f_('Ignoring own process id #%s when trying to kill it.', [pid])) else try Conn.Query('KILL '+pid); except @@ -5152,9 +5147,9 @@ begin if Assigned(Conn) then begin Uptime := Conn.ServerUptime; if Uptime >= 0 then - ShowStatusMsg('Uptime: '+FormatTimeNumber(Conn.ServerUptime, False), 4) + ShowStatusMsg(_('Uptime')+': '+FormatTimeNumber(Conn.ServerUptime, False), 4) else - ShowStatusMsg('Uptime: unknown', 4) + ShowStatusMsg(_('Uptime')+': '+_('unknown'), 4) end else ShowStatusMsg('', 4); end; @@ -5257,7 +5252,7 @@ begin if Item.Tag = 1 then begin // Item needs prompt Val := DataGrid.Text[DataGrid.FocusedNode, DataGrid.FocusedColumn]; - if InputQuery('Specify filter-value...', Item.Caption, Val) then begin + if InputQuery(_('Specify filter-value...'), Item.Caption, Val) then begin if Item = QF8 then Filter := ActiveConnection.QuoteIdent(Col) + ' = ''' + Val + '''' else if Item = QF9 then @@ -5304,7 +5299,7 @@ var begin // set interval for autorefresh-timer SecondsStr := FloatToStr(TimerRefresh.interval div 1000); - if InputQuery('Auto refresh','Refresh list every ... second(s):', SecondsStr) then begin + if InputQuery(_('Auto refresh'),_('Refresh list every ... second(s):'), SecondsStr) then begin Seconds := StrToFloatDef(SecondsStr, 0); if Seconds > 0 then begin TimerRefresh.Interval := Trunc(Seconds * 1000); @@ -5312,7 +5307,7 @@ begin menuAutoRefresh.Checked := true; end else - ErrorDialog('Seconds must be between 0 and ' + IntToStr(maxint) + '.'); + ErrorDialog(f_('Seconds must be between 0 and %d.', [maxint])); end; end; @@ -5407,7 +5402,7 @@ begin end; end; end else - raise Exception.Create('Unspecified source control in drag''n drop operation!'); + raise Exception.Create(_('Unspecified source control in drag''n drop operation!')); if Text <> '' then begin ActiveQueryMemo.SelText := Text; @@ -5554,7 +5549,7 @@ end; procedure TMainForm.Saveastextfile1Click(Sender: TObject); begin with TSaveDialog.Create(self) do begin - Filter := 'Textfiles (*.txt)|*.txt|All Files (*.*)|*.*'; + Filter := _('Text files')+' (*.txt)|*.txt|'+_('All Files')+' (*.*)|*.*'; DefaultExt := 'txt'; FilterIndex := 1; Options := [ofOverwritePrompt,ofHideReadOnly,ofEnableSizing]; @@ -5779,7 +5774,7 @@ begin if DataGrid.FocusedColumn = NoColumn then Exit; Col := DataGridResult.ColumnOrgNames[DataGrid.FocusedColumn]; - ShowStatusMsg('Fetching distinct values ...'); + ShowStatusMsg(_('Fetching distinct values ...')); Conn := ActiveConnection; Data := Conn.GetResults('SELECT '+Conn.QuoteIdent(Col)+', COUNT(*) AS c FROM '+ActiveDbObj.QuotedName+ ' GROUP BY '+Conn.QuoteIdent(Col)+' ORDER BY c DESC, '+Conn.QuoteIdent(Col)+' LIMIT 30'); @@ -5815,17 +5810,17 @@ begin DataYear.Caption := 'YEAR: ' + Format('%.4d', [y]); GetSystemTime(SystemTime); UnixTimestamp := DateTimeToUnix(SystemTimeToDateTime(SystemTime)); - DataUNIXtimestamp.Caption := 'UNIX Timestamp: ' + IntToStr(UnixTimestamp); + DataUNIXtimestamp.Caption := _('UNIX Timestamp')+': ' + IntToStr(UnixTimestamp); CreateGuid(Uid); DataGUID.Caption := 'GUID: ' + GuidToString(Uid); ColNum := DataGrid.FocusedColumn; - DataDefaultValue.Caption := 'Default: ?'; + DataDefaultValue.Caption := _('Default value')+': ?'; DataDefaultValue.Enabled := False; if ColNum <> NOCOLUMN then begin for Col in SelectedTableColumns do begin if (Col.Name = DataGrid.Header.Columns[ColNum].Text) and (Col.DefaultType = cdtText) then begin - DataDefaultValue.Caption := 'Default: '+Col.DefaultText; + DataDefaultValue.Caption := _('Default value')+': '+Col.DefaultText; DataDefaultValue.Enabled := True; break; end; @@ -5926,7 +5921,7 @@ begin if Assigned(FoundNode) then SelectNode(DBTree, FoundNode) else - LogSQL('Table node "' + Obj.Name + '" not found in tree.', lcError); + LogSQL(f_('Table node "%s" not found in tree.', [Obj.Name]), lcError); end; @@ -6086,7 +6081,7 @@ begin Exit; snippetfile := DirnameSnippets + ActiveQueryHelpers.Text[ActiveQueryHelpers.FocusedNode, 0] + '.sql'; - if MessageDialog('Delete snippet file?', snippetfile, mtConfirmation, [mbOk, mbCancel]) = mrOk then + if MessageDialog(_('Delete snippet file?'), snippetfile, mtConfirmation, [mbOk, mbCancel]) = mrOk then begin Screen.Cursor := crHourGlass; if DeleteFile(snippetfile) then begin @@ -6095,7 +6090,7 @@ begin FillPopupQueryLoad; end else begin Screen.Cursor := crDefault; - ErrorDialog('Failed deleting ' + snippetfile); + ErrorDialog(f_('Failed deleting %s', [snippetfile])); end; Screen.Cursor := crDefault; end; @@ -6131,7 +6126,8 @@ begin if DirectoryExists(DirnameSnippets) then ShellExec('', DirnameSnippets) else - if MessageDialog('Snippets folder does not exist', 'The folder "'+DirnameSnippets+'" is normally created when you install '+appname+'.' + CRLF + CRLF + 'Shall it be created now?', + if MessageDialog(_('Snippets folder does not exist'), + f_('The folder "%s" is normally created when you install %s.', [DirnameSnippets, APPNAME]) + CRLF + CRLF + _('Shall it be created now?'), mtWarning, [mbYes, mbNo]) = mrYes then try Screen.Cursor := crHourglass; @@ -6149,7 +6145,7 @@ begin // Clear query history items in registry AppSettings.SessionPath := ActiveConnection.Parameters.SessionPath + '\' + REGKEY_QUERYHISTORY; Values := AppSettings.GetValueNames; - if MessageDialog('Clear query history?', FormatNumber(Values.Count)+' history items will be deleted.', mtConfirmation, [mbYes, mbNo]) = mrYes then begin + if MessageDialog(_('Clear query history?'), f_('%s history items will be deleted.', [FormatNumber(Values.Count)]), mtConfirmation, [mbYes, mbNo]) = mrYes then begin Screen.Cursor := crHourglass; AppSettings.DeleteCurrentKey;; RefreshHelperNode(HELPERNODE_HISTORY); @@ -6411,10 +6407,10 @@ begin {$I+} if IOResult <> 0 then begin AppSettings.WriteBool(asLogToFile, False); - ErrorDialog('Error opening session log file', FFileNameSessionLog+CRLF+CRLF+'Logging is disabled now.'); + ErrorDialog(_('Error opening session log file'), FFileNameSessionLog+CRLF+CRLF+_('Logging is disabled now.')); end else begin FLogToFile := Value; - LogSQL('Writing to session log file now: '+FFileNameSessionLog); + LogSQL(f_('Writing to session log file now: %s', [FFileNameSessionLog])); end; end else begin {$I-} // Supress errors @@ -6423,7 +6419,7 @@ begin // Reset IOResult so later checks in ActivateFileLogging doesn't get an old value IOResult; FLogToFile := Value; - LogSQL('Writing to session log file disabled now'); + LogSQL(_('Writing to session log file disabled now')); end; end; @@ -6573,7 +6569,7 @@ begin SynMemoProcessView.Color := clWindow; end else begin SynMemoProcessView.Highlighter := nil; - SynMemoProcessView.Text := 'Please select a process in the above list.'; + SynMemoProcessView.Text := _('Please select a process in the above list.'); SynMemoProcessView.Color := clBtnFace; end; lblExplainProcess.Enabled := enableSQLView @@ -6986,7 +6982,7 @@ begin // Session node expanding lntNone: begin Screen.Cursor := crHourglass; - ShowStatusMsg('Reading Databases...'); + ShowStatusMsg(_('Reading Databases...')); if Sender.Tag = VTREE_NOTLOADED_PURGECACHE then DBObj.Connection.RefreshAllDatabases; ShowStatusMsg; @@ -7001,7 +6997,7 @@ begin // Just tables, views, etc. ChildCount := 6; end else begin - ShowStatusMsg( 'Reading objects ...' ); + ShowStatusMsg(_('Reading objects ...')); Screen.Cursor := crHourglass; try ChildCount := DBObj.Connection.GetDBObjects(DBObj.Connection.AllDatabases[Node.Index]).Count; @@ -7188,7 +7184,7 @@ begin // When clicked node is from a different connection than before, do session specific stuff here: if (PrevDBObj = nil) or (PrevDBObj.Connection <> FActiveDbObj.Connection) then begin - LogSQL('Entering session "'+FActiveDbObj.Connection.Parameters.SessionPath+'"', lcInfo); + LogSQL(f_('Entering session "%s"', [FActiveDbObj.Connection.Parameters.SessionPath]), lcInfo); RefreshHelperNode(HELPERNODE_HISTORY); case FActiveDbObj.Connection.Parameters.NetTypeGroup of ngMySQL: @@ -7209,14 +7205,14 @@ begin InvalidateVT(ListTables, VTREE_NOTLOADED, True); if FActiveDbObj.NodeType = lntGroup then InvalidateVT(ListTables, VTREE_NOTLOADED, True); - tabHost.Caption := 'Host: '+sstr(FActiveDbObj.Connection.Parameters.HostName, 20); - tabDatabase.Caption := 'Database: '+sstr(FActiveDbObj.Connection.Database, 20); + tabHost.Caption := _('Host')+': '+sstr(FActiveDbObj.Connection.Parameters.HostName, 20); + tabDatabase.Caption := _('Database')+': '+sstr(FActiveDbObj.Connection.Database, 20); ShowStatusMsg(FActiveDbObj.Connection.Parameters.NetTypeName(FActiveDbObj.Connection.Parameters.NetType, False)+' '+FActiveDbObj.Connection.ServerVersionStr, 3); end else begin LogSQL('DBtreeFocusChanged without node.', lcDebug); FreeAndNil(FActiveDbObj); - tabHost.Caption := 'Host'; - tabDatabase.Caption := 'Database'; + tabHost.Caption := _('Host'); + tabDatabase.Caption := _('Database'); // Clear server version panel ShowStatusMsg('', 3); end; @@ -7450,7 +7446,7 @@ begin except end; if not Assigned(DBtree.FocusedNode) then - raise Exception.Create('Could not find node to focus.'); + raise Exception.Create(_('Could not find node to focus.')); finally FTreeRefreshInProgress := False; @@ -7866,7 +7862,7 @@ begin try GridResult(Sender).CheckEditable; if not AnyGridEnsureFullRow(Sender as TVirtualStringTree, Node) then - ErrorDialog('Could not load full row data.') + ErrorDialog(_('Could not load full row data.')) else begin Allowed := True; // Move Esc shortcut from "Cancel row editing" to "Cancel cell editing" @@ -7874,7 +7870,7 @@ begin actDataPostChanges.ShortCut := 0; end; except on E:EDatabaseError do - ErrorDialog('Grid editing error', E.Message); + ErrorDialog(_('Grid editing error'), E.Message); end; end; @@ -8458,7 +8454,7 @@ begin and (Conn <> nil) and (Conn.Parameters.NetTypeGroup <> ngMySQL) then begin vt.Clear; - vt.EmptyListMessage := 'Not available on '+Conn.Parameters.NetTypeName(Conn.Parameters.NetType, False); + vt.EmptyListMessage := f_('Not available on %s', [Conn.Parameters.NetTypeName(Conn.Parameters.NetType, False)]); vt.Tag := VTREE_LOADED; Exit; end; @@ -9545,12 +9541,12 @@ begin Exit; // Special case if passed text is empty: Reset query tab caption to "Query #123" if (PageIndex = tabQuery.PageIndex) and (Text = '') then - Text := 'Query'; + Text := _('Query'); if IsQueryTab(PageIndex, False) then begin if Text = '' then begin for Tab in QueryTabs do begin if Tab.TabSheet = PageControlMain.Pages[PageIndex] then begin - Text := 'Query #'+IntToStr(Tab.Number); + Text := _('Query')+' #'+IntToStr(Tab.Number); break; end; end; @@ -9575,10 +9571,10 @@ begin // Unhide tabsheet so the user sees the memo content Tab.TabSheet.PageControl.ActivePage := Tab.TabSheet; if Tab.MemoFilename <> '' then - msg := 'Save changes to file '+CRLF+CRLF+Tab.MemoFilename+' ?' + msg := f_('Save changes to file %s ?', [Tab.MemoFilename]) else - msg := 'Save content of tab "'+Trim(Tab.TabSheet.Caption)+'" ?'; - case MessageDialog('Modified query', msg, mtConfirmation, [mbYes, mbNo, mbCancel]) of + msg := f_('Save content of tab "%s"?', [Trim(Tab.TabSheet.Caption)]); + case MessageDialog(_('Modified query'), msg, mtConfirmation, [mbYes, mbNo, mbCancel]) of mrNo: Result := True; mrYes: begin if Tab.MemoFilename <> '' then @@ -9728,9 +9724,8 @@ begin Keystroke.ShortCut2 := Shortcut2; except on E:ESynKeyError do begin - LogSQL('Could not apply SynEdit keystroke shortcut "'+ShortCutToText(Shortcut1)+'"' + - ' (or secondary: "'+ShortCutToText(Shortcut2)+'") to '+EditorCommandToCodeString(Keystroke.Command)+'. '+ - E.Message + '. Please go to Tools > Preferences > Shortcuts to change this settings.', lcError); + LogSQL(f_('Could not apply SynEdit keystroke shortcut "%s" (or secondary: "%s") to %s. %s. Please go to Tools > Preferences > Shortcuts to change this settings.', + [ShortCutToText(Shortcut1), ShortCutToText(Shortcut2), EditorCommandToCodeString(Keystroke.Command), E.Message]), lcError); end; end; end else @@ -9755,7 +9750,7 @@ begin // Reformat SQL query m := ActiveSynMemo; if not Assigned(m) then begin - ErrorDialog('Cannot reformat', 'Please select a non-readonly SQL editor first.'); + ErrorDialog(_('Cannot reformat'), _('Please select a non-readonly SQL editor first.')); Exit; end; CursorPosStart := m.SelStart; @@ -9764,7 +9759,7 @@ begin m.SelectAll; NewSQL := m.SelText; if Length(NewSQL) = 0 then - ErrorDialog('Cannot reformat anything', 'The current editor is empty.') + ErrorDialog(('Cannot reformat'), _('The current editor is empty.')) else begin Screen.Cursor := crHourglass; m.UndoList.AddGroupBreak; @@ -9946,7 +9941,7 @@ var begin // Probably a second instance is posting its command line parameters here if (Msg.CopyDataStruct.dwData = SecondInstMsgId) and (SecondInstMsgId <> 0) then begin - LogSQL('Preventing second application instance - disabled in Tools > Preferences > Miscellaneous.', lcInfo); + LogSQL(_('Preventing second application instance - disabled in Tools > Preferences > Miscellaneous.'), lcInfo); ConnectionParams := nil; ParseCommandLine(ParamBlobToStr(Msg.CopyDataStruct.lpData), ConnectionParams, FileNames); if not RunQueryFiles(FileNames, nil) then begin @@ -10043,7 +10038,7 @@ procedure TMainForm.AnyGridStartOperation(Sender: TBaseVirtualTree; OperationKin begin // Display status message on long running sort operations if OperationKind = okSortTree then begin - ShowStatusMsg('Sorting grid nodes ...'); + ShowStatusMsg(_('Sorting grid nodes ...')); FOperatingGrid := Sender; OperationRunning(True); end; @@ -10070,14 +10065,14 @@ begin // Stop current operation (sorting grid or running user queries) if FOperatingGrid <> nil then begin FOperatingGrid.CancelOperation; - LogSQL('Sorting cancelled.'); + LogSQL(_('Sorting cancelled.')); end; for Tab in QueryTabs do begin if Tab.QueryRunning then begin Tab.ExecutionThread.Aborted := True; Killer := ActiveConnection.Parameters.CreateConnection(Self); Killer.Parameters := ActiveConnection.Parameters; - Killer.LogPrefix := 'HelperConnection'; + Killer.LogPrefix := _('Helper connection'); Killer.OnLog := LogSQL; Killer.Active := True; KillCommand := 'KILL '; @@ -10373,16 +10368,16 @@ begin HELPERNODE_COLUMNS: begin CellText := 'Columns'; if ActiveDbObj <> nil then case ActiveDbObj.NodeType of - lntProcedure, lntFunction: CellText := 'Parameters in '+ActiveDbObj.Name; - lntTable, lntView: CellText := 'Columns in '+ActiveDbObj.Name; + lntProcedure, lntFunction: CellText := f_('Parameters in %s', [ActiveDbObj.Name]); + lntTable, lntView: CellText := f_('Columns in %s', [ActiveDbObj.Name]); end; end; - HELPERNODE_FUNCTIONS: CellText := 'SQL Functions'; - HELPERNODE_KEYWORDS: CellText := 'SQL Keywords'; - HELPERNODE_SNIPPETS: CellText := 'Snippets'; - HELPERNODE_HISTORY: CellText := 'Query history'; + HELPERNODE_FUNCTIONS: CellText := _('SQL functions'); + HELPERNODE_KEYWORDS: CellText := _('SQL keywords'); + HELPERNODE_SNIPPETS: CellText := _('Snippets'); + HELPERNODE_HISTORY: CellText := _('Query history'); HELPERNODE_PROFILE: begin - CellText := 'Query profile'; + CellText := _('Query profile'); if Assigned(Tab.QueryProfile) then CellText := CellText + ' ('+FormatNumber(Tab.ProfileTime, 6)+'s)'; end; @@ -10402,9 +10397,9 @@ begin HELPERNODE_HISTORY: begin CellText := Tab.HistoryDays[Node.Index]; if CellText = DateToStr(Today) then - CellText := CellText + ', today' + CellText := CellText + ', '+_('today') else if CellText = DateToStr(Yesterday) then - CellText := CellText + ', yesterday'; + CellText := CellText + ', '+_('yesterday'); end; HELPERNODE_PROFILE: begin if Assigned(Tab.QueryProfile) then begin @@ -10546,7 +10541,7 @@ begin end; except on E:Exception do begin - LogSQL('Error with snippets directory: '+E.Message, lcError); + LogSQL(f_('Error with snippets directory: %s', [E.Message]), lcError); end; end; RefreshHelperNode(HELPERNODE_SNIPPETS); @@ -10788,7 +10783,7 @@ begin case Action of waRemoved: if IsCurrentFile - and (MessageDialog('Close file and query tab?', 'File was deleted from outside: '+MemoFilename, mtConfirmation, [mbYes, mbCancel]) = mrYes) then begin + and (MessageDialog(_('Close file and query tab?'), f_('File was deleted from outside: %s', [MemoFilename]), mtConfirmation, [mbYes, mbCancel]) = mrYes) then begin Mainform.actClearQueryEditor.Execute; if Mainform.IsQueryTab(TabSheet.PageIndex, False) then Mainform.CloseQueryTab(TabSheet.PageIndex); @@ -10820,7 +10815,7 @@ var OldCursor: TBufferCoord; begin (Sender as TTimer).Enabled := False; - if MessageDialog('Reload file?', 'File was modified from outside: '+MemoFilename, mtConfirmation, [mbYes, mbCancel]) = mrYes then begin + if MessageDialog(_('Reload file?'), f_('File was modified from outside: %s', [MemoFilename]), mtConfirmation, [mbYes, mbCancel]) = mrYes then begin OldCursor := Memo.CaretXY; OldTopLine := Memo.TopLine; LoadContents(MemoFilename, True, nil); @@ -10843,7 +10838,7 @@ begin // so we have to do it by replacing the SelText property Screen.Cursor := crHourGlass; Filesize := _GetFileSize(filename); - MainForm.LogSQL('Loading file "'+Filename+'" ('+FormatByteNumber(Filesize)+') into query tab #'+IntToStr(Number)+' ...', lcInfo); + MainForm.LogSQL(f_('Loading file "%s" (%s) into query tab #%d ...', [Filename, FormatByteNumber(Filesize), Number]), lcInfo); try Content := ReadTextfile(Filename, Encoding); if Pos(DirnameSnippets, Filename) = 0 then @@ -10868,7 +10863,7 @@ begin MemoLineBreaks := LineBreaks; end; if MemoLineBreaks = lbsMixed then - MessageDialog('This file contains mixed linebreaks. They have been converted to Windows linebreaks (CR+LF).', mtInformation, [mbOK]); + MessageDialog(_('This file contains mixed linebreaks. They have been converted to Windows linebreaks (CR+LF).'), mtInformation, [mbOK]); Memo.SelText := Content; Memo.SelStart := Memo.SelEnd; @@ -10889,7 +10884,7 @@ var Text, LB: String; begin Screen.Cursor := crHourGlass; - MainForm.ShowStatusMsg('Saving file ...'); + MainForm.ShowStatusMsg(_('Saving file ...')); if OnlySelection then Text := Memo.SelText else diff --git a/source/options.pas b/source/options.pas index 8161210c..e9753011 100644 --- a/source/options.pas +++ b/source/options.pas @@ -383,7 +383,7 @@ begin SynSQLSynSQLSample.Attribute[i].AssignColorAndStyle(MainForm.SynSQLSyn1.Attribute[i]); comboSQLColElement.Items.Add(SynSQLSynSQLSample.Attribute[i].FriendlyName); end; - comboSQLColElement.Items.Add('Active line background'); + comboSQLColElement.Items.Add(_('Active line background')); comboSQLColElement.ItemIndex := 0; // Shortcuts @@ -392,7 +392,7 @@ begin if FShortcutCategories.IndexOf(Mainform.ActionList1.Actions[i].Category) = -1 then FShortcutCategories.Add(Mainform.ActionList1.Actions[i].Category); end; - FShortcutCategories.Add('SQL editing'); + FShortcutCategories.Add(_('SQL editing')); TreeShortcutItems.RootNodeCount := FShortcutCategories.Count; end; @@ -524,7 +524,7 @@ begin // Select folder for session logs Browse := TBrowseForFolder.Create(Self); Browse.Folder := (Sender as TButtonedEdit).Text; - Browse.DialogCaption := 'Select output directory'; + Browse.DialogCaption := _('Select output directory'); // Enable "Create new folder" button Browse.BrowseOptions := Browse.BrowseOptions - [bifNoNewFolderButton] + [bifNewDialogStyle]; if Browse.Execute then begin @@ -542,7 +542,7 @@ begin // Select folder where MySQL binaries reside Browse := TBrowseForFolder.Create(Self); Browse.Folder := (Sender as TButtonedEdit).Text; - Browse.DialogCaption := 'Find mysql.exe directory'; + Browse.DialogCaption := _('Find mysql.exe directory'); Browse.BrowseOptions := Browse.BrowseOptions + [bifNewDialogStyle]; if Browse.Execute then begin (Sender as TButtonedEdit).Text := Browse.Folder; @@ -658,8 +658,8 @@ var i: Integer; begin // Factory defaults - if MessageDialog('Reset all preference options to default values?', - 'This also applies to automatic settings, e.g. toolbar positions.', + if MessageDialog(_('Reset all preference options to default values?'), + _('This also applies to automatic settings, e.g. toolbar positions.'), mtConfirmation, [mbOK, mbCancel]) = mrCancel then Exit; AppSettings.ResetPath; diff --git a/source/routine_editor.pas b/source/routine_editor.pas index 2e03c580..1edfaebd 100644 --- a/source/routine_editor.pas +++ b/source/routine_editor.pas @@ -106,8 +106,8 @@ begin ScaleControls(Screen.PixelsPerInch, FORMS_DPI); // Combo items in a .dfm are sporadically lost after an IDE restart, // so we set them here to avoid developer annoyance - comboType.Items.Add('Procedure (doesn''t return a result)'); - comboType.Items.Add('Function (returns a result)'); + comboType.Items.Add(_('Procedure (doesn''t return a result)')); + comboType.Items.Add(_('Function (returns a result)')); comboDataAccess.Items.Add('Contains SQL'); comboDataAccess.Items.Add('No SQL'); comboDataAccess.Items.Add('Reads SQL data'); @@ -153,8 +153,8 @@ begin comboSecurity.ItemIndex := 0; editComment.Clear; comboDefiner.Text := ''; - comboDefiner.TextHint := 'Current user ('+Obj.Connection.CurrentUserHostCombination+')'; - comboDefiner.Hint := 'Leave empty for current user ('+Obj.Connection.CurrentUserHostCombination+')'; + comboDefiner.TextHint := f_('Current user (%s)', [Obj.Connection.CurrentUserHostCombination]); + comboDefiner.Hint := f_('Leave empty for current user (%s)', [Obj.Connection.CurrentUserHostCombination]); SynMemoBody.Text := 'BEGIN'+CRLF+CRLF+'END'; if DBObject.Name <> '' then begin // Editing existing routine @@ -408,7 +408,7 @@ begin Allowed := Column > 0; if (Column = 3) and (comboType.ItemIndex = 1) then begin Allowed := False; - MessageDialog('A stored function can only have IN parameters so context editing is blocked.', mtInformation, [mbOK]); + MessageDialog(_('A stored function can only have IN parameters so context editing is blocked.'), mtInformation, [mbOK]); end; end; @@ -471,7 +471,7 @@ begin TargetExists := ((editName.Text <> DBObject.Name) or (ProcOrFunc <> FAlterRoutineType)) and (allRoutineNames.IndexOf(editName.Text) > -1); if TargetExists then begin - Result := MessageDialog('Overwrite?', 'Routine "'+editName.Text+'" already exists.', + Result := MessageDialog(f_('Overwrite "%s"?', [editName.Text]), f_('Routine "%s" already exists.', [editName.Text]), mtConfirmation, [mbYes, mbNo, mbCancel]); if Result = mrNo then Exit; diff --git a/source/runsqlfile.pas b/source/runsqlfile.pas index 7402fcae..e537bb5f 100644 --- a/source/runsqlfile.pas +++ b/source/runsqlfile.pas @@ -135,7 +135,7 @@ begin except on E:EFileStreamError do begin - ErrorDialog('Error while reading file "'+SQLFileName+'"', E.Message); + ErrorDialog(f_('Error while reading file "%s"', [SQLFileName]), E.Message); Mainform.AddOrRemoveFromQueryLoadHistory(SQLFileName, False, True); Mainform.FillPopupQueryLoad; end; diff --git a/source/searchreplace.pas b/source/searchreplace.pas index 2794520f..70a64886 100644 --- a/source/searchreplace.pas +++ b/source/searchreplace.pas @@ -57,14 +57,14 @@ begin if comboSearch.Items.Count > 0 then comboSearch.Text := comboSearch.Items[0]; if comboReplace.Items.Count > 0 then comboReplace.Text := comboReplace.Items[0]; - chkRegularExpression.Hint := 'Search patterns:'+CRLF+ - ' ^ Start of line'+CRLF+ - ' $ End of line'+CRLF+ - ' \w Any word character'+CRLF+ - ' \d Digit (0-9)'+CRLF+ - ' \s Whitespace'+CRLF+ - 'Replacement patterns:'+CRLF+ - ' $0 .. $n Callback parentheses' + chkRegularExpression.Hint := _('Search patterns:')+CRLF+ + ' ^ '+_('Start of line')+CRLF+ + ' $ '+_('End of line')+CRLF+ + ' \w '+_('Any word character')+CRLF+ + ' \d '+_('Digit')+' (0-9)'+CRLF+ + ' \s '+_('Whitespace')+CRLF+ + _('Replacement patterns:')+CRLF+ + ' $0 .. $n '+_('Callback parentheses') ; end; diff --git a/source/sqlhelp.pas b/source/sqlhelp.pas index 5a2cfc60..333cc9e8 100644 --- a/source/sqlhelp.pas +++ b/source/sqlhelp.pas @@ -137,9 +137,9 @@ begin // Show the user if topic is (not) available if memoDescription.GetTextLen = 0 then - memoDescription.Text := 'No help available for this keyword or no keyword was selected.'; + memoDescription.Text := _('No help available for this keyword or no keyword was selected.'); if memoExample.GetTextLen = 0 then - memoExample.Text := 'No example available or no keyword was selected.'; + memoExample.Text := _('No example available or no keyword was selected.'); end; diff --git a/source/syncdb.pas b/source/syncdb.pas index 2979eb8c..c4179805 100644 --- a/source/syncdb.pas +++ b/source/syncdb.pas @@ -123,7 +123,7 @@ begin AppSettings.GetSessionPaths('', SessionPaths); comboTargetServer.Items.Assign(SessionPaths); SessionPaths.Free; - comboTargetServer.Items.Insert(0, 'Select server session ...'); + comboTargetServer.Items.Insert(0, _('Select server session ...')); comboTargetServer.ItemIndex := 0; comboTargetServer.OnChange(Sender); end; @@ -150,7 +150,7 @@ begin comboTargetDatabase.Items.Assign(Connection.AllDatabases); Connection.Active := False; Connection.Free; - comboTargetDatabase.Items.Insert(0, '[Same as source]'); + comboTargetDatabase.Items.Insert(0, '['+_('Same as source')+']'); comboTargetDatabase.ItemIndex := 0; comboTargetDatabase.OnChange(Sender); end; @@ -179,7 +179,7 @@ begin Connection.Active := False; Connection.Free; end; - comboTargetTable.Items.Insert(0, '[Same as source]'); + comboTargetTable.Items.Insert(0, '['+_('Same as source')+']'); comboTargetTable.ItemIndex := 0; end; @@ -424,7 +424,7 @@ begin end; end; if not ObjExists then begin - Diff.AddItem('Create missing '+LowerCase(SourceObj.ObjType), SourceObj.CreateCode, diCreate); + Diff.AddItem(f_('Create missing %s', [LowerCase(SourceObj.ObjType)]), SourceObj.CreateCode, diCreate); end; treeDifferences.EndUpdate; end; diff --git a/source/table_editor.pas b/source/table_editor.pas index 2e238e5e..825967b2 100644 --- a/source/table_editor.pas +++ b/source/table_editor.pas @@ -473,7 +473,7 @@ var end; begin // Compose ALTER query, called by buttons and for SQL code tab - Mainform.ShowStatusMsg('Composing ALTER statement ...'); + Mainform.ShowStatusMsg(_('Composing ALTER statement ...')); Screen.Cursor := crHourglass; Specs := TStringList.Create; SQL := ''; @@ -1039,7 +1039,7 @@ begin 4, 5, 6: CellText := ''; // Checkbox 7: begin case Col.DefaultType of - cdtNothing: CellText := 'No default'; + cdtNothing: CellText := _('No default'); cdtText, cdtTextUpdateTS: begin if Col.DataType.Category in [dtcInteger, dtcReal] then CellText := Col.DefaultText @@ -1135,7 +1135,7 @@ begin 1: begin // Name of column for i:=0 to FColumns.Count-1 do begin if FColumns[i].Name = NewText then begin - ErrorDialog('Column "'+NewText+'" already exists.'); + ErrorDialog(f_('Column "%s" already exists.', [NewText])); Exit; end; end; @@ -1756,7 +1756,8 @@ begin Col := SourceVT.GetNodeData(SourceVT.FocusedNode); ColName := Col.Name; if TblKey.Columns.IndexOf(ColName) > -1 then begin - if MessageDialog('Add duplicated column to index?', 'Index "'+VT.Text[Node, 0]+'" already contains the column "'+ColName+'". It is possible to add a column twice into a index, but total nonsense in practice.', + if MessageDialog(_('Add duplicated column to index?'), + f_('Index "%s" already contains the column "%s". It is possible to add a column twice into a index, but total nonsense in practice.', [VT.Text[Node, 0], ColName]), mtConfirmation, [mbYes, mbNo]) = mrNo then Exit; end; @@ -1813,7 +1814,7 @@ begin SupportsForeignKeys := LowerCase(comboEngine.Text) = 'innodb'; ListForeignKeys.Enabled := SupportsForeignKeys; tlbForeignKeys.Enabled := SupportsForeignKeys; - pnlNoForeignKeys.Caption := 'The selected table engine ('+comboEngine.Text+') does not support foreign keys.'; + pnlNoForeignKeys.Caption := f_('The selected table engine (%s) does not support foreign keys.', [comboEngine.Text]); if SupportsForeignKeys then ListForeignKeys.Margins.Bottom := 0 else @@ -1944,8 +1945,8 @@ begin for i:=0 to FKeys.Count-1 do begin TblKey := FKeys[i]; if (TblKey.IndexType = NewType) and (TblKey.Columns.Text = NewParts.Text) then begin - if MessageDialog('Key already exists. Really create another identical one?', - 'This will increase disk usage and probably slow down queries on this table.', + if MessageDialog(_('Key already exists. Really create another identical one?'), + _('This will increase disk usage and probably slow down queries on this table.'), mtConfirmation, [mbYes, mbNo]) = mrNo then Exit; break; @@ -2054,14 +2055,14 @@ begin Key := FForeignKeys[Node.Index]; Allowed := False; if Key.ReferenceTable = '' then - ErrorDialog('Please select a reference table before selecting foreign columns.') + ErrorDialog(_('Please select a reference table before selecting foreign columns.')) else begin try DBObject.Connection.GetVar('SELECT 1 FROM '+DBObject.Connection.QuoteIdent(Key.ReferenceTable, True, '.')); Allowed := True; except // Leave Allowed = False - ErrorDialog('Reference table "'+Key.ReferenceTable+'" seems to be missing, broken or non-accessible.') + ErrorDialog(f_('Reference table "%s" seems to be missing, broken or non-accessible.', [Key.ReferenceTable])) end; end; end else diff --git a/source/tabletools.pas b/source/tabletools.pas index bb62d155..653c77c8 100644 --- a/source/tabletools.pas +++ b/source/tabletools.pas @@ -189,7 +189,7 @@ begin // Find text tab memoFindText.Text := AppSettings.ReadString(asTableToolsFindText); - comboDatatypes.Items.Add('All data types'); + comboDatatypes.Items.Add(_('All data types')); for dtc:=Low(DatatypeCategories) to High(DatatypeCategories) do comboDatatypes.Items.Add(DatatypeCategories[dtc].Name); comboDatatypes.ItemIndex := AppSettings.ReadInt(asTableToolsDatatype); @@ -367,7 +367,7 @@ var begin SomeChecked := TreeObjects.CheckedCount > 0; btnSeeResults.Visible := tabsTools.ActivePage = tabFind; - lblCheckedSize.Caption := 'Selected objects size: '+FormatByteNumber(FObjectSizes); + lblCheckedSize.Caption := f_('Selected objects size: %s', [FormatByteNumber(FObjectSizes)]); if tabsTools.ActivePage = tabMaintenance then begin btnExecute.Caption := 'Execute'; btnExecute.Enabled := (Pos(SUnsupported, comboOperation.Text) = 0) and SomeChecked; @@ -722,7 +722,7 @@ begin + SQL; AddResults(SQL); end else - AddNotes(DBObj.Database, DBObj.Name, STRSKIPPED+DBObj.ObjType+' doesn''t have columns of selected type ('+comboDatatypes.Text+').', ''); + AddNotes(DBObj.Database, DBObj.Name, f_('%s%s doesn''t have columns of selected type (%s).', [STRSKIPPED, DBObj.ObjType, comboDatatypes.Text]), ''); end; Columns.Free; end; @@ -847,8 +847,7 @@ begin ResultGrid.FocusedNode := ResultGrid.GetLast; ResultGrid.Selected[ResultGrid.FocusedNode] := True; Percent := 100 / Max(FObjectSizes,1) * FObjectSizesDoneExact; - lblCheckedSize.Caption := 'Selected objects size: '+FormatByteNumber(FObjectSizes)+'. '+ - FormatNumber(Percent, 1) + '% done.'; + lblCheckedSize.Caption := f_('Selected objects size: %s. %s%% done.', [FormatByteNumber(FObjectSizes), FormatNumber(Percent, 1)]); MainForm.SetProgressPosition(Round(Percent)); Application.ProcessMessages; end; @@ -983,7 +982,7 @@ begin try FTargetConnection.Active := True; comboExportOutputTarget.Items := FTargetConnection.AllDatabases; - comboExportOutputTarget.Items.Insert(0, '[Same as on source server]'); + comboExportOutputTarget.Items.Insert(0, '['+_('Same as on source server')+']'); comboExportOutputTarget.ItemIndex := comboExportOutputTarget.Items.IndexOf(AppSettings.ReadString(asExportSQLServerDatabase)); if comboExportOutputTarget.ItemIndex = -1 then comboExportOutputTarget.ItemIndex := 0; @@ -1043,7 +1042,7 @@ begin // Set cancel flag to stop running loop in the next possible loop position if TButton(Sender).ModalResult = mrNone then begin FCancelled := True; - Mainform.LogSQL('Processing cancelled by user, waiting for current object to finish ...', lcInfo); + Mainform.LogSQL(_('Processing cancelled by user, waiting for current object to finish ...'), lcInfo); end; end; @@ -1058,7 +1057,7 @@ begin // Select filename SaveDialog := TSaveDialog.Create(Self); SaveDialog.DefaultExt := 'sql'; - SaveDialog.Filter := 'SQL-Scripts (*.sql)|*.sql|All Files (*.*)|*.*'; + SaveDialog.Filter := _('SQL files')+' (*.sql)|*.sql|'+_('All files')+' (*.*)|*.*'; SaveDialog.Options := SaveDialog.Options + [ofOverwritePrompt]; if SaveDialog.Execute then comboExportOutputTarget.Text := SaveDialog.FileName; @@ -1067,7 +1066,7 @@ begin 1: begin Browse := TBrowseForFolder.Create(Self); Browse.Folder := comboExportOutputTarget.Text; - Browse.DialogCaption := 'Select output directory'; + Browse.DialogCaption := _('Select output directory'); // Enable "Create new folder" button Browse.BrowseOptions := Browse.BrowseOptions - [bifNoNewFolderButton] + [bifNewDialogStyle]; if Browse.Execute then @@ -1194,11 +1193,11 @@ begin end; if not FHeaderCreated then begin Header := '-- --------------------------------------------------------' + CRLF + - Format('-- %-30s%s', ['Host:', DBObj.Connection.Parameters.HostName]) + CRLF + - Format('-- %-30s%s', ['Server version:', DBObj.Connection.ServerVersionUntouched]) + CRLF + - Format('-- %-30s%s', ['Server OS:', DBObj.Connection.ServerOS]) + CRLF + - Format('-- %-30s%s', [APPNAME + ' version:', Mainform.AppVersion]) + CRLF + - Format('-- %-30s%s', ['Date/time:', DateTimeToStr(Now)]) + CRLF + + Format('-- %-30s:%s', [_('Host'), DBObj.Connection.Parameters.HostName]) + CRLF + + Format('-- %-30s:%s', [_('Server version'), DBObj.Connection.ServerVersionUntouched]) + CRLF + + Format('-- %-30s:%s', [_('Server OS'), DBObj.Connection.ServerOS]) + CRLF + + Format('-- %-30s:%s', [APPNAME + ' ' + _('Version'), Mainform.AppVersion]) + CRLF + + Format('-- %-30s:%s', [_('Created'), DateTimeToStr(Now)]) + CRLF + '-- --------------------------------------------------------' + CRLF + CRLF + '/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;' + CRLF + '/*!40101 SET NAMES '+DBObj.Connection.CharacterSet+' */;' + CRLF + @@ -1216,7 +1215,7 @@ begin FinalDbName := comboExportOutputTarget.Text; NeedsDBStructure := FinalDbName <> ExportLastDatabase; if chkExportDatabasesDrop.Checked or chkExportDatabasesCreate.Checked then begin - Output(CRLF+CRLF+'-- Dumping database structure for '+DBObj.Database+CRLF, False, NeedsDBStructure, False, False, False); + Output(CRLF+CRLF+'-- '+f_('Dumping database structure for %s', [DBObj.Database])+CRLF, False, NeedsDBStructure, False, False, False); if chkExportDatabasesDrop.Checked and chkExportDatabasesDrop.Enabled then Output('DROP DATABASE IF EXISTS '+Quoter.QuoteIdent(FinalDbName), True, NeedsDBStructure, False, False, NeedsDBStructure); if chkExportDatabasesCreate.Checked and chkExportDatabasesCreate.Enabled then begin @@ -1239,7 +1238,7 @@ begin // Table structure if chkExportTablesDrop.Checked or chkExportTablesCreate.Checked then begin - Output(CRLF+CRLF+'-- Dumping structure for '+LowerCase(DBObj.ObjType)+' '+DBObj.Database+'.'+DBObj.Name+CRLF, False, True, True, False, False); + Output(CRLF+CRLF+'-- '+f_('Dumping structure for %s %s.%s', [LowerCase(DBObj.ObjType), DBObj.Database, DBObj.Name])+CRLF, False, True, True, False, False); if chkExportTablesDrop.Checked then begin Struc := 'DROP '+UpperCase(DBObj.ObjType)+' IF EXISTS '; if ToDb then @@ -1280,7 +1279,7 @@ begin // Create temporary VIEW replacement ColumnList := TTableColumnList.Create(True); DBObj.Connection.ParseViewStructure(DBObj.CreateCode, DBObj.Name, ColumnList, Dummy, Dummy, Dummy, Dummy, Dummy); - Struc := '-- Creating temporary table to overcome VIEW dependency errors'+CRLF+ + Struc := '-- '+_('Creating temporary table to overcome VIEW dependency errors')+CRLF+ 'CREATE TABLE '; if ToDb then Struc := Struc + Quoter.QuoteIdent(FinalDbName) + '.'; @@ -1295,7 +1294,7 @@ begin Struc := Struc + CRLF + ') ENGINE=MyISAM'; ColumnList.Free; end else begin - Struc := '-- Removing temporary table and create final VIEW structure'+CRLF+ + Struc := '-- '+_('Removing temporary table and create final VIEW structure')+CRLF+ 'DROP TABLE IF EXISTS '; if ToDb then Struc := Struc + Quoter.QuoteIdent(FinalDbName)+'.'; @@ -1358,14 +1357,14 @@ begin if DBObj.NodeType = lntTable then begin // Table data if comboExportData.Text = DATA_NO then begin - Output(CRLF+'-- Data exporting was unselected.'+CRLF, False, True, True, False, False); + Output(CRLF+'-- '+_('Data exporting was unselected.')+CRLF, False, True, True, False, False); end else if DBObj.Engine = 'MRG_MYISAM' then begin - Output(CRLF+'-- Table data not exported because this is '+DBObj.Engine+' table which holds its data in separate tables.'+CRLF, False, True, True, False, False); + Output(CRLF+'-- '+f_('Table data not exported because this is %s table which holds its data in separate tables.', [DBObj.Engine])+CRLF, False, True, True, False, False); end else begin tmp := FormatNumber(DBObj.Rows)+' rows'; if LowerCase(DBObj.Engine) = 'innodb' then - tmp := '~'+tmp+' (approximately)'; - Output(CRLF+'-- Dumping data for table '+DBObj.Database+'.'+DBObj.Name+': '+tmp+CRLF, False, True, True, False, False); + tmp := '~'+tmp+' ('+_('approximately')+')'; + Output(CRLF+'-- '+f_('Dumping data for table %s.%s: %s', [DBObj.Database, DBObj.Name, tmp])+CRLF, False, True, True, False, False); TargetDbAndObject := Quoter.QuoteIdent(DBObj.Name); if ToDb then TargetDbAndObject := Quoter.QuoteIdent(FinalDbName) + '.' + TargetDbAndObject; @@ -1536,11 +1535,11 @@ begin LogRow := FResults.Last; if Specs.Count > 0 then begin DBObj.Connection.Query('ALTER TABLE ' + DBObj.QuotedDatabase + '.' + DBObj.QuotedName + ' ' + ImplodeStr(', ', Specs)); - LogRow[2] := 'Done'; - LogRow[3] := 'Success'; + LogRow[2] := _('Done'); + LogRow[3] := _('Success'); end else begin - LogRow[2] := 'Nothing to do'; - LogRow[3] := 'Selected operations cannot be applied to a '+LowerCase(DBObj.ObjType); + LogRow[2] := _('Nothing to do'); + LogRow[3] := f_('Selected operations cannot be applied to a %s', [LowerCase(DBObj.ObjType)]); end; UpdateResultGrid; end; @@ -1560,7 +1559,7 @@ begin case TreeObjects.GetNodeLevel(TreeObjects.FocusedNode) of 1: DBNode := TreeObjects.FocusedNode; 2: DBNode := TreeObjects.FocusedNode.Parent; - else raise Exception.Create('Unhandled tree level'); + else raise Exception.Create(_('Unhandled tree level')); end; ObjNode := TreeObjects.GetFirstChild(DBNode); CheckedNodes := 0; diff --git a/source/texteditor.pas b/source/texteditor.pas index 8130d66e..e84a6139 100644 --- a/source/texteditor.pas +++ b/source/texteditor.pas @@ -130,11 +130,11 @@ begin lbsMixed: Detected := menuMixedLB; else Detected := nil; end; - menuWindowsLB.Caption := 'Windows® linebreaks'; - menuUnixLB.Caption := 'UNIX linebreaks'; - menuMacLB.Caption := 'Mac OS linebreaks'; - menuWideLB.Caption := 'Unicode linebreaks'; - menuMixedLB.Caption := 'Mixed linebreaks'; + menuWindowsLB.Caption := _('Windows linebreaks'); + menuUnixLB.Caption := _('UNIX linebreaks'); + menuMacLB.Caption := _('Mac OS linebreaks'); + menuWideLB.Caption := _('Unicode linebreaks'); + menuMixedLB.Caption := _('Mixed linebreaks'); Detected.Caption := Detected.Caption + ' (detected)'; Selected.Default := True; btnLineBreaks.Hint := Selected.Caption; @@ -223,7 +223,7 @@ var d: TOpenTextFileDialog; begin d := TOpenTextFileDialog.Create(Self); - d.Filter := 'Textfiles (*.txt)|*.txt|All files (*.*)|*.*'; + d.Filter := _('Text files')+' (*.txt)|*.txt|'+_('All files')+' (*.*)|*.*'; d.FilterIndex := 0; d.Encodings.Assign(MainForm.FileEncodings); d.EncodingIndex := 0; @@ -256,7 +256,7 @@ begin Exit; FStopping := True; if Modified then - DoPost := MessageDialog('Apply modifications?', mtConfirmation, [mbYes, mbNo]) = mrYes + DoPost := MessageDialog(_('Apply modifications?'), mtConfirmation, [mbYes, mbNo]) = mrYes else DoPost := False; if DoPost then diff --git a/source/trigger_editor.pas b/source/trigger_editor.pas index 4f288b3c..d43a66c6 100644 --- a/source/trigger_editor.pas +++ b/source/trigger_editor.pas @@ -86,8 +86,8 @@ begin inherited; editName.Text := ''; comboDefiner.Text := ''; - comboDefiner.TextHint := 'Current user ('+Obj.Connection.CurrentUserHostCombination+')'; - comboDefiner.Hint := 'Leave empty for current user ('+Obj.Connection.CurrentUserHostCombination+')'; + comboDefiner.TextHint := f_('Current user (%s)', [Obj.Connection.CurrentUserHostCombination]); + comboDefiner.Hint := f_('Leave empty for current user (%s)', [Obj.Connection.CurrentUserHostCombination]); SynMemoBody.Text := 'BEGIN'+CRLF+CRLF+'END'; comboEvent.ItemIndex := 0; comboTiming.ItemIndex := 0; @@ -119,7 +119,7 @@ begin end; FreeAndNil(Definitions); if not Found then - Raise Exception.Create('Trigger definition not found!'); + Raise Exception.Create(_('Trigger definition not found!')); end else begin editName.Text := ''; end; diff --git a/source/updatecheck.pas b/source/updatecheck.pas index f62eb6e7..292e576e 100644 --- a/source/updatecheck.pas +++ b/source/updatecheck.pas @@ -73,8 +73,8 @@ end; } procedure TfrmUpdateCheck.FormShow(Sender: TObject); begin - Status('Initiating ... '); - Caption := 'Check for '+APPNAME+' updates ...'; + Status(_('Initializing')+' ...'); + Caption := f_('Check for %s updates', [APPNAME]) + ' ...'; // Init GUI controls btnRelease.Enabled := False; @@ -90,18 +90,18 @@ begin // Download the check file Screen.Cursor := crHourglass; try - Status('Downloading check file ...'); + Status(_('Downloading check file')+' ...'); CheckfileDownload.SendRequest(FCheckFilename); - Status('Reading check file ...'); + Status(_('Reading check file')+' ...'); ReadCheckFile; // Developer versions probably have "unknown" (0) as revision, // which makes it impossible to compare the revisions. if Mainform.AppVerRevision = 0 then - Status('Error: Cannot determine current revision. Using a developer version?') + Status(_('Error: Cannot determine current revision. Using a developer version?')) else if Mainform.AppVerRevision = BuildRevision then - Status('Your '+APPNAME+' is up-to-date (no update available).') + Status(f_('Your %s is up-to-date (no update available).', [APPNAME])) else if groupRelease.Enabled or btnBuild.Enabled then - Status('Updates available.'); + Status(_('Updates available.')); // Remember when we did the updatecheck to enable the automatic interval AppSettings.WriteString(asUpdatecheckLastrun, DateTimeToStr(Now)); except @@ -144,12 +144,12 @@ begin ReleaseVersion := Ini.ReadString(INISECT_RELEASE, 'Version', 'unknown'); ReleaseRevision := Ini.ReadInteger(INISECT_RELEASE, 'Revision', 0); ReleaseURL := Ini.ReadString(INISECT_RELEASE, 'URL', ''); - memoRelease.Lines.Add( 'Version ' + ReleaseVersion + ' (yours: '+Mainform.AppVersion+')' ); - memoRelease.Lines.Add( 'Released: ' + Ini.ReadString(INISECT_RELEASE, 'Date', '') ); + memoRelease.Lines.Add(f_('Version %s (yours: %s)', [ReleaseVersion, Mainform.AppVersion])); + memoRelease.Lines.Add(f_('Released: %s', [Ini.ReadString(INISECT_RELEASE, 'Date', '')])); Note := Ini.ReadString(INISECT_RELEASE, 'Note', ''); if Note <> '' then - memoRelease.Lines.Add( 'Note: ' + Note ); - btnRelease.Caption := 'Download version ' + ReleaseVersion; + memoRelease.Lines.Add(_('Notes') + ': ' + Note); + btnRelease.Caption := f_('Download version %s', [ReleaseVersion]); // Enable the download button if the current version is outdated groupRelease.Enabled := ReleaseRevision > Mainform.AppVerRevision; btnRelease.Enabled := groupRelease.Enabled; @@ -165,13 +165,13 @@ begin BuildRevision := Ini.ReadInteger(INISECT_BUILD, 'Revision', 0); BuildURL := Ini.ReadString(INISECT_BUILD, 'URL', ''); BuildSize := Ini.ReadInteger(INISECT_BUILD, 'Size', 0); - memoBuild.Lines.Add( 'Revision ' + IntToStr(BuildRevision) + ' (yours: '+IntToStr(Mainform.AppVerRevision)+')' ); + memoBuild.Lines.Add(f_('Revision %d (yours: %d)', [BuildRevision, Mainform.AppVerRevision])); FileAge(ParamStr(0), Compiled); - memoBuild.Lines.Add( 'Compiled: ' + Ini.ReadString(INISECT_BUILD, 'Date', '') + ' (yours: '+DateToStr(Compiled)+')' ); + memoBuild.Lines.Add(f_('Compiled: %s (yours: %s)', [Ini.ReadString(INISECT_BUILD, 'Date', ''), DateToStr(Compiled)])); Note := Ini.ReadString(INISECT_BUILD, 'Note', ''); if Note <> '' then - memoBuild.Lines.Add( 'Notes: * ' + StringReplace(Note, '%||%', CRLF+'* ', [rfReplaceAll] ) ); - btnBuild.Caption := 'Download and install build ' + IntToStr(BuildRevision); + memoBuild.Lines.Add(_('Notes') + ': * ' + StringReplace(Note, '%||%', CRLF+'* ', [rfReplaceAll] ) ); + btnBuild.Caption := f_('Download and install build %d', [BuildRevision]); // A new release should have priority over a new nightly build. // So the user should not be able to download a newer build here // before having installed the new release. @@ -219,9 +219,9 @@ begin // Check if downloaded file exists if not FileExists(DownloadFilename) then - Raise Exception.Create('Downloaded file not found: '+DownloadFilename); + Raise Exception.CreateFmt(_('Downloaded file not found: %s'), [DownloadFilename]); - Status('Update in progress ...'); + Status(_('Update in progress')+' ...'); ResInfoblockHandle := FindResource(HInstance, 'UPDATER', 'EXE'); ResHandle := LoadResource(HInstance, ResInfoblockHandle); if ResHandle <> 0 then begin @@ -261,7 +261,7 @@ begin if FLastStatusUpdate > GetTickCount-200 then Exit; Download := Sender as THttpDownload; - Status('Downloading: '+FormatByteNumber(Download.BytesRead)+' / '+FormatByteNumber(Download.ContentLength) + ' ...'); + Status(f_('Downloading: %s / %s', [FormatByteNumber(Download.BytesRead), FormatByteNumber(Download.ContentLength)]) + ' ...'); FLastStatusUpdate := GetTickCount; end; diff --git a/source/usermanager.pas b/source/usermanager.pas index 11beafde..06f3a9c7 100644 --- a/source/usermanager.pas +++ b/source/usermanager.pas @@ -432,7 +432,7 @@ begin // the old one, otherwise OnFocusChanged will be triggered. Allowed := (NewNode <> OldNode) and (not Assigned(NewNode) or (not (vsDisabled in NewNode.States))); if Allowed and FModified then begin - case MessageDialog('Save modified user?', mtConfirmation, [mbYes, mbNo, mbCancel]) of + case MessageDialog(_('Save modified user?'), mtConfirmation, [mbYes, mbNo, mbCancel]) of mrYes: begin btnSave.Click; Allowed := not FModified; @@ -508,7 +508,7 @@ begin Msg := E.Message; if FConnection.LastErrorCode = 1141 then begin // Disable this user node lately, for old server which do not show skip-name-resolve variable - Msg := Msg + CRLF + CRLF + 'Starting the server without --skip-name-resolve may solve this issue.'; + Msg := Msg + CRLF + CRLF + f_('Starting the server without %s may solve this issue.', ['--skip-name-resolve']); User.Problem := upUnknown; Node.States := Node.States + [vsDisabled]; end; @@ -808,13 +808,13 @@ begin Msg := ''; case User.Problem of upEmptyPassword: - Msg := 'This user has an empty password.'; + Msg := _('This user has an empty password.'); upInvalidPasswordLen: - Msg := 'This user is inactive due to an invalid length of its encrypted password. Please fix that in the mysql.user table.'; + Msg := f_('This user is inactive due to an invalid length of its encrypted password. Please fix that in the %s table.', ['mysql.user']); upSkipNameResolve: - Msg := 'This user is inactive due to having a host name, while the server runs with --skip-name-resolve.'; + Msg := f_('This user is inactive due to having a host name, while the server runs with %s.', ['--skip-name-resolve']); upUnknown: - Msg := 'This user is inactive due to some unknown reason.'; + Msg := _('This user is inactive due to some unknown reason.'); end; end; lblWarning.Caption := Msg; @@ -923,9 +923,9 @@ begin 0: begin case p.DBObj.NodeType of lntNone: - CellText := 'Global privileges'; + CellText := _('Global privileges'); lntDb: - CellText := 'Database: '+p.DBObj.Database; + CellText := _('Database')+': '+p.DBObj.Database; lntTable, lntProcedure, lntFunction: CellText := p.DBObj.ObjType+': '+p.DBObj.Database+'.'+p.DBObj.Name; lntColumn: @@ -1045,13 +1045,13 @@ begin Exit; // Check for unsupported object type, selectable in tree if not (DBObj.NodeType in [lntDb, lntTable, lntFunction, lntProcedure, lntColumn]) then begin - ErrorDialog('Objects of type '+DBObj.ObjType+' cannot be part of privileges.'); + ErrorDialog(f_('Objects of type %s cannot be part of privileges.', [DBObj.ObjType])); Exit; end; // Check if this would be a duplicate object for Priv in FPrivObjects do begin if Priv.DBObj.IsSameAs(DBObj) then begin - ErrorDialog('Selected object is already accessible.'); + ErrorDialog(_('Selected object is already accessible.')); Exit; end; end; @@ -1122,12 +1122,12 @@ begin if User = FocusedUser^ then Continue; if (User.Username = editUsername.Text) and (User.Host = editFromHost.Text) then - raise EInputError.Create('User <'+editUsername.Text+'@'+editFromHost.Text+'> already exists.'); + raise EInputError.CreateFmt('User <%s@%s> already exists.', [editUsername.Text, editFromHost.Text]); end; // Check input: Ensure we have a unique user@host combination if editPassword.Text <> editRepeatPassword.Text then - raise EInputError.Create('Repeated password does not match first one.'); + raise EInputError.Create(_('Repeated password does not match first one.')); // Create added user PasswordSet := False; @@ -1152,7 +1152,7 @@ begin lntColumn: OnObj := GetObjectType('TABLE') + P.DBObj.QuotedDatabase + '.' + P.DBObj.QuotedName; else - raise Exception.Create('Unhandled privilege object: '+P.DBObj.ObjType); + raise Exception.CreateFmt(_('Unhandled privilege object: %s'), [P.DBObj.ObjType]); end; // Revoke privileges @@ -1294,7 +1294,7 @@ begin FUsers.Remove(User^); listUsers.DeleteNode(listUsers.FocusedNode); FAdded := False; - end else if MessageDialog('Delete user '+User.Username+'@'+User.Host+'?', mtConfirmation, [mbYes, mbCancel]) = mrYes then begin + end else if MessageDialog(f_('Delete user %s@%s?', [User.Username, User.Host]), mtConfirmation, [mbYes, mbCancel]) = mrYes then begin UserHost := esc(User.Username)+'@'+esc(User.Host); try // Revoke privs explicitly, required on old servers. diff --git a/source/view.pas b/source/view.pas index 07a214b7..9c1231e7 100644 --- a/source/view.pas +++ b/source/view.pas @@ -67,8 +67,8 @@ begin inherited; lblDisabledWhy.Font.Color := clRed; comboDefiner.Text := ''; - comboDefiner.TextHint := 'Current user ('+Obj.Connection.CurrentUserHostCombination+')'; - comboDefiner.Hint := 'Leave empty for current user ('+Obj.Connection.CurrentUserHostCombination+')'; + comboDefiner.TextHint := f_('Current user (%s)', [Obj.Connection.CurrentUserHostCombination]); + comboDefiner.Hint := f_('Leave empty for current user (%s)', [Obj.Connection.CurrentUserHostCombination]); if Obj.Name <> '' then begin // Edit mode editName.Text := Obj.Name;