Topic: How to translate interface and messages

How to translate interface and messages




begin

    // how to translate interface
    Form1.mniFile.Caption := 'File';
    Form1.mniClose.Caption := 'Close';
    Form1.mniOptions.Caption := 'Options';
    Form1.mniSettings.Caption := 'Settings';
    Form1.mniReport.Caption := 'Report designer';
    Form1.mniExportData.Caption := 'Export data';
    Form1.mniImportData.Caption := 'Import data';
    Form1.mniAbout.Caption := 'About';

    frmOptionsdbCore.Caption := 'Options';
    frmOptionsdbCore.TabDatabaseLoc.Caption := 'Database location';
    frmOptionsdbCore.rbAppFolder.Caption := 'Save the database file in the folder with the application.';
    frmOptionsdbCore.rbDBFilename.Caption := 'Specify the filename of the database.';
    frmOptionsdbCore.lbPath.Caption := 'You can also use a network folder (e.d. \\PCNAME\Folder\sqlite.db)';
    frmOptionsdbCore.bCancel.Caption := 'Cancel';
    frmOptionsdbCore.TabSettings.Caption := 'Settings';
    frmOptionsdbCore.GroupBoxSettings.Caption := 'Configuration file (settings.ini)';
    frmOptionsdbCore.rbSettingsIniApp.Caption := 'Save the configuration file in the folder with application.';
    frmOptionsdbCore.rbSettingsIniAppData.Caption := 'Save the configuration file in the folder:'+#13+'%appdata%\My Visual Database Configurations\%projectname%';

    frmdbCoreImport.Caption := 'Import';
    frmdbCoreImport.gbFileAndSettings.Caption := '1. File and settings';
    frmdbCoreImport.lbFile.Caption := 'CSV file name';
    frmdbCoreImport.lbColumnsSeparator.Caption := 'Columns separator';
    frmdbCoreImport.cbSeparator.Items[0] := ', (comma)';
    frmdbCoreImport.cbSeparator.Items[1] := '; (semicolon) ';
    frmdbCoreImport.cbSeparator.Items[2] := '\t (tab)';
    frmdbCoreImport.cbSeparator.Items[3] := 'Custom';
    frmdbCoreImport.cbSeparator.ItemIndex := 0;
    frmdbCoreImport.lbEncoding.Caption := 'Encoding';
    frmdbCoreImport.chbColumnNamesRow.Caption := 'Column name as first row';
    frmdbCoreImport.lbDateFormat.Caption := 'Date format';
    frmdbCoreImport.cbDateFormat.Items[0] := 'SQL format';
    frmdbCoreImport.cbDateFormat.Items[1] := 'Regional format ';
    frmdbCoreImport.lbTimeFormat.Caption := 'Time format';
    frmdbCoreImport.cbTimeFormat.Items[0] := 'SQL format';
    frmdbCoreImport.cbTimeFormat.Items[1] := 'Regional format ';
    frmdbCoreImport.gbData.Caption := '2. Data';
    frmdbCoreImport.lbImportTable.Caption := 'The table for import';
    frmdbCoreImport.lbFieldsAndColumns.Caption := 'Specify field name for every column';
    frmdbCoreImport.lbSqliteWarning.Caption := 'Backup your database before importing.'+#13+'The database may be damaged if you turn off the computer during import.';
    frmdbCoreImport.bImport.Caption := 'Import';


    frmdbCoreExport.Caption := 'Export';
    TdbStringGridEx(frmdbCoreExport.gridTables).Columns[0].Header.Caption := 'Tables';
    TdbStringGridEx(frmdbCoreExport.gridFields).Columns[1].Header.Caption := 'Fields';
    frmdbCoreExport.lbSettings.Caption := 'Settings';
    frmdbCoreExport.chbColumnNamesRow.Caption := 'Column name as first row';
    frmdbCoreExport.lbColumnsSeparator.Caption := 'Columns separator';
    frmdbCoreExport.cbSeparator.Items[0] := ', (comma)';
    frmdbCoreExport.cbSeparator.Items[1] := '; (semicolon) ';
    frmdbCoreExport.cbSeparator.Items[2] := '\t (tab)';
    frmdbCoreExport.cbSeparator.Items[3] := 'Custom';
    frmdbCoreExport.cbSeparator.ItemIndex := 0;
    frmdbCoreExport.lbEndOfLine.Caption := 'End of line';
    frmdbCoreExport.chbEnclosing.Caption := 'Double quotes enclose';
    frmdbCoreExport.lbSQLFilter.Caption := 'SQL filter (WHERE conditions)';
    frmdbCoreExport.bExport.Caption := 'Export to CSV';
    frmdbCoreImportProgress.Caption := 'Importing...';
    frmdbCoreImportProgress.bMore.Caption := 'More details';
    frmdbCoreImportProgress.bCancel.Caption := 'Cancel';


    // how to translate messages and captions
    Translate('Open_report_designer', 'Open report designer');
    Translate('Your_computer_does_not_have_Excel', 'Your computer does not have Excel');
    Translate('Your_computer_does_not_have_LibreOffice', 'Your computer does not have LibreOffice');
    Translate('Your_computer_does_not_have_Excel_or_LibreOffice', 'Your computer does not have Excel or LibreOffice');
    Translate('Entry_to_edit_is_no_selected', 'Entry to edit is no selected');
    Translate('Unable to determine the record ID', 'Unable_to_determine_the_record_ID');
    Translate('Please_select_record_in_grid', 'Please select record in grid');
    Translate('Report_file_not_found', 'Report file not found');
    Translate('Entry_to_be_deleted_is_not_selected', 'Entry to be deleted is not selected');
    Translate('Are_you_sure_you_want_to_delete_the_record', 'Are you sure you want to delete the record');
    Translate('The_database_file_is_not_found', 'The database file is not found');
    Translate('Not_a_number: string', 'Not a number');
    Translate('Are_you_sure_you_want_to_delete_the_image_from_the_database', 'Are you sure you want to delete the image from the database');
    Translate('There_is_no_file_to_save', 'There is no file to save');
    Translate('Do_you_really_want_to_delete_the_file_from_the_database', 'Do you really want to delete the file from the database');
    Translate('Restart_the_program_to_apply_the_settings', 'Restart the program to apply the settings');
    Translate('This_Field_is_required', 'This Field is required');
    Translate('Not_permitted_to_use_ComboBox_for_saving_record', 'Not permitted to use ComboBox for saving record');
    Translate('Saving_or_opening_file_from_database', 'Saving or opening file from database');
    Translate('Select_file_stored_in_database', 'Select file stored in database');
    Translate('Export_image_from_database', 'Export image from database');
    Translate('Open_image_to_save_the_database', 'Open image to save the database');
    Translate('Delete_Image', 'Delete Image');
    Translate('Calculated_field', 'Calculated field');
    Translate('Counter_field', 'Counter field');
    Translate('Open_file', 'Open file');
    Translate('Save_file', 'Save file');
    Translate('Delete_file', 'Delete file');
    Translate('Open_folder_with_file', 'Open folder with file');
    Translate('Clear', 'Clear');
    Translate('Open', 'Open');
    Translate('Component', 'Component');
    Translate('No_data_to_add', 'No data to add');
    Translate('File_not_found', 'File not found');
    Translate('Confirm', 'Confirm');
    Translate('Error', 'Error');
    Translate('Info', 'Info');
    Translate('Set_marker', 'Set marker');
    Translate('Set_marker_at_address', 'Set marker at address');
    Translate('Delete_marker', 'Delete marker');
    Translate('Address', 'Address');
    Translate('Export', 'Export');
    Translate('Import', 'Import');
    Translate('Records_exported', 'Records exported');
    Translate('Records_imported', 'Records imported');
    Translate('Export_is_not_configured_correctly', 'Export is not configured correctly.');
    Translate('Import_is_not_configured_correctly', 'Import is not configured correctly.');
    Translate('Yes', 'Ja');
    Translate('No', 'Nein');
    Translate('None', 'None');
    Translate('Skip', 'Skip');
    Translate('Close', 'Close');
    Translate('Cancel', 'Cancel');
