From eda10abc8c761acc4379d26d88e6a31ce3c80c5c Mon Sep 17 00:00:00 2001 From: Rubidium Date: Thu, 11 Apr 2024 13:25:40 +0200 Subject: [PATCH 01/15] Codechange: pass command line arguments as std::span to openttd_main --- src/openttd.cpp | 13 ++++++------- src/openttd.h | 2 +- src/os/macosx/osx_main.cpp | 2 +- src/os/unix/unix_main.cpp | 2 +- src/os/windows/win32_main.cpp | 26 ++++++++++++-------------- 5 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/openttd.cpp b/src/openttd.cpp index 55862f6ba3e..898ea248329 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -502,11 +502,10 @@ static std::vector CreateOptions() /** * Main entry point for this lovely game. - * @param argc The number of arguments passed to this game. - * @param argv The values of the arguments. + * @param arguments The command line arguments passed to the application. * @return 0 when there is no error. */ -int openttd_main(int argc, char *argv[]) +int openttd_main(std::span arguments) { _game_session_stats.start_time = std::chrono::steady_clock::now(); _game_session_stats.savegame_size = std::nullopt; @@ -530,7 +529,7 @@ int openttd_main(int argc, char *argv[]) _switch_mode = SM_MENU; auto options = CreateOptions(); - GetOptData mgo(std::span(argv + 1, argc - 1), options); + GetOptData mgo(arguments.subspan(1), options); int ret = 0; int i; @@ -614,7 +613,7 @@ int openttd_main(int argc, char *argv[]) } break; case 'q': { - DeterminePaths(argv[0], only_local_path); + DeterminePaths(arguments[0], only_local_path); if (StrEmpty(mgo.opt)) { ret = 1; return ret; @@ -660,7 +659,7 @@ int openttd_main(int argc, char *argv[]) * * The next two functions are needed to list the graphics sets. We can't do them earlier * because then we cannot show it on the debug console as that hasn't been configured yet. */ - DeterminePaths(argv[0], only_local_path); + DeterminePaths(arguments[0], only_local_path); TarScanner::DoScan(TarScanner::BASESET); BaseGraphics::FindSets(); BaseSounds::FindSets(); @@ -669,7 +668,7 @@ int openttd_main(int argc, char *argv[]) return ret; } - DeterminePaths(argv[0], only_local_path); + DeterminePaths(arguments[0], only_local_path); TarScanner::DoScan(TarScanner::BASESET); if (dedicated) Debug(net, 3, "Starting dedicated server, version {}", _openttd_revision); diff --git a/src/openttd.h b/src/openttd.h index 2fb27e92885..f6728ee70db 100644 --- a/src/openttd.h +++ b/src/openttd.h @@ -87,7 +87,7 @@ extern PauseMode _pause_mode; void AskExitGame(); void AskExitToGameMenu(); -int openttd_main(int argc, char *argv[]); +int openttd_main(std::span arguments); void StateGameLoop(); void HandleExitGameRequest(); diff --git a/src/os/macosx/osx_main.cpp b/src/os/macosx/osx_main.cpp index f33e3714367..7d8a7994e94 100644 --- a/src/os/macosx/osx_main.cpp +++ b/src/os/macosx/osx_main.cpp @@ -41,7 +41,7 @@ int CDECL main(int argc, char *argv[]) signal(SIGPIPE, SIG_IGN); - int ret = openttd_main(argc, argv); + int ret = openttd_main(std::span(argv, argc)); CocoaReleaseAutoreleasePool(); diff --git a/src/os/unix/unix_main.cpp b/src/os/unix/unix_main.cpp index 41ad22ced57..4a71b886b38 100644 --- a/src/os/unix/unix_main.cpp +++ b/src/os/unix/unix_main.cpp @@ -29,5 +29,5 @@ int CDECL main(int argc, char *argv[]) signal(SIGPIPE, SIG_IGN); - return openttd_main(argc, argv); + return openttd_main(std::span(argv, argc)); } diff --git a/src/os/windows/win32_main.cpp b/src/os/windows/win32_main.cpp index ebc22ffc715..9b5c815e3a6 100644 --- a/src/os/windows/win32_main.cpp +++ b/src/os/windows/win32_main.cpp @@ -18,11 +18,10 @@ #include "../../safeguards.h" -static int ParseCommandLine(char *line, char **argv, int max_argc) +static auto ParseCommandLine(char *line) { - int n = 0; - - do { + std::vector arguments; + for (;;) { /* skip whitespace */ while (*line == ' ' || *line == '\t') line++; @@ -31,22 +30,22 @@ static int ParseCommandLine(char *line, char **argv, int max_argc) /* special handling when quoted */ if (*line == '"') { - argv[n++] = ++line; + arguments.push_back(++line); while (*line != '"') { - if (*line == '\0') return n; + if (*line == '\0') return arguments; line++; } } else { - argv[n++] = line; + arguments.push_back(line); while (*line != ' ' && *line != '\t') { - if (*line == '\0') return n; + if (*line == '\0') return arguments; line++; } } *line++ = '\0'; - } while (n != max_argc); + }; - return n; + return arguments; } void CreateConsole(); @@ -73,13 +72,12 @@ int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR, int) /* setup random seed to something quite random */ SetRandomSeed(GetTickCount()); - char *argv[64]; // max 64 command line arguments - int argc = ParseCommandLine(cmdline.data(), argv, lengthof(argv)); + auto arguments = ParseCommandLine(cmdline.data()); /* Make sure our arguments contain only valid UTF-8 characters. */ - for (int i = 0; i < argc; i++) StrMakeValidInPlace(argv[i]); + for (auto argument : arguments) StrMakeValidInPlace(argument); - int ret = openttd_main(argc, argv); + int ret = openttd_main(arguments); /* Restore system timer resolution. */ timeEndPeriod(1); From 9915c1f0326b24fd04398c2f90d15ca0d5f45879 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Thu, 11 Apr 2024 21:35:40 +0100 Subject: [PATCH 02/15] Fix #12477: Use std::filesystem::rename instead of Windows Shell API call. (#12478) --- src/ini.cpp | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/src/ini.cpp b/src/ini.cpp index 5931d891ec3..95d7cb8d380 100644 --- a/src/ini.cpp +++ b/src/ini.cpp @@ -22,11 +22,7 @@ # include #endif -#ifdef _WIN32 -# include -# include -# include "core/mem_func.hpp" -#endif +#include #include "safeguards.h" @@ -91,30 +87,11 @@ bool IniFile::SaveToDisk(const std::string &filename) if (ret != 0) return false; #endif -#if defined(_WIN32) - /* Allocate space for one more \0 character. */ - wchar_t tfilename[MAX_PATH + 1], tfile_new[MAX_PATH + 1]; - wcsncpy(tfilename, OTTD2FS(filename).c_str(), MAX_PATH); - wcsncpy(tfile_new, OTTD2FS(file_new).c_str(), MAX_PATH); - /* SHFileOperation wants a double '\0' terminated string. */ - tfilename[MAX_PATH - 1] = '\0'; - tfile_new[MAX_PATH - 1] = '\0'; - tfilename[wcslen(tfilename) + 1] = '\0'; - tfile_new[wcslen(tfile_new) + 1] = '\0'; - - /* Rename file without any user confirmation. */ - SHFILEOPSTRUCT shfopt; - MemSetT(&shfopt, 0); - shfopt.wFunc = FO_MOVE; - shfopt.fFlags = FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_NOERRORUI | FOF_SILENT; - shfopt.pFrom = tfile_new; - shfopt.pTo = tfilename; - SHFileOperation(&shfopt); -#else - if (rename(file_new.c_str(), filename.c_str()) < 0) { - Debug(misc, 0, "Renaming {} to {} failed; configuration not saved", file_new, filename); + std::error_code ec; + std::filesystem::rename(OTTD2FS(file_new), OTTD2FS(filename), ec); + if (ec) { + Debug(misc, 0, "Renaming {} to {} failed; configuration not saved: {}", file_new, filename, ec.message()); } -#endif #ifdef __EMSCRIPTEN__ EM_ASM(if (window["openttd_syncfs"]) openttd_syncfs()); From bb9b8b90c76b98667c7ed2d55794fa3a9688575d Mon Sep 17 00:00:00 2001 From: translators Date: Fri, 12 Apr 2024 04:41:30 +0000 Subject: [PATCH 03/15] Update: Translations from eints swedish: 6 changes by sereneavatar portuguese (brazilian): 11 changes by pasantoro --- src/lang/brazilian_portuguese.txt | 22 +++++++++++----------- src/lang/swedish.txt | 7 ++++++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index 336d63c4e91..f954b9743f7 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -278,7 +278,7 @@ STR_TOOLTIP_SORT_CRITERIA :{BLACK}Escolher STR_TOOLTIP_FILTER_CRITERIA :{BLACK}Escolher o critério de seleção STR_BUTTON_SORT_BY :{BLACK}Ordenar por STR_BUTTON_CATCHMENT :{BLACK}Cobertura -STR_TOOLTIP_CATCHMENT :{BLACK}Mostrar/Ocultar a área de cobertura +STR_TOOLTIP_CATCHMENT :{BLACK}Mostrar/Ocultar área de cobertura STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Fechar janela STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Título da janela - arraste isto para mover a janela @@ -533,8 +533,8 @@ STR_ABOUT_MENU_SCREENSHOT :Captura de tela STR_ABOUT_MENU_SHOW_FRAMERATE :Mostrar taxa de quadros STR_ABOUT_MENU_ABOUT_OPENTTD :Sobre o 'OpenTTD' STR_ABOUT_MENU_SPRITE_ALIGNER :Alinhador de sprites -STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Mostrar/Ocultar as caixas delimitadoras -STR_ABOUT_MENU_TOGGLE_DIRTY_BLOCKS :Ativar/Desativar coloração dos blocos sujos +STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES :Mostrar/Ocultar caixas delimitadoras +STR_ABOUT_MENU_TOGGLE_DIRTY_BLOCKS :Ativar coloração dos blocos sujos STR_ABOUT_MENU_TOGGLE_WIDGET_OUTLINES :Mostrar/Ocultar contornos dos widgets ###length 31 @@ -3431,8 +3431,8 @@ STR_NEWGRF_SETTINGS_FILE_TOOLTIP :{BLACK}Uma list STR_NEWGRF_SETTINGS_SET_PARAMETERS :{BLACK}Definir parâmetros STR_NEWGRF_SETTINGS_SHOW_PARAMETERS :{BLACK}Mostrar parâmetros -STR_NEWGRF_SETTINGS_TOGGLE_PALETTE :{BLACK}Ativar/Desativar paleta -STR_NEWGRF_SETTINGS_TOGGLE_PALETTE_TOOLTIP :{BLACK}Ativar/Desativar a paleta do NewGRF selecionado.{}Faça isso quando os gráficos deste NewGRF ficarem cor de rosa no jogo +STR_NEWGRF_SETTINGS_TOGGLE_PALETTE :{BLACK}Comutar paleta +STR_NEWGRF_SETTINGS_TOGGLE_PALETTE_TOOLTIP :{BLACK}Comutar a paleta do NewGRF selecionado.{}Faça isso quando os gráficos deste NewGRF parecerem cor-de-rosa no jogo STR_NEWGRF_SETTINGS_APPLY_CHANGES :{BLACK}Aplicar modificações STR_NEWGRF_SETTINGS_FIND_MISSING_CONTENT_BUTTON :{BLACK}Procurar conteúdo em falta online @@ -3598,7 +3598,7 @@ STR_NEWGRF_SCAN_ARCHIVES :Procurando por # Sign list window STR_SIGN_LIST_CAPTION :{WHITE}Lista de Placas - {COMMA} Placa{P "" s} STR_SIGN_LIST_MATCH_CASE :{BLACK}Diferenciar maiúsculas/minúsculas -STR_SIGN_LIST_MATCH_CASE_TOOLTIP :{BLACK}Ativar/Desativar correspondência de maiúsculas/minúsculas quando comparar os nomes das placas com a palavra-chave fornecida +STR_SIGN_LIST_MATCH_CASE_TOOLTIP :{BLACK}Considerar correspondência de maiúsculas e minúsculas quando comparar os nomes das placas com a palavra-chave fornecida # Sign window STR_EDIT_SIGN_CAPTION :{WHITE}Editar texto da placa @@ -4013,7 +4013,7 @@ STR_VEHICLE_LIST_SEND_AIRCRAFT_TO_HANGAR :Enviar para um STR_VEHICLE_LIST_MASS_STOP_LIST_TOOLTIP :{BLACK}Clique para parar todos os veículos desta lista STR_VEHICLE_LIST_MASS_START_LIST_TOOLTIP :{BLACK}Clique para iniciar todos os veículos desta lista -STR_VEHICLE_LIST_AVAILABLE_ENGINES_TOOLTIP :{BLACK}Ver lista de modelos de locomotivas disponíveis para este tipo de veículo +STR_VEHICLE_LIST_AVAILABLE_ENGINES_TOOLTIP :{BLACK}Ver a lista de modelos disponíveis para esta classe de veículo STR_VEHICLE_LIST_SHARED_ORDERS_LIST_CAPTION :{WHITE}Ordens compartilhadas de {COMMA} Veículo{P "" s} @@ -4274,7 +4274,7 @@ STR_ENGINE_PREVIEW_SHIP :{G=f}embarcaç STR_ENGINE_PREVIEW_TEXT3 :{BLACK}{STRING}{}{5:STRING}{}{STRING} STR_ENGINE_PREVIEW_TEXT4 :{BLACK}{STRING}{}{STRING}{}{STRING}{}{STRING} STR_ENGINE_PREVIEW_COST_WEIGHT :Custo: {CURRENCY_LONG} Peso: {WEIGHT_SHORT} -STR_ENGINE_PREVIEW_COST_MAX_SPEED :Custo: {CURRENCY_LONG} Veloc. máx.: {VELOCITY} +STR_ENGINE_PREVIEW_COST_MAX_SPEED :Custo: {CURRENCY_LONG} Velocidade máx.: {VELOCITY} STR_ENGINE_PREVIEW_SPEED_POWER :Velocidade: {VELOCITY} Potência: {POWER} STR_ENGINE_PREVIEW_SPEED_POWER_MAX_TE :Veloc.: {VELOCITY} Potência: {POWER} Tração máx.: {FORCE} STR_ENGINE_PREVIEW_TYPE :Tipo de aeronave: {STRING} @@ -4783,7 +4783,7 @@ STR_AI_DEBUG_BREAK_ON_LABEL :{BLACK}Parar em STR_AI_DEBUG_BREAK_STR_OSKTITLE :{BLACK}Parar em STR_AI_DEBUG_BREAK_STR_TOOLTIP :{BLACK}O jogo é pausado quando uma mensagem de registro da IA for igual a esta sequência de caracteres STR_AI_DEBUG_MATCH_CASE :{BLACK}Diferenciar maiúsculas/minúsculas -STR_AI_DEBUG_MATCH_CASE_TOOLTIP :{BLACK}Ativar/Desativar correspondência de maiúsculas/minúsculas quando comparar as mensagens de registro da IA com a sequência de caracteres de parada +STR_AI_DEBUG_MATCH_CASE_TOOLTIP :{BLACK}Considerar correspondência de maiúsculas e minúsculas quando comparar as mensagens de registro da IA com a sequência de caracteres de parada STR_AI_DEBUG_CONTINUE :{BLACK}Continuar STR_AI_DEBUG_CONTINUE_TOOLTIP :{BLACK}Sair da pausa e continuar a IA STR_AI_DEBUG_SELECT_AI_TOOLTIP :{BLACK}Mostrar a saída de depuração desta IA. Ctrl+Clique para abrir em uma nova janela @@ -4900,7 +4900,7 @@ STR_MESSAGE_ESTIMATED_COST :{WHITE}Custo Es STR_MESSAGE_ESTIMATED_INCOME :{WHITE}Receita Estimada: {CURRENCY_LONG} # Saveload messages -STR_ERROR_SAVE_STILL_IN_PROGRESS :{WHITE}Gravação ainda sendo executada,{}por favor aguarde até terminar! +STR_ERROR_SAVE_STILL_IN_PROGRESS :{WHITE}Gravação ainda sendo executada,{}por favor, aguarde até terminar! STR_ERROR_AUTOSAVE_FAILED :{WHITE}Salvamento automático falhou STR_ERROR_UNABLE_TO_READ_DRIVE :{BLACK}Não é possível ler a unidade STR_ERROR_GAME_SAVE_FAILED :{WHITE}Falha ao salvar jogo... @@ -4966,7 +4966,7 @@ STR_ERROR_CLEARING_LIMIT_REACHED :{WHITE}... limi STR_ERROR_TREE_PLANT_LIMIT_REACHED :{WHITE}... limite de plantação de árvores atingido STR_ERROR_NAME_MUST_BE_UNIQUE :{WHITE}Nome deve ser único STR_ERROR_GENERIC_OBJECT_IN_THE_WAY :{WHITE}{1:STRING} no caminho -STR_ERROR_NOT_ALLOWED_WHILE_PAUSED :{WHITE}Não é permitido enquanto pausado +STR_ERROR_NOT_ALLOWED_WHILE_PAUSED :{WHITE}Não é permitido com o jogo pausado # Local authority errors STR_ERROR_LOCAL_AUTHORITY_REFUSES_TO_ALLOW_THIS :{WHITE}A autoridade local de {TOWN} recusa-se a permitir isso diff --git a/src/lang/swedish.txt b/src/lang/swedish.txt index df9d53384f2..41607130c9a 100644 --- a/src/lang/swedish.txt +++ b/src/lang/swedish.txt @@ -3488,6 +3488,9 @@ STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_ROAD_TYPE :Vägtyp STR_NEWGRF_INSPECT_QUERY_CAPTION :{WHITE}NewGRF variabel 60+x parameter (hexadecimal) # Sprite aligner window +STR_SPRITE_ALIGNER_CAPTION_NO_ACTION :{WHITE}Justerar spriteobjekt: ({STRING}:{NUM}) +STR_SPRITE_ALIGNER_CAPTION_ACTIONA :{WHITE}Justerar spriteobjekt: Action 0xA, {COMMA} ({STRING}:{NUM}) +STR_SPRITE_ALIGNER_CAPTION_ACTION5 :{WHITE}Justerar spriteobjekt: Åtgärd 0x5, typ {HEX}, {COMMA} ({STRING}:{NUM}) STR_SPRITE_ALIGNER_NEXT_BUTTON :{BLACK}Nästa spriteobjekt STR_SPRITE_ALIGNER_NEXT_TOOLTIP :{BLACK}Fortsätt till nästa nomala spriteobjekt, ignorera eventuella pseudo/recolour/font spriteobjekt och börja om efter sista spriteobjektet STR_SPRITE_ALIGNER_GOTO_BUTTON :{BLACK}Gå till spriteobjekt @@ -3496,6 +3499,7 @@ STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Tidigare STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Fortsätt till föregående normala spriteobjekt, ignorera eventuella pseudo/recolour/font spriteobjekt och börja om från slutet efter första spriteobjektet STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Representation av det valda objektet. Justeringen ignoreras när objektet ritas. STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Flytta runt objektet och ändra förskjutningen i X- och Y-led. Ctrl+klicka för att flytta runt objektet åtta steg i taget +STR_SPRITE_ALIGNER_SPRITE :{STRING}:{NUM} ###length 2 STR_SPRITE_ALIGNER_CENTRE_OFFSET :{BLACK}Förskjutningscentrerad @@ -3530,7 +3534,7 @@ STR_NEWGRF_ERROR_AFTER_TRANSLATED_FILE :GRF-filen den v STR_NEWGRF_ERROR_TOO_MANY_NEWGRFS_LOADED :För många NewGRFer är laddade STR_NEWGRF_ERROR_STATIC_GRF_CAUSES_DESYNC :Att ladda {1:STRING} som statisk NewGRF med {2:STRING} kan orsaka desynkronisering STR_NEWGRF_ERROR_UNEXPECTED_SPRITE :Oväntat spriteobjekt (spriteobjekt {3:NUM}) -STR_NEWGRF_ERROR_UNKNOWN_PROPERTY :Okänd Action 0-egenskap {4:HEX} (spriteobjekt {3:NUM}) +STR_NEWGRF_ERROR_UNKNOWN_PROPERTY :Okänd Åtgärd 0-egenskap {4:HEX} (spriteobjekt {3:NUM}) STR_NEWGRF_ERROR_INVALID_ID :Försök att använda ett ogiltligt ID (spriteobjekt {3:NUM}) STR_NEWGRF_ERROR_CORRUPT_SPRITE :{YELLOW}{STRING} innehåller ett skadat spriteobjekt. Alla korrupta spriteobjekt kommer att visas som röda frågetecken (?) STR_NEWGRF_ERROR_MULTIPLE_ACTION_8 :Innehåller flera Action 8 (spriteobjekt {3:NUM}) @@ -5832,6 +5836,7 @@ STR_JUST_DATE_ISO :{DATE_ISO} STR_JUST_STRING :{STRING} STR_JUST_STRING1 :{STRING} STR_JUST_STRING2 :{STRING} +STR_JUST_STRING4 :{STRING} STR_JUST_STRING_STRING :{STRING}{STRING} STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} From 003906becb03a2da582930f9b24d61c406221885 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 12 Apr 2024 12:51:42 +0100 Subject: [PATCH 04/15] Codechange: std::filesystem::rename does not need remove first. (#12484) --- src/strgen/strgen.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 8acb4dfbe59..63f5c02b4d7 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -274,9 +274,6 @@ struct HeaderFileWriter : HeaderWriter, FileWriter { std::filesystem::remove(this->path, error_code); // Just ignore the error } else { /* else rename tmp.xxx into filename */ -# if defined(_WIN32) - std::filesystem::remove(this->real_path, error_code); // Just ignore the error, file probably doesn't exist -# endif std::filesystem::rename(this->path, this->real_path, error_code); if (error_code) FatalError("rename({}, {}) failed: {}", this->path, this->real_path, error_code.message()); } From 44b821003783c14372fb3e52e6463130d03dc63b Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 12 Apr 2024 13:01:16 +0100 Subject: [PATCH 05/15] Codechange: settingsgen's CopyFile actually appends. (#12485) --- src/settingsgen/settingsgen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/settingsgen/settingsgen.cpp b/src/settingsgen/settingsgen.cpp index 9a55d0d1707..4b265276bb0 100644 --- a/src/settingsgen/settingsgen.cpp +++ b/src/settingsgen/settingsgen.cpp @@ -322,11 +322,11 @@ static void DumpSections(const IniLoadFile &ifile) } /** - * Copy a file to the output. - * @param fname Filename of file to copy. + * Append a file to the output stream. + * @param fname Filename of file to append. * @param out_fp Output stream to write to. */ -static void CopyFile(const char *fname, FILE *out_fp) +static void AppendFile(const char *fname, FILE *out_fp) { if (fname == nullptr) return; @@ -476,10 +476,10 @@ int CDECL main(int argc, char *argv[]) /* Write output. */ if (output_file == nullptr) { - CopyFile(before_file, stdout); + AppendFile(before_file, stdout); _stored_output.Write(stdout); _post_amble_output.Write(stdout); - CopyFile(after_file, stdout); + AppendFile(after_file, stdout); } else { static const char * const tmp_output = "tmp2.xxx"; @@ -487,10 +487,10 @@ int CDECL main(int argc, char *argv[]) if (fp == nullptr) { FatalError("Cannot open file {}", tmp_output); } - CopyFile(before_file, fp); + AppendFile(before_file, fp); _stored_output.Write(fp); _post_amble_output.Write(fp); - CopyFile(after_file, fp); + AppendFile(after_file, fp); fclose(fp); if (CompareFiles(tmp_output, output_file)) { From ca73f033344a67a915985b5d232d3abdcdbdc99e Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 12 Apr 2024 14:32:35 +0100 Subject: [PATCH 06/15] Codechange: Use std::filesystem::remove/rename in settingsgen. (#12483) --- src/settingsgen/settingsgen.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/settingsgen/settingsgen.cpp b/src/settingsgen/settingsgen.cpp index 4b265276bb0..e2b0362b907 100644 --- a/src/settingsgen/settingsgen.cpp +++ b/src/settingsgen/settingsgen.cpp @@ -15,10 +15,7 @@ #include "../core/mem_func.hpp" #include "../error_func.h" -#if !defined(_WIN32) || defined(__CYGWIN__) -#include -#include -#endif +#include #include "../safeguards.h" @@ -493,15 +490,14 @@ int CDECL main(int argc, char *argv[]) AppendFile(after_file, fp); fclose(fp); + std::error_code error_code; if (CompareFiles(tmp_output, output_file)) { /* Files are equal. tmp2.xxx is not needed. */ - unlink(tmp_output); + std::filesystem::remove(tmp_output, error_code); } else { /* Rename tmp2.xxx to output file. */ -#if defined(_WIN32) - unlink(output_file); -#endif - if (rename(tmp_output, output_file) == -1) FatalError("rename() failed"); + std::filesystem::rename(tmp_output, output_file, error_code); + if (error_code) FatalError("rename({}, {}) failed: {}", tmp_output, output_file, error_code.message()); } } return 0; From c1520cf6828e5a265825ecdade6d48645a4352f9 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 12 Apr 2024 18:01:40 +0100 Subject: [PATCH 07/15] Fix 25aeb1c: Driver parameter documentation was not updated. (#12486) --- src/sound/win32_s.h | 2 +- src/sound/xaudio2_s.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sound/win32_s.h b/src/sound/win32_s.h index 5801f8af414..c89e8596d48 100644 --- a/src/sound/win32_s.h +++ b/src/sound/win32_s.h @@ -24,7 +24,7 @@ class SoundDriver_Win32 : public SoundDriver { /** Factory for the sound driver for Windows. */ class FSoundDriver_Win32 : public DriverFactoryBase { public: - FSoundDriver_Win32() : DriverFactoryBase(Driver::DT_SOUND, 9, "win32", "Win32 WaveOut Sound Driver (param bufsize,hz)") {} + FSoundDriver_Win32() : DriverFactoryBase(Driver::DT_SOUND, 9, "win32", "Win32 WaveOut Sound Driver (param hz,samples)") {} Driver *CreateInstance() const override { return new SoundDriver_Win32(); } }; diff --git a/src/sound/xaudio2_s.h b/src/sound/xaudio2_s.h index 17ec81f3119..b4e2591fb40 100644 --- a/src/sound/xaudio2_s.h +++ b/src/sound/xaudio2_s.h @@ -24,7 +24,7 @@ class SoundDriver_XAudio2 : public SoundDriver { /** Factory for the XAudio2 sound driver. */ class FSoundDriver_XAudio2 : public DriverFactoryBase { public: - FSoundDriver_XAudio2() : DriverFactoryBase(Driver::DT_SOUND, 10, "xaudio2", "XAudio2 Sound Driver (param bufsize,hz)") {} + FSoundDriver_XAudio2() : DriverFactoryBase(Driver::DT_SOUND, 10, "xaudio2", "XAudio2 Sound Driver (param hz,samples)") {} Driver *CreateInstance() const override { return new SoundDriver_XAudio2(); } }; From 12125bad826b534e1a2f46cb76be9f2a2f7ceb58 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 12 Apr 2024 23:07:07 +0100 Subject: [PATCH 08/15] Fix 3de8853e: Industry cargo types callback no longer functioned due to container change. (#12489) Use defined INDUSTRY_NUM_INPUTS/INDUSTRY_NUM_OUTPUTS values instead of container size, which is now empty at this point. --- src/industry_cmd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index fbb056c1624..1382d86556c 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1876,7 +1876,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, /* Clear all input cargo types */ i->accepted.clear(); /* Query actual types */ - uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? static_cast(i->accepted.size()) : 3; + uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? INDUSTRY_NUM_INPUTS : 3; for (uint j = 0; j < maxcargoes; j++) { uint16_t res = GetIndustryCallback(CBID_INDUSTRY_INPUT_CARGO_TYPES, j, 0, i, type, INVALID_TILE); if (res == CALLBACK_FAILED || GB(res, 0, 8) == UINT8_MAX) break; @@ -1914,7 +1914,7 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type, /* Clear all output cargo types */ i->produced.clear(); /* Query actual types */ - uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? static_cast(i->produced.size()) : 2; + uint maxcargoes = (indspec->behaviour & INDUSTRYBEH_CARGOTYPES_UNLIMITED) ? INDUSTRY_NUM_OUTPUTS : 2; for (uint j = 0; j < maxcargoes; j++) { uint16_t res = GetIndustryCallback(CBID_INDUSTRY_OUTPUT_CARGO_TYPES, j, 0, i, type, INVALID_TILE); if (res == CALLBACK_FAILED || GB(res, 0, 8) == UINT8_MAX) break; From e83e2df02315dd82a5c0a5f6e5e5fecd6a17ee13 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 12 Apr 2024 23:07:31 +0100 Subject: [PATCH 09/15] Fix: Build industry window did not take width of count into account. (#12476) --- src/industry_gui.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 211bcf7e695..8633c1e82c2 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -429,12 +429,14 @@ class BuildIndustryWindow : public Window { { switch (widget) { case WID_DPI_MATRIX_WIDGET: { - Dimension d = GetStringBoundingBox(STR_FUND_INDUSTRY_MANY_RANDOM_INDUSTRIES); + SetDParamMaxDigits(0, 4); + Dimension count = GetStringBoundingBox(STR_JUST_COMMA, FS_SMALL); + Dimension d{}; for (const auto &indtype : this->list) { d = maxdim(d, GetStringBoundingBox(GetIndustrySpec(indtype)->name)); } - resize.height = std::max(this->legend.height, GetCharacterHeight(FS_NORMAL)) + padding.height; - d.width += this->legend.width + WidgetDimensions::scaled.hsep_wide + padding.width; + resize.height = std::max({this->legend.height, d.height, count.height}) + padding.height; + d.width += this->legend.width + WidgetDimensions::scaled.hsep_wide + WidgetDimensions::scaled.hsep_normal + count.width + padding.width; d.height = 5 * resize.height; size = maxdim(size, d); break; From 090c3b3abfb44094ee82ce3b68fa8b9fb0dfc8e1 Mon Sep 17 00:00:00 2001 From: translators Date: Sat, 13 Apr 2024 04:40:27 +0000 Subject: [PATCH 10/15] Update: Translations from eints danish: 5 changes by bscargo dutch: 5 changes by Afoklala portuguese (brazilian): 7 changes by pasantoro --- src/lang/brazilian_portuguese.txt | 14 +++++++------- src/lang/danish.txt | 5 +++++ src/lang/dutch.txt | 5 +++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index f954b9743f7..c17442f143e 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -2170,7 +2170,7 @@ STR_CONFIG_ERROR_SPRITECACHE_TOO_BIG :{WHITE}Falha ao # Video initalization errors STR_VIDEO_DRIVER_ERROR :{WHITE}Erro nas configurações de vídeo... STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION :{WHITE}... nenhuma GPU compatível encontrada. Aceleração por hardware desativada -STR_VIDEO_DRIVER_ERROR_HARDWARE_ACCELERATION_CRASH :{WHITE}... controlador gráfico (GPU) travou o jogo. Aceleração por hardware desativada +STR_VIDEO_DRIVER_ERROR_HARDWARE_ACCELERATION_CRASH :{WHITE}... controlador gráfico travou o jogo. Aceleração por hardware desativada # Intro window STR_INTRO_CAPTION :{WHITE}OpenTTD {REV} @@ -3661,7 +3661,7 @@ STR_LOCAL_AUTHORITY_ACTION_MEDIUM_ADVERTISING_CAMPAIGN :Campanha public STR_LOCAL_AUTHORITY_ACTION_LARGE_ADVERTISING_CAMPAIGN :Campanha publicitária grande STR_LOCAL_AUTHORITY_ACTION_ROAD_RECONSTRUCTION :Financiar a reconstrução das estradas locais STR_LOCAL_AUTHORITY_ACTION_STATUE_OF_COMPANY :Construir estátua do proprietário da empresa -STR_LOCAL_AUTHORITY_ACTION_NEW_BUILDINGS :Financiar novos edifícios +STR_LOCAL_AUTHORITY_ACTION_NEW_BUILDINGS :Financiar novas construções STR_LOCAL_AUTHORITY_ACTION_EXCLUSIVE_TRANSPORT :Comprar direitos exclusivos de transporte STR_LOCAL_AUTHORITY_ACTION_BRIBE :Subornar a autoridade local ###next-name-looks-similar @@ -4013,7 +4013,7 @@ STR_VEHICLE_LIST_SEND_AIRCRAFT_TO_HANGAR :Enviar para um STR_VEHICLE_LIST_MASS_STOP_LIST_TOOLTIP :{BLACK}Clique para parar todos os veículos desta lista STR_VEHICLE_LIST_MASS_START_LIST_TOOLTIP :{BLACK}Clique para iniciar todos os veículos desta lista -STR_VEHICLE_LIST_AVAILABLE_ENGINES_TOOLTIP :{BLACK}Ver a lista de modelos disponíveis para esta classe de veículo +STR_VEHICLE_LIST_AVAILABLE_ENGINES_TOOLTIP :{BLACK}Ver lista de modelos disponíveis para esta classe de veículo STR_VEHICLE_LIST_SHARED_ORDERS_LIST_CAPTION :{WHITE}Ordens compartilhadas de {COMMA} Veículo{P "" s} @@ -4261,11 +4261,11 @@ STR_ENGINE_PREVIEW_CAPTION :{WHITE}Mensagem STR_ENGINE_PREVIEW_MESSAGE :{GOLD}Desenvolvemos um novo modelo de {STRING} - você gostaria de ter um ano de uso exclusivo deste veículo, para que possamos avaliar o desempenho dele antes de ser globalmente disponibilizado? STR_ENGINE_PREVIEW_RAILROAD_LOCOMOTIVE :{G=f}locomotiva ferroviária -STR_ENGINE_PREVIEW_ELRAIL_LOCOMOTIVE :{G=f}locomotiva ferroviária elétrica +STR_ENGINE_PREVIEW_ELRAIL_LOCOMOTIVE :{G=f}locomotiva elétrica STR_ENGINE_PREVIEW_MONORAIL_LOCOMOTIVE :{G=f}locomotiva monotrilho STR_ENGINE_PREVIEW_MAGLEV_LOCOMOTIVE :{G=f}locomotiva maglev -STR_ENGINE_PREVIEW_ROAD_VEHICLE :{G=m}veículo rodoviário +STR_ENGINE_PREVIEW_ROAD_VEHICLE :{G=m}veículo STR_ENGINE_PREVIEW_TRAM_VEHICLE :{G=m}bonde STR_ENGINE_PREVIEW_AIRCRAFT :{G=f}aeronave @@ -4746,7 +4746,7 @@ STR_TIMETABLE_CLEAR_SPEED :{BLACK}Remover STR_TIMETABLE_CLEAR_SPEED_TOOLTIP :{BLACK}Apagar a velocidade máxima de viagem da ordem selecionada. Ctrl+Clique para apagar a velocidade de todas as ordens STR_TIMETABLE_RESET_LATENESS :{BLACK}Reiniciar Contador de Atrasos -STR_TIMETABLE_RESET_LATENESS_TOOLTIP :{BLACK}Reiniciar o contador de atrasos para o veículo ficar pontual. Ctrl+Clique para reiniciar todo o grupo e, com isso, fazer o veículo mais atrasado ficar no horário e todos os outros ficarem adiantados +STR_TIMETABLE_RESET_LATENESS_TOOLTIP :{BLACK}Reiniciar o contador de atrasos para o veículo ficar pontual. Ctrl+Clique para reiniciar todo o grupo e, com isso, fazer o veículo mais atrasado ficar pontual e todos os outros ficarem adiantados STR_TIMETABLE_AUTOFILL :{BLACK}Preencher automaticamente STR_TIMETABLE_AUTOFILL_TOOLTIP :{BLACK}Preencher o horário automaticamente com os valores da próxima viagem. Ctrl+Clique para tentar manter os tempos de espera @@ -4921,7 +4921,7 @@ STR_ERROR_COULD_NOT_CREATE_TOWN :{WHITE}Geraçã STR_ERROR_NO_TOWN_IN_SCENARIO :{WHITE}... não existem localidades neste cenário STR_ERROR_PNGMAP :{WHITE}Não foi possível carregar paisagem de PNG... -STR_ERROR_PNGMAP_FILE_NOT_FOUND :{WHITE}... arquivo não encontrado +STR_ERROR_PNGMAP_FILE_NOT_FOUND :{WHITE}... arquivo não foi encontrado STR_ERROR_PNGMAP_IMAGE_TYPE :{WHITE}... não foi possível converter o tipo de imagem. A imagem deve ser PNG de 8 ou 24-bit STR_ERROR_PNGMAP_MISC :{WHITE}... alguma coisa deu errado (provavelmente arquivo corrompido) diff --git a/src/lang/danish.txt b/src/lang/danish.txt index 5856ec9c12e..d0a9398d6b4 100644 --- a/src/lang/danish.txt +++ b/src/lang/danish.txt @@ -3488,6 +3488,9 @@ STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_ROAD_TYPE :Vej type STR_NEWGRF_INSPECT_QUERY_CAPTION :{WHITE}NewGRF variabel 60+x parameter (hexadecimal) # Sprite aligner window +STR_SPRITE_ALIGNER_CAPTION_NO_ACTION :{WHITE}Justering af sprite: ({STRING}:{NUM}) +STR_SPRITE_ALIGNER_CAPTION_ACTIONA :{WHITE}Justering af sprite: Handling 0xA, {COMMA} ({STRING}:{NUM}) +STR_SPRITE_ALIGNER_CAPTION_ACTION5 :{WHITE}Justering af sprite: Handling 0x5, type {HEX}, {COMMA} ({STRING}:{NUM}) STR_SPRITE_ALIGNER_NEXT_BUTTON :{BLACK}Næste sprite STR_SPRITE_ALIGNER_NEXT_TOOLTIP :{BLACK}Fortsæt til næste normale sprite, spring pseudo/omfarvning/font-sprites over og med omløb fra enden til starten STR_SPRITE_ALIGNER_GOTO_BUTTON :{BLACK}Gå til sprite @@ -3496,6 +3499,7 @@ STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Forrige STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Fortsæt til den forrige normal sprite, spring pseudo/omfarvning/font-sprites over og omløb fra starten til slutningen STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Repræsentation af den markerede sprite. Justeringen ignoreres når denne sprite tegnes. STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Flyt spriten rundt for at ændre X- og Y-forskydningen. Ctrl+Klik for at flytte spriten otte enheder af gangen +STR_SPRITE_ALIGNER_SPRITE :{STRING}:{NUM} ###length 2 STR_SPRITE_ALIGNER_CENTRE_OFFSET :{BLACK}Forskudt centreret @@ -5832,6 +5836,7 @@ STR_JUST_DATE_ISO :{DATE_ISO} STR_JUST_STRING :{STRING} STR_JUST_STRING1 :{STRING} STR_JUST_STRING2 :{STRING} +STR_JUST_STRING4 :{STRING} STR_JUST_STRING_STRING :{STRING}{STRING} STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index 2ef0e067eae..25fb25b4970 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -3488,6 +3488,9 @@ STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_ROAD_TYPE :Wegtype STR_NEWGRF_INSPECT_QUERY_CAPTION :{WHITE}Parameter 60+x voor NewGRF-variabele (hexadecimaal) # Sprite aligner window +STR_SPRITE_ALIGNER_CAPTION_NO_ACTION :{WHITE}Sprite uitlijnen: ({STRING}:{NUM}) +STR_SPRITE_ALIGNER_CAPTION_ACTIONA :{WHITE}Sprite uitlijnen: actie 0xA, {COMMA} ({STRING}:{NUM}) +STR_SPRITE_ALIGNER_CAPTION_ACTION5 :{WHITE}Sprite uitlijnen: actie 0x5, type {HEX}, {COMMA} ({STRING}:{NUM}) STR_SPRITE_ALIGNER_NEXT_BUTTON :{BLACK}Volgende sprite STR_SPRITE_ALIGNER_NEXT_TOOLTIP :{BLACK}Doorgaan met volgende normale sprite, alle pseudo-/herkleur-/lettertype-sprites overslaan; bij het einde terug naar het begin STR_SPRITE_ALIGNER_GOTO_BUTTON :{BLACK}Ga naar sprite @@ -3496,6 +3499,7 @@ STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Vorige s STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Doorgaan met de vorige normale sprite, alle pseudo-/herkleur-/lettertype-sprites overslaan; bij het einde terug naar het begin STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Voorbeeld van de huidige sprite. De uitlijning wordt genegeerd bij het weergeven van deze sprite. STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Sprite verplaatsen, dit verandert X en Y offsets. Ctr+klik om de sprite 8 eenheden per keer te verplaatsen. +STR_SPRITE_ALIGNER_SPRITE :{STRING}:{NUM} ###length 2 STR_SPRITE_ALIGNER_CENTRE_OFFSET :{BLACK}Op offset gecentreerd @@ -5832,6 +5836,7 @@ STR_JUST_DATE_ISO :{DATE_ISO} STR_JUST_STRING :{STRING} STR_JUST_STRING1 :{STRING} STR_JUST_STRING2 :{STRING} +STR_JUST_STRING4 :{STRING} STR_JUST_STRING_STRING :{STRING}{STRING} STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} From 29e932e087b1c520ed5dcb91036b67d64f586a2e Mon Sep 17 00:00:00 2001 From: translators Date: Sun, 14 Apr 2024 05:02:47 +0000 Subject: [PATCH 11/15] Update: Translations from eints ukrainian: 13 changes by imlystyi lithuanian: 19 changes by dziugas1959 french: 7 changes by ottdfevr portuguese (brazilian): 14 changes by pasantoro --- src/lang/brazilian_portuguese.txt | 28 ++++++++++++++-------------- src/lang/french.txt | 7 +++++++ src/lang/lithuanian.txt | 22 +++++++++++++++++++--- src/lang/ukrainian.txt | 26 +++++++++++++------------- 4 files changed, 53 insertions(+), 30 deletions(-) diff --git a/src/lang/brazilian_portuguese.txt b/src/lang/brazilian_portuguese.txt index c17442f143e..bdf6cfa9ed4 100644 --- a/src/lang/brazilian_portuguese.txt +++ b/src/lang/brazilian_portuguese.txt @@ -278,7 +278,7 @@ STR_TOOLTIP_SORT_CRITERIA :{BLACK}Escolher STR_TOOLTIP_FILTER_CRITERIA :{BLACK}Escolher o critério de seleção STR_BUTTON_SORT_BY :{BLACK}Ordenar por STR_BUTTON_CATCHMENT :{BLACK}Cobertura -STR_TOOLTIP_CATCHMENT :{BLACK}Mostrar/Ocultar área de cobertura +STR_TOOLTIP_CATCHMENT :{BLACK}Mostrar área de cobertura STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Fechar janela STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Título da janela - arraste isto para mover a janela @@ -792,7 +792,7 @@ STR_SMALLMAP_LEGENDA_INDUSTRIES :{TINY_FONT}{BLA STR_SMALLMAP_LEGENDA_DESERT :{TINY_FONT}{BLACK}Deserto STR_SMALLMAP_LEGENDA_SNOW :{TINY_FONT}{BLACK}Neve -STR_SMALLMAP_TOOLTIP_TOGGLE_TOWN_NAMES_ON_OFF :{BLACK}Mostrar/Ocultar nomes das localidades no mapa +STR_SMALLMAP_TOOLTIP_TOGGLE_TOWN_NAMES_ON_OFF :{BLACK}Mostrar nomes das localidades no mapa STR_SMALLMAP_CENTER :{BLACK}Centralizar o minimapa na localização atual STR_SMALLMAP_INDUSTRY :{TINY_FONT}{STRING} ({NUM}) STR_SMALLMAP_LINKSTATS :{TINY_FONT}{STRING} @@ -803,7 +803,7 @@ STR_SMALLMAP_ENABLE_ALL :{BLACK}Ativar t STR_SMALLMAP_SHOW_HEIGHT :{BLACK}Mostrar altitudes STR_SMALLMAP_TOOLTIP_DISABLE_ALL_INDUSTRIES :{BLACK}Não mostrar indústrias no mapa STR_SMALLMAP_TOOLTIP_ENABLE_ALL_INDUSTRIES :{BLACK}Mostrar todas as indústrias no mapa -STR_SMALLMAP_TOOLTIP_SHOW_HEIGHT :{BLACK}Mostrar/Ocultar mapa de altitudes +STR_SMALLMAP_TOOLTIP_SHOW_HEIGHT :{BLACK}Mostrar mapa de altitudes STR_SMALLMAP_TOOLTIP_DISABLE_ALL_COMPANIES :{BLACK}Mostrar no mapa as propriedades que não pertencem às empresas STR_SMALLMAP_TOOLTIP_ENABLE_ALL_COMPANIES :{BLACK}Mostrar no mapa as propriedades de todas as empresas STR_SMALLMAP_TOOLTIP_DISABLE_ALL_CARGOS :{BLACK}Não mostrar as cargas no mapa @@ -2731,15 +2731,15 @@ STR_MISSING_GRAPHICS_ERROR_QUIT :{BLACK}Sair do # Transparency settings window STR_TRANSPARENCY_CAPTION :{WHITE}Opções de Transparência -STR_TRANSPARENT_SIGNS_TOOLTIP :{BLACK}Ativar/Desativar transparência para placas. Ctrl+Clique para travar -STR_TRANSPARENT_TREES_TOOLTIP :{BLACK}Ativar/Desativar transparência para árvores. Ctrl+Clique para travar -STR_TRANSPARENT_HOUSES_TOOLTIP :{BLACK}Ativar/Desativar transparência para casas. Ctrl+Clique para travar -STR_TRANSPARENT_INDUSTRIES_TOOLTIP :{BLACK}Ativar/Desativar transparência para indústrias. Ctrl+Clique para travar -STR_TRANSPARENT_BUILDINGS_TOOLTIP :{BLACK}Ativar/Desativar transparência para construções como estações, depósitos e pontos de controle. Ctrl+Clique para travar -STR_TRANSPARENT_BRIDGES_TOOLTIP :{BLACK}Ativar/Desativar transparência para pontes. Ctrl+Clique para travar -STR_TRANSPARENT_STRUCTURES_TOOLTIP :{BLACK}Ativar/Desativar transparência para estruturas como faróis e antenas. Ctrl+Clique para travar -STR_TRANSPARENT_CATENARY_TOOLTIP :{BLACK}Ativar/Desativar transparência para catenária. Ctrl+Clique para travar -STR_TRANSPARENT_TEXT_TOOLTIP :{BLACK}Ativar/Desativar transparência para textos de carregamento e custo/receita. Ctrl+Clique para travar +STR_TRANSPARENT_SIGNS_TOOLTIP :{BLACK}Ativar transparência para placas. Ctrl+Clique para travar +STR_TRANSPARENT_TREES_TOOLTIP :{BLACK}Ativar transparência para árvores. Ctrl+Clique para travar +STR_TRANSPARENT_HOUSES_TOOLTIP :{BLACK}Ativar transparência para casas. Ctrl+Clique para travar +STR_TRANSPARENT_INDUSTRIES_TOOLTIP :{BLACK}Ativar transparência para indústrias. Ctrl+Clique para travar +STR_TRANSPARENT_BUILDINGS_TOOLTIP :{BLACK}Ativar transparência para construções como estações, depósitos e pontos de controle. Ctrl+Clique para travar +STR_TRANSPARENT_BRIDGES_TOOLTIP :{BLACK}Ativar transparência para pontes. Ctrl+Clique para travar +STR_TRANSPARENT_STRUCTURES_TOOLTIP :{BLACK}Ativar transparência para estruturas como faróis e antenas. Ctrl+Clique para travar +STR_TRANSPARENT_CATENARY_TOOLTIP :{BLACK}Ativar transparência para catenária. Ctrl+Clique para travar +STR_TRANSPARENT_TEXT_TOOLTIP :{BLACK}Ativar transparência para textos de carregamento e custo/receita. Ctrl+Clique para travar STR_TRANSPARENT_INVISIBLE_TOOLTIP :{BLACK}Definir objetos como invisíveis ao invés de transparentes # Linkgraph legend window @@ -4529,7 +4529,7 @@ STR_REFIT_AIRCRAFT_REFIT_TOOLTIP :{BLACK}Adaptar # Order view STR_ORDERS_CAPTION :{WHITE}{VEHICLE} (Ordens) STR_ORDERS_TIMETABLE_VIEW :{BLACK}Horários -STR_ORDERS_TIMETABLE_VIEW_TOOLTIP :{BLACK}Mudar para a visualização de horários +STR_ORDERS_TIMETABLE_VIEW_TOOLTIP :{BLACK}Mudar para visualização de horários STR_ORDERS_LIST_TOOLTIP :{BLACK}Lista de ordens - clique numa ordem para selecioná-la. Ctrl+Clique para mostrar o destino da ordem STR_ORDER_INDEX :{COMMA}:{NBSP} @@ -4701,7 +4701,7 @@ STR_INVALID_ORDER :{RED} (Ordem In # Time table window STR_TIMETABLE_TITLE :{WHITE}{VEHICLE} (Horários) STR_TIMETABLE_ORDER_VIEW :{BLACK}Ordens -STR_TIMETABLE_ORDER_VIEW_TOOLTIP :{BLACK}Mudar para a visualização de ordens +STR_TIMETABLE_ORDER_VIEW_TOOLTIP :{BLACK}Mudar para visualização de ordens STR_TIMETABLE_TOOLTIP :{BLACK}Horários - clique numa ordem para selecioná-la diff --git a/src/lang/french.txt b/src/lang/french.txt index adf9f97a725..383c102faf7 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -3489,6 +3489,9 @@ STR_NEWGRF_INSPECT_CAPTION_OBJECT_AT_ROAD_TYPE :Type de route STR_NEWGRF_INSPECT_QUERY_CAPTION :{WHITE}Paramètre de variable NewGRF 60+x (héxadecimal) # Sprite aligner window +STR_SPRITE_ALIGNER_CAPTION_NO_ACTION :{WHITE}Alignement de sprite : ({STRING}:{NUM}) +STR_SPRITE_ALIGNER_CAPTION_ACTIONA :{WHITE}Alignement de sprite : Action 0xA, {COMMA} ({STRING}:{NUM}) +STR_SPRITE_ALIGNER_CAPTION_ACTION5 :{WHITE}Alignement de sprite : Action 0x5, type {HEX}, {COMMA} ({STRING}:{NUM}) STR_SPRITE_ALIGNER_NEXT_BUTTON :{BLACK}Sprite suivant STR_SPRITE_ALIGNER_NEXT_TOOLTIP :{BLACK}Se rendre au prochain sprite normal, en ignorant les pseudo-sprites et les sprites de recoloration et de police, et en bouclant du dernier vers le premier STR_SPRITE_ALIGNER_GOTO_BUTTON :{BLACK}Aller au sprite @@ -3497,6 +3500,7 @@ STR_SPRITE_ALIGNER_PREVIOUS_BUTTON :{BLACK}Sprite p STR_SPRITE_ALIGNER_PREVIOUS_TOOLTIP :{BLACK}Se rendre au précédent sprite normal, en ignorant les pseudo-sprites et les sprites de recoloration et de police, et en bouclant du premier vers le dernier STR_SPRITE_ALIGNER_SPRITE_TOOLTIP :{BLACK}Representation du sprite actuellement séléctionné. L'alignement est ignoré lors de l'affichage de ce sprite STR_SPRITE_ALIGNER_MOVE_TOOLTIP :{BLACK}Déplacer le sprite, en modifiant les décalages X et Y. Ctrl-clic pour déplacer le sprite de 8 unités à la fois. +STR_SPRITE_ALIGNER_SPRITE :{STRING}:{NUM} ###length 2 STR_SPRITE_ALIGNER_CENTRE_OFFSET :{BLACK}Décalage centré @@ -4899,7 +4903,9 @@ STR_MESSAGE_ESTIMATED_INCOME :{WHITE}Revenu e STR_ERROR_SAVE_STILL_IN_PROGRESS :{WHITE}Sauvegarde en cours...{}Veuillez attendre la fin du processus{NBSP}! STR_ERROR_AUTOSAVE_FAILED :{WHITE}Échec de l'enregistrement automatique STR_ERROR_UNABLE_TO_READ_DRIVE :{BLACK}Impossible d'accéder au disque +STR_ERROR_GAME_SAVE_FAILED :{WHITE}La sauvegarde a échoué... STR_ERROR_UNABLE_TO_DELETE_FILE :{WHITE}Impossible de supprimer le fichier +STR_ERROR_GAME_LOAD_FAILED :{WHITE}Le chargement a échoué... STR_GAME_SAVELOAD_ERROR_BROKEN_INTERNAL_ERROR :Erreur interne{NBSP}: {STRING} STR_GAME_SAVELOAD_ERROR_BROKEN_SAVEGAME :Sauvegarde corrompue − {STRING} STR_GAME_SAVELOAD_ERROR_TOO_NEW_SAVEGAME :Sauvegarde modifiée avec une version plus récente @@ -5831,6 +5837,7 @@ STR_JUST_DATE_ISO :{DATE_ISO} STR_JUST_STRING :{STRING} STR_JUST_STRING1 :{STRING} STR_JUST_STRING2 :{STRING} +STR_JUST_STRING4 :{STRING} STR_JUST_STRING_STRING :{STRING}{STRING} STR_JUST_RAW_STRING :{STRING} STR_JUST_BIG_RAW_STRING :{BIG_FONT}{STRING} diff --git a/src/lang/lithuanian.txt b/src/lang/lithuanian.txt index 1ef30e27f18..578359c1bb5 100644 --- a/src/lang/lithuanian.txt +++ b/src/lang/lithuanian.txt @@ -692,7 +692,7 @@ STR_NEWS_MENU_DELETE_ALL_MESSAGES :Pašalinti visa STR_ABOUT_MENU_LAND_BLOCK_INFO :Žemės ploto informacija STR_ABOUT_MENU_HELP :Pagalba ir gidai STR_ABOUT_MENU_TOGGLE_CONSOLE :Perjungti konsolę -STR_ABOUT_MENU_AI_DEBUG :AI / GameScript derinimas +STR_ABOUT_MENU_AI_DEBUG :DI / „GameScript“ derinimas STR_ABOUT_MENU_SCREENSHOT :Ekrano nuotrauka STR_ABOUT_MENU_SHOW_FRAMERATE :Kadrų dažniai STR_ABOUT_MENU_ABOUT_OPENTTD :Apie „OpenTTD“ @@ -1095,7 +1095,13 @@ STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT :{BLACK}Įkelti STR_GAME_OPTIONS_CAPTION :{WHITE}Pagrindinės nuostatos +STR_GAME_OPTIONS_VOLUME :Tūris +STR_GAME_OPTIONS_VOLUME_0 :0% +STR_GAME_OPTIONS_VOLUME_25 :25% +STR_GAME_OPTIONS_VOLUME_50 :50% +STR_GAME_OPTIONS_VOLUME_75 :75% +STR_GAME_OPTIONS_VOLUME_100 :100% STR_GAME_OPTIONS_CURRENCY_UNITS_FRAME :{BLACK}Valiuta STR_GAME_OPTIONS_CURRENCY_UNITS_DROPDOWN_TOOLTIP :{BLACK}Valiutos pasirinkimas @@ -1151,6 +1157,10 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Pasirink # Autosave dropdown ###length 5 STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_OFF :Išjungta +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_10_MINUTES :Kas 10min. +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_30_MINUTES :Kas 30min. +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_60_MINUTES :Kas 60min. +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_120_MINUTES :Kas 120min. STR_GAME_OPTIONS_LANGUAGE :{BLACK}Kalba STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Pasirinkite aplinkos kalbą @@ -1789,6 +1799,7 @@ STR_CONFIG_SETTING_LOADING_INDICATORS :Rodyti krovos i STR_CONFIG_SETTING_LOADING_INDICATORS_HELPTEXT :Krovos indikatoriai rodomi virš pakraunamų bei iškraunamų tansporto priemonių ###length 3 +STR_CONFIG_SETTING_TIMETABLE_MODE_DAYS :Dienos STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :Rodyti arvykimą ir išvykimą tvarkaraščiuose: {STRING} STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE_HELPTEXT :Tvarkaraščiuose rodyti numatomas atvykimo ir išvykimo datas @@ -2302,10 +2313,12 @@ STR_LIVERY_ROAD_VEHICLE_TOOLTIP :{BLACK}Rodyti a STR_LIVERY_SHIP_TOOLTIP :{BLACK}Rodyti laivų spalvas STR_LIVERY_AIRCRAFT_TOOLTIP :{BLACK}Rodyti lėktuvų spalvas STR_LIVERY_TRAIN_GROUP_TOOLTIP :{BLACK}Rodyti traukinių grupių spalvas +STR_LIVERY_SHIP_GROUP_TOOLTIP :{BLACK}Rodyti laivų grupių spalvas STR_LIVERY_PRIMARY_TOOLTIP :{BLACK}Pasirinkite pirminę spalvą pasirinktai schemai. Spustelėjus laikant nuspaustą Ctrl klavišą, pasirinkta spava bus nustatyta visoms schemoms. STR_LIVERY_SECONDARY_TOOLTIP :{BLACK}Pasirinkite antrinę spalvą pasirinktai schemai. Spustelėjus laikant nuspaustą Ctrl klavišą, pasirinkta spava bus nustatyta visoms schemoms. STR_LIVERY_PANEL_TOOLTIP :{BLACK}Pasirinkite objektą, kurio spalvas norite pakeisti. Spragsint laikant nuspaustą Ctrl klavišą, galėsite pasirinkti iškart kelis objektus. STR_LIVERY_TRAIN_GROUP_EMPTY :Nėra nustatytų traukinių grupių +STR_LIVERY_SHIP_GROUP_EMPTY :Nėra nustatytų laivų grupių ###length 23 STR_LIVERY_DEFAULT :Numatytosios spalvos @@ -3290,6 +3303,7 @@ STR_MAPGEN_DESERT_COVERAGE_DOWN :{BLACK}Sumažin STR_MAPGEN_DESERT_COVERAGE_TEXT :{BLACK}{NUM}% STR_MAPGEN_TERRAIN_TYPE :{BLACK}Vietovės tipas: STR_MAPGEN_SEA_LEVEL :{BLACK}Jūros lygis: +STR_MAPGEN_SEA_LEVEL_TOOLTIP :{BLACK}Pasirinkti jūros lygį STR_MAPGEN_QUANTITY_OF_RIVERS :{BLACK}Upių kiekis: STR_MAPGEN_SMOOTHNESS :{BLACK}Jautrumas: STR_MAPGEN_VARIETY :{BLACK}Įvairovės paskirstymas: @@ -4700,7 +4714,7 @@ STR_DATE_YEAR_TOOLTIP :{BLACK}Pasirink # AI debug window -STR_AI_DEBUG :{WHITE}DI / GameScript derinimas +STR_AI_DEBUG :{WHITE}DI / „GameScript“ derinimas STR_AI_DEBUG_NAME_AND_VERSION :{BLACK}{STRING} (v{NUM}) STR_AI_DEBUG_NAME_TOOLTIP :{BLACK}Skripto pavadinimas STR_AI_DEBUG_SETTINGS :{BLACK}Nustatymai @@ -4721,9 +4735,10 @@ STR_AI_GAME_SCRIPT_TOOLTIP :{BLACK}Patikrin STR_ERROR_AI_NO_AI_FOUND :Nerasta jokio tinkamo DI.{}Šis DI yra netikras ir nieko nedarys.{}Galite parsisiųsti keletą DI per 'Turinio internete' sistemą. STR_ERROR_AI_PLEASE_REPORT_CRASH :{WHITE}Vienas iš paleistų skriptų išsijungė. Praneškite apie tai šio skripto autoriui su skripto debug lango vaizdu -STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}DI / GameScript derinimo langas yra pasiekiamas tik iš serverio +STR_ERROR_AI_DEBUG_SERVER_ONLY :{YELLOW}DI / „GameScript“ derinimo langas yra pasiekiamas tik iš serverio # AI configuration window +STR_AI_CONFIG_CAPTION_AI :{WHITE}DI nustatymai STR_AI_CONFIG_GAMELIST_TOOLTIP :{BLACK}Žaidimo skriptas bus įkeltas sekančiame žaidime STR_AI_CONFIG_AILIST_TOOLTIP :{BLACK}DI'ai bus įkelti sekančiame žaidime STR_AI_CONFIG_HUMAN_PLAYER :Žaidėjas Žmogus @@ -4770,6 +4785,7 @@ STR_SCREENSHOT_HEIGHTMAP_SCREENSHOT :{BLACK}Teminio STR_SCREENSHOT_MINIMAP_SCREENSHOT :{BLACK}Mini žemėlapio kopija # Script Parameters +STR_AI_SETTINGS_CAPTION :{WHITE}{STRING} Parametrai STR_AI_SETTINGS_CAPTION_AI :DI STR_AI_SETTINGS_CLOSE :{BLACK}Uždaryti STR_AI_SETTINGS_RESET :{BLACK}Atstatyti diff --git a/src/lang/ukrainian.txt b/src/lang/ukrainian.txt index b293437dddf..7eadb934976 100644 --- a/src/lang/ukrainian.txt +++ b/src/lang/ukrainian.txt @@ -1126,7 +1126,7 @@ STR_GAME_OPTIONS_CURRENCY_NLG :Нідерла STR_GAME_OPTIONS_CURRENCY_NOK :Норвезька крона STR_GAME_OPTIONS_CURRENCY_PLN :Польський злотий STR_GAME_OPTIONS_CURRENCY_RON :Румунський лей -STR_GAME_OPTIONS_CURRENCY_RUR :Російський рубель +STR_GAME_OPTIONS_CURRENCY_RUR :Російський рубль STR_GAME_OPTIONS_CURRENCY_SIT :Словенський талер STR_GAME_OPTIONS_CURRENCY_SEK :Шведська крона STR_GAME_OPTIONS_CURRENCY_TRY :Турецька ліра @@ -1139,7 +1139,7 @@ STR_GAME_OPTIONS_CURRENCY_ZAR :Південн STR_GAME_OPTIONS_CURRENCY_CUSTOM :Власна... STR_GAME_OPTIONS_CURRENCY_GEL :Грузинські ларі STR_GAME_OPTIONS_CURRENCY_IRR :Іранський ріал -STR_GAME_OPTIONS_CURRENCY_RUB :Російський новий рубель +STR_GAME_OPTIONS_CURRENCY_RUB :Російський новий рубль STR_GAME_OPTIONS_CURRENCY_MXN :Мексиканське песо STR_GAME_OPTIONS_CURRENCY_NTD :Новий тайваньський долар STR_GAME_OPTIONS_CURRENCY_CNY :Китайські ренміні @@ -1155,7 +1155,7 @@ STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :{BLACK}Вибе # Autosave dropdown ###length 5 -STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_OFF :вимкнено +STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_OFF :Вимкнено STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_10_MINUTES :Кожні 10 хвилин STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_30_MINUTES :Кожні 30 хвилин STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_EVERY_60_MINUTES :Кожні 60 хвилин @@ -1166,7 +1166,7 @@ STR_GAME_OPTIONS_LANGUAGE_TOOLTIP :{BLACK}Вибе STR_GAME_OPTIONS_LANGUAGE_PERCENTAGE :{STRING} ({NUM}% виконано) STR_GAME_OPTIONS_FULLSCREEN :{BLACK}Повноекранний режим -STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Натисніть цю кнопку, щоби грати в OpenTTD у повноекранному режимі +STR_GAME_OPTIONS_FULLSCREEN_TOOLTIP :{BLACK}Позначте цей прапорець для використання повноекранного режиму STR_GAME_OPTIONS_RESOLUTION :{BLACK}Роздільна здатність екрана STR_GAME_OPTIONS_RESOLUTION_TOOLTIP :{BLACK}Виберіть, яку роздільну здатність екрана використовувати @@ -1174,7 +1174,7 @@ STR_GAME_OPTIONS_RESOLUTION_OTHER :інша STR_GAME_OPTIONS_RESOLUTION_ITEM :{NUM}x{NUM} STR_GAME_OPTIONS_VIDEO_ACCELERATION :{BLACK}Апаратне прискорення -STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Увімкнутий прапорець дозволить використання грою прискорення апаратного забезпечення. Налаштування запрацює тільки після перезапуску гри +STR_GAME_OPTIONS_VIDEO_ACCELERATION_TOOLTIP :{BLACK}Позначте цей прапорець для використання апаратного прискорення. Зміни застосуються тільки після перезапуску гри STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}Налаштування запрацює тільки після перезапуску гри STR_GAME_OPTIONS_VIDEO_VSYNC :{BLACK}Вертикальна синхронізація @@ -1183,17 +1183,17 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :{BLACK}Позн STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :{BLACK}Використовуваний драйвер: {STRING} STR_GAME_OPTIONS_GUI_SCALE_FRAME :{BLACK}Розмір інтерфейсу -STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Перетягніть повзунок для встановлення розміру інтерфейсу. Ctrl+протягування для точнішого перетягування +STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :{BLACK}Потягніть повзунок для зміни розміру інтерфейсу. Ctrl+протягування для точнішого коригування STR_GAME_OPTIONS_GUI_SCALE_AUTO :{BLACK}Визначати розмір автоматично STR_GAME_OPTIONS_GUI_SCALE_AUTO_TOOLTIP :{BLACK}Позначте цей прапорець для того, щоби визначати розмір інтерфейсу автоматично -STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Межі шкали -STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :BLACK}Увімкнутий прапорець дозволить змінити розмір інтерфейсу +STR_GAME_OPTIONS_GUI_SCALE_BEVELS :{BLACK}Масштабування рельєфних елементів +STR_GAME_OPTIONS_GUI_SCALE_BEVELS_TOOLTIP :{BLACK}Позначте цей прапорець для того, щоби масштабувати рельєфні елементи інтерфейсу -STR_GAME_OPTIONS_GUI_FONT_SPRITE :{BLACK}Використовувати шрифт звичайної роздільності -STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Увімкніть прапорець для використання шрифтів незмінних розмірів +STR_GAME_OPTIONS_GUI_FONT_SPRITE :{BLACK}Використовувати стандартний растровий шрифт +STR_GAME_OPTIONS_GUI_FONT_SPRITE_TOOLTIP :{BLACK}Позначте цей прапорець для використання стандартних растрових шрифтів фіксованого розміру STR_GAME_OPTIONS_GUI_FONT_AA :{BLACK}Згладжування шрифтів -STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Увімкніть прапорець для згладження шрифтів змінних розмірів +STR_GAME_OPTIONS_GUI_FONT_AA_TOOLTIP :{BLACK}Позначте цей прапорець для того, щоби згладжувати шрифти змінних розмірів STR_GAME_OPTIONS_GUI_SCALE_1X :1x STR_GAME_OPTIONS_GUI_SCALE_2X :2x @@ -1202,7 +1202,7 @@ STR_GAME_OPTIONS_GUI_SCALE_4X :4x STR_GAME_OPTIONS_GUI_SCALE_5X :5x STR_GAME_OPTIONS_PARTICIPATE_SURVEY_FRAME :{BLACK}Автоматизований збір даних -STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Участь в автоматизованому зборі даних +STR_GAME_OPTIONS_PARTICIPATE_SURVEY :{BLACK}Брати участь в автоматизованому зборі даних STR_GAME_OPTIONS_PARTICIPATE_SURVEY_TOOLTIP :{BLACK}Якщо увімкнено, OpenTTD передаватиме зібрані дані при виході з гри STR_GAME_OPTIONS_PARTICIPATE_SURVEY_LINK :{BLACK}Про збір даних і приватність STR_GAME_OPTIONS_PARTICIPATE_SURVEY_LINK_TOOLTIP :{BLACK}Відкриє переглядач з детальнішою інформацією про автоматичний збір даних @@ -2662,7 +2662,7 @@ STR_NETWORK_ASK_RELAY_YES_ONCE :{BLACK}Так, STR_NETWORK_ASK_RELAY_YES_ALWAYS :{BLACK}Так, більше не питати STR_NETWORK_ASK_SURVEY_CAPTION :Дозволити автоматизований збір даних? -STR_NETWORK_ASK_SURVEY_TEXT :Бажаєте долучитись до автоматичного збору даних?{}OpenTTD передаватиме дані при виході з гри.{}Це можна будь-коли змінити в "Налаштуваннях гри". +STR_NETWORK_ASK_SURVEY_TEXT :Бажаєте долучитися до автоматичного збору даних?{}OpenTTD передаватиме деякі дані при виході з гри.{}Це можна змінити в розділі "Налаштування гри" будь-коли. STR_NETWORK_ASK_SURVEY_PREVIEW :Попередній перегляд збору даних STR_NETWORK_ASK_SURVEY_LINK :Про збір даних і приватність STR_NETWORK_ASK_SURVEY_NO :Ні From 4eaeccdaeb81ad2c6067bf8cef3f04b8ed37e846 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 14 Apr 2024 23:43:50 +0100 Subject: [PATCH 12/15] Codechange: Introduce FioRemove() to remove files. (#12491) New function FioRemove() handles OTTD2FS conversion, and uses std::filesystem::remove instead of unlink, all in one location. --- src/console_cmds.cpp | 2 +- src/driver.cpp | 10 ++-------- src/fileio.cpp | 17 +++++++++++++++++ src/fileio_func.h | 1 + src/fios.cpp | 3 +-- src/network/network_content.cpp | 5 +++-- src/stdafx.h | 1 - 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 8ece62b2f84..1a7460ce435 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -523,7 +523,7 @@ DEF_CONSOLE_CMD(ConRemove) _console_file_list_savegame.ValidateFileList(); const FiosItem *item = _console_file_list_savegame.FindItem(file); if (item != nullptr) { - if (unlink(item->name.c_str()) != 0) { + if (!FioRemove(item->name)) { IConsolePrint(CC_ERROR, "Failed to delete '{}'.", item->name); } } else { diff --git a/src/driver.cpp b/src/driver.cpp index 630a974fd41..26815874a07 100644 --- a/src/driver.cpp +++ b/src/driver.cpp @@ -19,12 +19,6 @@ #include "fileio_func.h" #include -#ifdef _WIN32 -# include -#else -# include -#endif /* _WIN32 */ - #include "safeguards.h" std::string _ini_videodriver; ///< The video driver a stored in the configuration file. @@ -129,7 +123,7 @@ bool DriverFactoryBase::SelectDriverImpl(const std::string &name, Driver::Type t * hardware acceleration. */ auto filename = FioFindFullPath(BASE_DIR, HWACCELERATION_TEST_FILE); if (!filename.empty()) { - unlink(filename.c_str()); + FioRemove(filename); Debug(driver, 1, "Probing {} driver '{}' skipped due to earlier crash", GetDriverTypeName(type), d->name); @@ -216,7 +210,7 @@ void DriverFactoryBase::MarkVideoDriverOperational() * and as we are operational now, remove the hardware acceleration * test-file. */ auto filename = FioFindFullPath(BASE_DIR, HWACCELERATION_TEST_FILE); - if (!filename.empty()) unlink(filename.c_str()); + if (!filename.empty()) FioRemove(filename); } /** diff --git a/src/fileio.cpp b/src/fileio.cpp index e2c72815139..79f16392ab1 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -368,6 +368,23 @@ void FioCreateDirectory(const std::string &name) #endif } +/** + * Remove a file. + * @param filename Filename to remove. + * @return true iff the file was removed. + */ +bool FioRemove(const std::string &filename) +{ + std::filesystem::path path = OTTD2FS(filename); + std::error_code error_code; + std::filesystem::remove(path, error_code); + if (error_code) { + Debug(misc, 0, "Removing {} failed: {}", filename, error_code.message()); + return false; + } + return true; +} + /** * Appends, if necessary, the path separator character to the end of the string. * It does not add the path separator to zero-sized strings. diff --git a/src/fileio_func.h b/src/fileio_func.h index 6f9bd65442c..2a13a454d40 100644 --- a/src/fileio_func.h +++ b/src/fileio_func.h @@ -20,6 +20,7 @@ std::string FioFindFullPath(Subdirectory subdir, const std::string &filename); std::string FioGetDirectory(Searchpath sp, Subdirectory subdir); std::string FioFindDirectory(Subdirectory subdir); void FioCreateDirectory(const std::string &name); +bool FioRemove(const std::string &filename); const char *FiosGetScreenshotDir(); diff --git a/src/fios.cpp b/src/fios.cpp index ec1f3de3b2a..c020560ecb6 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -246,8 +246,7 @@ std::string FiosMakeHeightmapName(const char *name) */ bool FiosDelete(const char *name) { - std::string filename = FiosMakeSavegameName(name); - return unlink(filename.c_str()) == 0; + return FioRemove(FiosMakeSavegameName(name)); } typedef std::tuple FiosGetTypeAndNameProc(SaveLoadOperation fop, const std::string &filename, const std::string_view ext); diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 94f6362fde2..27bd3ce7309 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -13,6 +13,7 @@ #include "../game/game.hpp" #include "../window_func.h" #include "../error.h" +#include "../fileio_func.h" #include "../base_media_base.h" #include "../settings_type.h" #include "network_content.h" @@ -550,7 +551,7 @@ void ClientNetworkContentSocketHandler::AfterDownload() this->curFile = nullptr; if (GunzipFile(this->curInfo)) { - unlink(GetFullFilename(this->curInfo, true).c_str()); + FioRemove(GetFullFilename(this->curInfo, true)); Subdirectory sd = GetContentInfoSubDir(this->curInfo->type); if (sd == NO_DIRECTORY) NOT_REACHED(); @@ -562,7 +563,7 @@ void ClientNetworkContentSocketHandler::AfterDownload() if (this->curInfo->type == CONTENT_TYPE_BASE_MUSIC) { /* Music can't be in a tar. So extract the tar! */ ExtractTar(fname, BASESET_DIR); - unlink(fname.c_str()); + FioRemove(fname); } #ifdef __EMSCRIPTEN__ diff --git a/src/stdafx.h b/src/stdafx.h index 7f598de39eb..3297c3eec2e 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -169,7 +169,6 @@ # include # define fopen(file, mode) _wfopen(OTTD2FS(file).c_str(), _T(mode)) -# define unlink(file) _wunlink(OTTD2FS(file).c_str()) std::string FS2OTTD(const std::wstring &name); std::wstring OTTD2FS(const std::string &name); From 839f486074a0666bcba9c3be483fc1dd030abfae Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 14 Apr 2024 23:57:26 +0100 Subject: [PATCH 13/15] Codechange: Use directory_iterator to find language files. (#12495) This avoids using custom ttd_opendir, along with C-style string comparisons against file names. --- src/strings.cpp | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/src/strings.cpp b/src/strings.cpp index 7ee8497cd55..16f7f6e77c5 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -2050,9 +2050,9 @@ const LanguageMetadata *GetLanguage(uint8_t newgrflangid) * @param hdr the place to write the header information to * @return true if and only if the language file is of a compatible version */ -static bool GetLanguageFileHeader(const char *file, LanguagePackHeader *hdr) +static bool GetLanguageFileHeader(const std::string &file, LanguagePackHeader *hdr) { - FILE *f = fopen(file, "rb"); + FILE *f = fopen(file.c_str(), "rb"); if (f == nullptr) return false; size_t read = fread(hdr, sizeof(*hdr), 1, f); @@ -2074,29 +2074,25 @@ static bool GetLanguageFileHeader(const char *file, LanguagePackHeader *hdr) */ static void FillLanguageList(const std::string &path) { - DIR *dir = ttd_opendir(path.c_str()); - if (dir != nullptr) { - struct dirent *dirent; - while ((dirent = readdir(dir)) != nullptr) { - std::string d_name = FS2OTTD(dirent->d_name); - const char *extension = strrchr(d_name.c_str(), '.'); - - /* Not a language file */ - if (extension == nullptr || strcmp(extension, ".lng") != 0) continue; - - LanguageMetadata lmd; - lmd.file = path + d_name; - - /* Check whether the file is of the correct version */ - if (!GetLanguageFileHeader(lmd.file.string().c_str(), &lmd)) { - Debug(misc, 3, "{} is not a valid language file", lmd.file); - } else if (GetLanguage(lmd.newgrflangid) != nullptr) { - Debug(misc, 3, "{}'s language ID is already known", lmd.file); - } else { - _languages.push_back(lmd); - } + std::error_code error_code; + for (const auto &dir_entry : std::filesystem::directory_iterator(OTTD2FS(path), error_code)) { + if (!dir_entry.is_regular_file()) continue; + if (dir_entry.path().extension() != ".lng") continue; + + LanguageMetadata lmd; + lmd.file = FS2OTTD(dir_entry.path()); + + /* Check whether the file is of the correct version */ + if (!GetLanguageFileHeader(lmd.file.string(), &lmd)) { + Debug(misc, 3, "{} is not a valid language file", lmd.file); + } else if (GetLanguage(lmd.newgrflangid) != nullptr) { + Debug(misc, 3, "{}'s language ID is already known", lmd.file); + } else { + _languages.push_back(lmd); } - closedir(dir); + } + if (error_code) { + Debug(misc, 9, "Unable to open directory {}: {}", path, error_code.message()); } } From cd108fd9e437946a88c89e33c10b06c14c86a043 Mon Sep 17 00:00:00 2001 From: translators Date: Mon, 15 Apr 2024 04:44:34 +0000 Subject: [PATCH 14/15] Update: Translations from eints greek: 10 changes by gh658804 --- src/lang/greek.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/lang/greek.txt b/src/lang/greek.txt index dbd625b4804..f14aadb2892 100644 --- a/src/lang/greek.txt +++ b/src/lang/greek.txt @@ -1293,7 +1293,7 @@ STR_TERRAIN_TYPE_CUSTOM :Προσαρμ STR_TERRAIN_TYPE_CUSTOM_VALUE :Προσαρμοσμένο ύψος ({NUM}) ###length 4 -STR_CITY_APPROVAL_LENIENT :Ήπειο +STR_CITY_APPROVAL_LENIENT :Ήπια STR_CITY_APPROVAL_TOLERANT :Υπομονετική STR_CITY_APPROVAL_HOSTILE :Εχθρική STR_CITY_APPROVAL_PERMISSIVE :Ανεκτική (χωρίς επίδραση σε ενέργειες της εταιρίας) @@ -1381,8 +1381,8 @@ STR_CONFIG_SETTING_RUNNING_COSTS_HELPTEXT :Θέτει το STR_CONFIG_SETTING_CONSTRUCTION_SPEED :Ταχύτητα οικοδόμησης: {STRING} STR_CONFIG_SETTING_CONSTRUCTION_SPEED_HELPTEXT :Περιορίζει το ποσοστό των οικοδομήμσεων από τα ΑΙ -STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS :Καταρρεύσεις οχημάτων: {STRING} -STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Ελέγχει πόσο συχνά καταρρέουν τα ανεπαρκώς συντηρημένα οχήματα +STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS :Βλάβες οχημάτων: {STRING} +STR_CONFIG_SETTING_VEHICLE_BREAKDOWNS_HELPTEXT :Ελέγχει πόσο συχνά τα ανεπαρκώς συντηρημένα οχήματα παθαίνουν βλάβες STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER :Πολλαπλασιαστής επιδότησης: {STRING} STR_CONFIG_SETTING_SUBSIDY_MULTIPLIER_HELPTEXT :Θέστε πόσο ξεπληρώνεται για επιδοτημένες συνδέσεις @@ -1540,7 +1540,7 @@ STR_CONFIG_SETTING_PLANE_SPEED :Παράγον STR_CONFIG_SETTING_PLANE_SPEED_HELPTEXT :Ορίζεται η σχετική ταχύτητα των αεροπλάνων συγκριτικά με τους άλλους τύπους οχημάτων, ώστε να μειώνεται το ποσό του εισοδήματος από μεταφορές με αεροσκάφη STR_CONFIG_SETTING_PLANE_SPEED_VALUE :1 / {COMMA} -STR_CONFIG_SETTING_PLANE_CRASHES :Αριθμός των αεροπορικών ατυχημάτων: {STRING} +STR_CONFIG_SETTING_PLANE_CRASHES :Αριθμός αεροπορικών ατυχημάτων: {STRING} STR_CONFIG_SETTING_PLANE_CRASHES_HELPTEXT :Ορίστε την πιθανότητα συντριβής ενός τυχαίου αεροσκάφους.{}* Μεγάλα αεροσκάφη πάντα έχουν ένα ρίσκο συντριβής όταν προσγειώνονται σε μικρά αεροδρόμια. ###length 3 STR_CONFIG_SETTING_PLANE_CRASHES_NONE :Κανένα* @@ -1669,10 +1669,10 @@ STR_CONFIG_SETTING_DESERT_COVERAGE_VALUE :{NUM}% STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN :Ανωμαλία επιφάνειας (μόνο με TerraGenesis) : {STRING} STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_HELPTEXT :Επιλογή του σχήματος και του αριθμού των λόφων: Τα λεία τοπία έχουν λιγότερους, πιο πλατείς λόφους, ενώ τα τραχιά τοπία έχουν πολλούς και μικρούς λόφους ###length 4 -STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :Πολύ Απαλή -STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH :Απαλή -STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH :Ανώμαλη -STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH :Πολύ Ανώμαλη +STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH :Πολύ Λεία +STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH :Λεία +STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH :Τραχιά +STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH :Πολύ Τραχιά STR_CONFIG_SETTING_VARIETY :Διανομή ποικιλομορφίας: {STRING} STR_CONFIG_SETTING_VARIETY_HELPTEXT :Επιλέξτε αν ο χάρτης περιέχει και βουνά και επίπεδες περιοχές. Όσο μεγαλύτερη είναι η ποικιλία, τόσο περισσότερες οι υψομετρικές διαφορές μεταξύ ορεινών και επίπεδων περιοχών @@ -1928,7 +1928,7 @@ STR_CONFIG_SETTING_SERVINT_VALUE :{COMMA}{NBSP}Η ###setting-zero-is-special STR_CONFIG_SETTING_SERVINT_DISABLED :Απενεργοποιημένο -STR_CONFIG_SETTING_NOSERVICE :Απενεργοποίηση επισκευών όταν οι καταρρεύσεις είναι απενεργοποιημένες: {STRING} +STR_CONFIG_SETTING_NOSERVICE :Απενεργοποίηση επισκευών όταν οι βλάβες είναι απενεργοποιημένες: {STRING} STR_CONFIG_SETTING_NOSERVICE_HELPTEXT :Όταν είναι ενεργοποιημένη, τα οχήματα δεν συντηρούνται όταν δεν είναι δυνατό να χαλάσουν STR_CONFIG_SETTING_STATION_LENGTH_LOADING_PENALTY :Ποινή ταχύτητας φόρτωσης για τρένα που είναι μεγαλύτερα από τον σταθμό: {STRING} @@ -4541,7 +4541,7 @@ STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR :{BLACK}Κέρδ STR_VEHICLE_INFO_PROFIT_THIS_YEAR_LAST_YEAR_MIN_PERFORMANCE :{BLACK}Φετινό κέρδος: {LTBLUE}{CURRENCY_LONG} (Περσινό: {CURRENCY_LONG}) {BLACK}Ελάχιστη απόδοση: {LTBLUE}{POWER_TO_WEIGHT} STR_VEHICLE_INFO_PROFIT_THIS_PERIOD_LAST_PERIOD :{BLACK}Κέρδος αυτή την περίοδο: {LTBLUE}{CURRENCY_LONG} (τελευταία περίοδο: {CURRENCY_LONG}) STR_VEHICLE_INFO_PROFIT_THIS_PERIOD_LAST_PERIOD_MIN_PERFORMANCE :{BLACK}Κέρδος αυτή την περίοδο: {LTBLUE}{CURRENCY_LONG} (τελευταία περίοδο: {CURRENCY_LONG}) {BLACK}Ελάχ. απόδοση: {LTBLUE}{POWER_TO_WEIGHT} -STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Αξιοπιστία: {LTBLUE}{COMMA}% {BLACK}Καταρρεύσεις μετά από την τελευταία επισκευή: {LTBLUE}{COMMA} +STR_VEHICLE_INFO_RELIABILITY_BREAKDOWNS :{BLACK}Αξιοπιστία: {LTBLUE}{COMMA}% {BLACK}Βλάβες μετά από την τελευταία επισκευή: {LTBLUE}{COMMA} STR_VEHICLE_INFO_BUILT_VALUE :{LTBLUE}{ENGINE} {BLACK}Κατασκευή: {LTBLUE}{NUM}{BLACK} Αξία: {LTBLUE}{CURRENCY_LONG} STR_VEHICLE_INFO_NO_CAPACITY :{BLACK}Χωρητικότητα: {LTBLUE}Τίποτα{STRING} From f5a50a874f5d074ddb0644eb4e8b5e9b029adf08 Mon Sep 17 00:00:00 2001 From: dP Date: Mon, 15 Apr 2024 17:40:50 +0700 Subject: [PATCH 15/15] Codechange: Update doxygen comment to reflect removed parameter (#12499) --- src/strings.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/strings.cpp b/src/strings.cpp index 16f7f6e77c5..02c57d362bc 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -388,7 +388,6 @@ static const char *GetDecimalSeparator() * Format a number into a string. * @param builder the string builder to write to * @param number the number to write down - * @param last the last element in the buffer * @param separator the thousands-separator to use */ static void FormatNumber(StringBuilder &builder, int64_t number, const char *separator)