end.

Project example:
http://myvisualdatabase.com/forum/misc. … download=1

Dmitry.

Re: How to translate interface and messages

It was possible to translate all the strings of the "Export screen", except for the last button indicated in the image. Could anyone tell me how can I translate the string for this button?

Thanks

https://i.ibb.co/9VShmF1/Export-Screen.jpg

Re: How to translate interface and messages

Hello eduardo

Did you try :

Translate ('Export_the_whole_database_to_CSV','Exportar toda la base de datos a CSV');
Don't forget underscore between each english word

JB

Re: How to translate interface and messages

Hi Jean,

Yes, tried this and other similar combinations without success.

Thanks for helping!

Re: How to translate interface and messages

Eduardo Volpi wrote:

Hi Jean,

Yes, tried this and other similar combinations without success.

Thanks for helping!

frmdbCoreExport.bExportAllToCSV.Caption:='';

Re: How to translate interface and messages

frmdbCoreExport.bExportAllToCSV.Caption:='';

That worked great... Thank you very much for helping!

Re: How to translate interface and messages

Hi all, is there a more in depth list? Because for example "No Record Selected For Editing" or "No Record Selected to Delete" are not there.
I tried for example with "No_Record_Selected_For_Editing" but it doesn't work.
Thank you all.

Re: How to translate interface and messages

Ciao Fabio, per la traduzione dei messaggi di sistema utilizzo lo script riportato all'inizio del post, inserito tra il begin e l'end al termine del listato del mio codice.
Spero possa aiutarti.

Hi Fabio, for the translation of system messages I use the script shown at the beginning of the post, inserted between the begin and the end at the end of my code listing.
I hope it can help you.


// TRADUCO INTERFACCIA
    Form1.mniFile.Caption := 'File';
    Form1.mniClose.Caption := 'Chiudi';
    Form1.mniOptions.Caption := 'Opzioni';
    Form1.mniSettings.Caption := 'Database';
    Form1.mniReport.Caption := 'Report designer';
    Form1.mniExportData.Caption := 'Esportazione dati';
    Form1.mniImportData.Caption := 'Importazione dati';
    Form1.mniAbout.Caption := 'Informazioni';

    Form1.mniUsers.Caption := 'Utenti';

    frmdbCoreLogin.Caption := 'Accesso';
    frmdbCoreLogin.edLogin.TextHint := 'Nome Utente';
    frmdbCoreLogin.edPassword.TextHint := 'Password';
    frmdbCoreLogin.bLogin.Caption := 'ACCEDI';

    frmdbCoreUsers.Caption := 'Utenti';
    frmdbCoreUsers.bNewUser.Caption := 'Nuovo';
    frmdbCoreUsers.bEdit.Caption := 'Modifica';
    TdbStringGridEx(frmdbCoreUsers.FindComponent('gridUsers')).dbListFieldsNames := 'Nome Utente,Ruolo,Admin,Attivo,Cognome,Nome,Ultimo login,Data Creazione';
    TdbButton(frmdbCoreUsers.FindComponent('bDelete')).Caption := 'Elimina';

    frmdbCoreUserForm.Caption := 'Utenti';

    frmdbCoreUserForm.lbUsername.Caption := 'Nome Utente';
    frmdbCoreUserForm.lbPassword.Caption := 'Password';
    frmdbCoreUserForm.lbConfirmPassword.Caption := 'Conferma Password';
    frmdbCoreUserForm.bChangePassword.Caption := 'Cambia Password';
    frmdbCoreUserForm.lbRole.Caption := 'Ruolo';
    frmdbCoreUserForm.lbLastname.Caption := 'Cognome';
    frmdbCoreUserForm.lbFirstname.Caption := 'Nome';
    frmdbCoreUserForm.lbEmail.Caption := 'Email';
    frmdbCoreUserForm.lbAdmin.Caption := 'Amministratore';
    frmdbCoreUserForm.lbActive.Caption := 'Attivo';
    frmdbCoreUserForm.bOK.Caption := 'OK';
    frmdbCoreUserForm.bCancel.Caption := 'Annulla';


    frmOptionsdbCore.Caption := 'Opzioni';
    frmOptionsdbCore.TabDatabaseLoc.Caption := 'Percorso Database';
    frmOptionsdbCore.rbAppFolder.Caption := 'Salva il database nella stessa cartella dell''applicazione.';
    frmOptionsdbCore.rbDBFilename.Caption := 'Specifica il nome del database.';
    frmOptionsdbCore.lbPath.Caption := 'Puoi usare una cartella di rete (e.d. \\PCNAME\Folder\sqlite.db)';
    frmOptionsdbCore.bCancel.Caption := 'Annulla';
    frmOptionsdbCore.TabSettings.Caption := 'Impostazioni';
    frmOptionsdbCore.GroupBoxSettings.Caption := 'File di configurazione (settings.ini)';
    frmOptionsdbCore.rbSettingsIniApp.Caption := 'Salva il file di configurazione nella stessa cartella dell''applicazione.';
    frmOptionsdbCore.rbSettingsIniAppData.Caption := 'Salva il file di configurazione nella cartella:'+#13+'%appdata%\My Visual Database Configurations\%projectname%';

    frmdbCoreImport.Caption := 'Importazione dati da file esterno in formato CSV - CHIUDERE QUESTA FINESTRA AL TERMINE DELLA PROCEDURA';
    frmdbCoreImport.gbFileAndSettings.Caption := '1. File e impostazioni';
    frmdbCoreImport.lbFile.Caption := 'Nome del file CSV';
    frmdbCoreImport.lbColumnsSeparator.Caption := 'Separatore di colonna';
    frmdbCoreImport.cbSeparator.Items[0] := ', (virgola)';
    frmdbCoreImport.cbSeparator.Items[1] := '; (punto e virgola) ';
    frmdbCoreImport.cbSeparator.Items[2] := '\t (tab)';
    frmdbCoreImport.cbSeparator.Items[3] := 'Personalizzato';
    frmdbCoreImport.cbSeparator.ItemIndex := 1;
    frmdbCoreImport.lbEncoding.Caption := 'Codifica dei caratteri';
    frmdbCoreImport.chbColumnNamesRow.Caption := 'Intestazioni di colonna nella prima riga';
    frmdbCoreImport.lbDateFormat.Caption := 'Formato date';
    frmdbCoreImport.cbDateFormat.Items[0] := 'Formato SQL';
    frmdbCoreImport.cbDateFormat.Items[1] := 'Formato regionale ';
    frmdbCoreImport.lbTimeFormat.Caption := 'Formato orari';
    frmdbCoreImport.cbTimeFormat.Items[0] := 'Formato SQL';
    frmdbCoreImport.cbTimeFormat.Items[1] := 'Formato regionale ';
    frmdbCoreImport.gbData.Caption := '2. Dati';
    frmdbCoreImport.lbImportTable.Caption := 'Importa in questa tabella';
    frmdbCoreImport.lbFieldsAndColumns.Caption := 'Specifica il nome dei campi per ogni colonna';
    frmdbCoreImport.lbSqliteWarning.Caption := 'Esegui un backup dei tuoi dati prima dell''importazione.'+#13+'Il database può risultare illeggibile se spegni il computer durante l''importazione.';
    frmdbCoreImport.bImport.Caption := 'Importa';


    frmdbCoreExport.Caption := 'Esportazione dati in formato CSV';
    TdbStringGridEx(frmdbCoreExport.gridTables).Columns[0].Header.Caption := 'Tabelle';
    TdbStringGridEx(frmdbCoreExport.gridFields).Columns[1].Header.Caption := 'Campi';
    frmdbCoreExport.lbSettings.Caption := 'Impostazioni';
    frmdbCoreExport.chbColumnNamesRow.Caption := 'Intestazioni di colonna nella prima riga';
    frmdbCoreExport.lbColumnsSeparator.Caption := 'Separatore di colonna';
    frmdbCoreExport.cbSeparator.Items[0] := ', (virgola)';
    frmdbCoreExport.cbSeparator.Items[1] := '; (punto e virgola) ';
    frmdbCoreExport.cbSeparator.Items[2] := '\t (tab)';
    frmdbCoreExport.cbSeparator.Items[3] := 'Personalizzato';
    frmdbCoreExport.cbSeparator.ItemIndex := 1;
    frmdbCoreExport.lbEndOfLine.Caption := 'Fine linea';
    frmdbCoreExport.chbEnclosing.Caption := 'Racchiudi tra doppie virgolette';
    frmdbCoreExport.lbSQLFilter.Caption := 'Filtro SQL (condizioni WHERE )';
    frmdbCoreExport.bExport.Caption := 'Esporta in formato CSV';
    frmdbCoreImportProgress.Caption := 'Importazione in corso...';
    frmdbCoreImportProgress.bMore.Caption := 'Maggiori dettagli';
    frmdbCoreImportProgress.bCancel.Caption := 'Annulla';


    // how to translate messages and captions
    Translate('Open_report_designer', 'Open report designer');
    Translate('Your_computer_does_not_have_Excel', 'MS Excel non è installato sul computer');
    Translate('Your_computer_does_not_have_LibreOffice', 'LibreOffice non è installato sul computer');
    Translate('Your_computer_does_not_have_Excel_or_LibreOffice', 'Nel computer non è installato MS Excel o LibreOffice');
    Translate('Entry_to_edit_is_no_selected', 'Non è stato selezionato il record da modificare');
    Translate('Unable to determine the record ID', 'Non posso determinare l''ID del record');
    Translate('Please_select_record_in_grid', 'Selezionare il record nella tabella');
    Translate('Report_file_not_found', 'Il Report non è stato trovato');
    Translate('Entry_to_be_deleted_is_not_selected', 'Non è stato selezionato il record da eliminare');
    Translate('Are_you_sure_you_want_to_delete_the_record', 'Sei sicuro di voler eliminare questo record?');
    Translate('The_database_file_is_not_found', 'Il database non è stato trovato');
    Translate('Not_a_number: string', 'Non è un numero');
    Translate('Are_you_sure_you_want_to_delete_the_image_from_the_database', 'Sei sicuro di voler eliminare l''immagine dal database?');
    Translate('There_is_no_file_to_save', 'Non ci sono file da salvare');
    Translate('Do_you_really_want_to_delete_the_file_from_the_database', 'Sei veramente sicuro di voler eliminare il file dal database?');
    Translate('Restart_the_program_to_apply_the_settings', 'Riavvia il programma per rendere effettive le modifiche');
    Translate('This_Field_is_required', 'Questo campo è obbligatorio');
    Translate('Not_permitted_to_use_ComboBox_for_saving_record', 'Non è permesso usare una casella combinata per salvare il record');
    Translate('Saving_or_opening_file_from_database', 'Sto salvando o aprendo un file dal database');
    Translate('Select_file_stored_in_database', 'Seleziona il file memorizzato nel database');
    Translate('Export_image_from_database', 'Esporta l''immagine dal database');
    Translate('Open_image_to_save_the_database', 'Apri l''immagine da salvare nel database');
    Translate('Delete_Image', 'Elimina l''immagine');
    Translate('Calculated_field', 'Campo calcolato');
    Translate('Counter_field', 'Campo contatore');
    Translate('Open_file', 'Apri file');
    Translate('Save_file', 'Salva file');
    Translate('Delete_file', 'Elimina file');
    Translate('Open_folder_with_file', 'Apri la cartella con i file');
    Translate('Clear', 'Pulisci');
    Translate('Open', 'Apri');
    Translate('Component', 'Componente');
    Translate('No_data_to_add', 'Nessun dato da aggiungere');
    Translate('File_not_found', 'Il file non è stato trovato');
    Translate('Confirm', 'Conferma');
    Translate('Error', 'Errore');
    Translate('Info', 'Info');
    Translate('Set_marker', 'Set marker');
    Translate('Set_marker_at_address', 'Set marker at address');
    Translate('Delete_marker', 'Delete marker');
    Translate('Address', 'Address');
    Translate('Export', 'Esporta');
    Translate('Import', 'Importa');
    Translate('Records_exported', 'Record esportati');
    Translate('Records_imported', 'Record importati');
    Translate('Export_is_not_configured_correctly', 'L''esportazione non è configurata correttamente.');
    Translate('Import_is_not_configured_correctly', 'L''importazione non è configurata correttamente.');
    Translate('Yes', 'Si');
    Translate('No', 'No');
    Translate('None', 'Nessuno');
    Translate('Skip', 'Salta');       
    Translate('Close', 'Chiudi');
    Translate('Cancel', 'Annulla');

Re: How to translate interface and messages

I have the same problem with UI translation. But I have problems with message windows.
I used the below method but it didn't help.

begin
    Translate('Admin_user_not_found_A_user_with_administrator_privileges_will_be_created', 'Admin_user_not_found_A_user_with_administrator_privileges_will_be_created');
    Translate('Wrong_username_password', 'Wrong_username_password');
    Translate('Wrong_password', 'Wrong_password');
    Translate('Password_cannot_be_empty', 'Password_cannot_be_empty');
    Translate('The_password_and_confirmation_password_do_not_match', 'The_password_and_confirmation_password_do_not_match');
    Translate('Your_password_has_been_changed_successfully', 'Your_password_has_been_changed_successfully');
end.

PS I did not want to create a new topic, because it is related to the translation.

Post's attachments

Attachment icon Translate.JPG 33.19 kb, 69 downloads since 2023-10-10 

Re: How to translate interface and messages

Step-in wrote:

I have the same problem with UI translation. But I have problems with message windows.
I used the below method but it didn't help.

begin
    Translate('Admin_user_not_found_A_user_with_administrator_privileges_will_be_created', 'Admin_user_not_found_A_user_with_administrator_privileges_will_be_created');
    Translate('Wrong_username_password', 'Wrong_username_password');
    Translate('Wrong_password', 'Wrong_password');
    Translate('Password_cannot_be_empty', 'Password_cannot_be_empty');
    Translate('The_password_and_confirmation_password_do_not_match', 'The_password_and_confirmation_password_do_not_match');
    Translate('Your_password_has_been_changed_successfully', 'Your_password_has_been_changed_successfully');
end.

PS I did not want to create a new topic, because it is related to the translation.

The messages on the left are issued by an authentication form. Look for a solution on the forum: you need to replace the login button click handler. Are the messages on the right displayed on the password change form? I suppose the solution would be the same - replace the click handler.

Визуальное программирование: блог и телеграм-канал.

Re: How to translate interface and messages

https://myvisualdatabase.com/forum/view … hp?id=8156

Визуальное программирование: блог и телеграм-канал.