From e5324e305354a27bd1367530e945df259559df6d Mon Sep 17 00:00:00 2001
From: Myk Taylor <myk002@yahoo.com>
Date: Thu, 3 Oct 2024 04:01:46 -0700
Subject: [PATCH] default inEnglish to false to match Lua API

---
 docs/dev/Lua API.rst                                  | 2 +-
 library/include/modules/Translation.h                 | 2 +-
 library/modules/Items.cpp                             | 4 ++--
 library/modules/Units.cpp                             | 6 +++---
 plugins/autoslab.cpp                                  | 2 +-
 plugins/cleanowned.cpp                                | 2 +-
 plugins/remotefortressreader/remotefortressreader.cpp | 2 +-
 plugins/showmood.cpp                                  | 2 +-
 plugins/strangemood.cpp                               | 2 +-
 plugins/tailor.cpp                                    | 6 +++---
 10 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst
index 1bf0b40192..1d874c3315 100644
--- a/docs/dev/Lua API.rst	
+++ b/docs/dev/Lua API.rst	
@@ -947,7 +947,7 @@ can be omitted.
 
 * ``dfhack.TranslateName(name[,in_english[,only_last_name]])``
 
-  Convert a language_name or only the last name part to string.
+  Convert a ``df.language_name`` (or only the last name part) to string.
 
 * ``dfhack.df2utf(string)``
 
diff --git a/library/include/modules/Translation.h b/library/include/modules/Translation.h
index 9f8dacc3c7..8de74e71d7 100644
--- a/library/include/modules/Translation.h
+++ b/library/include/modules/Translation.h
@@ -56,7 +56,7 @@ DFHACK_EXPORT void setNickname(df::language_name *name, std::string nick);
 DFHACK_EXPORT std::string capitalize(const std::string &str, bool all_words = false);
 
 // translate a name using the loaded dictionaries
-DFHACK_EXPORT std::string TranslateName (const df::language_name * name, bool inEnglish = true,
+DFHACK_EXPORT std::string TranslateName (const df::language_name * name, bool inEnglish = false,
                                          bool onlyLastPart = false);
 }
 }
diff --git a/library/modules/Items.cpp b/library/modules/Items.cpp
index e87dcdab1b..fdafcb74ea 100644
--- a/library/modules/Items.cpp
+++ b/library/modules/Items.cpp
@@ -709,8 +709,8 @@ static string get_base_desc(df::item *item) {
     if (auto name = Items::getBookTitle(item); !name.empty())
         return name;
     if (auto artifact = get_artifact(item); artifact && artifact->name.has_name)
-        return Translation::TranslateName(&artifact->name, false) +
-            ", " + Translation::TranslateName(&artifact->name) +
+        return Translation::TranslateName(&artifact->name) +
+            ", " + Translation::TranslateName(&artifact->name, true) +
             " (" + get_item_type_str(item) + ")";
     return Items::getDescription(item, 0, true);
 }
diff --git a/library/modules/Units.cpp b/library/modules/Units.cpp
index fc38bc2f34..8db7c9d525 100644
--- a/library/modules/Units.cpp
+++ b/library/modules/Units.cpp
@@ -1131,7 +1131,7 @@ string Units::getReadableName(df::historical_figure *hf) {
             prof_name = "Ghostly " + prof_name;
     }
 
-    string name = Translation::TranslateName(getVisibleName(hf), false);
+    string name = Translation::TranslateName(getVisibleName(hf));
     return name.empty() ? prof_name : name + ", " + prof_name;
 }
 
@@ -1154,7 +1154,7 @@ string Units::getReadableName(df::unit *unit) {
     if (isTame(unit))
         prof_name += " (" + getTameTag(unit) + ")";
 
-    string name = Translation::TranslateName(getVisibleName(unit), false);
+    string name = Translation::TranslateName(getVisibleName(unit));
     return name.empty() ? prof_name : name + ", " + prof_name;
 }
 
@@ -1676,7 +1676,7 @@ static string get_land_title(Units::NoblePosition *np)
         if (site_link->flags.bits.land_for_holding && site_link->position_profile_id == np->assignment->id)
         {
             auto site = df::world_site::find(site_link->target);
-            return site ? " of " + Translation::TranslateName(&site->name) : "";
+            return site ? " of " + Translation::TranslateName(&site->name, true) : "";
         }
     return "";
 }
diff --git a/plugins/autoslab.cpp b/plugins/autoslab.cpp
index 3de30be7e9..52d2de179a 100644
--- a/plugins/autoslab.cpp
+++ b/plugins/autoslab.cpp
@@ -174,7 +174,7 @@ static void checkslabs(color_ostream &out)
             )
         {
             createSlabJob(ghost);
-            auto fullName = Translation::TranslateName(&ghost->name, false);
+            auto fullName = Translation::TranslateName(&ghost->name);
             out.print("Added slab order for ghost %s\n", fullName.c_str());
         }
     }
diff --git a/plugins/cleanowned.cpp b/plugins/cleanowned.cpp
index b8881d46b8..fb62ad9701 100644
--- a/plugins/cleanowned.cpp
+++ b/plugins/cleanowned.cpp
@@ -168,7 +168,7 @@ command_result df_cleanowned (color_ostream &out, vector <string> & parameters)
             df::unit *owner = Items::getOwner(item);
 
             if (owner)
-                out.print(", owner %s", DF2CONSOLE(Translation::TranslateName(&owner->name,false)).c_str());
+                out.print(", owner %s", DF2CONSOLE(Translation::TranslateName(&owner->name)).c_str());
 
             if (!dry_run)
             {
diff --git a/plugins/remotefortressreader/remotefortressreader.cpp b/plugins/remotefortressreader/remotefortressreader.cpp
index aa68c9e8d9..701e18d9b4 100644
--- a/plugins/remotefortressreader/remotefortressreader.cpp
+++ b/plugins/remotefortressreader/remotefortressreader.cpp
@@ -1697,7 +1697,7 @@ static command_result GetUnitListInside(color_ostream &stream, const BlockReques
         size_info->set_length_base(unit->body.size_info.length_base);
         if (unit->name.has_name)
         {
-            send_unit->set_name(DF2UTF(Translation::TranslateName(Units::getVisibleName(unit))));
+            send_unit->set_name(DF2UTF(Translation::TranslateName(Units::getVisibleName(unit), true)));
         }
 
         auto appearance = send_unit->mutable_appearance();
diff --git a/plugins/showmood.cpp b/plugins/showmood.cpp
index 51578a8226..06ee9ace37 100644
--- a/plugins/showmood.cpp
+++ b/plugins/showmood.cpp
@@ -69,7 +69,7 @@ command_result df_showmood (color_ostream &out, vector <string> & parameters)
             out.printerr("Dwarf with strange mood does not have a mood type!\n");
             continue;
         }
-        out.print("%s is currently ", DF2CONSOLE(out, Translation::TranslateName(&unit->name, false)).c_str());
+        out.print("%s is currently ", DF2CONSOLE(out, Translation::TranslateName(&unit->name)).c_str());
         switch (unit->mood)
         {
         case mood_type::Macabre:
diff --git a/plugins/strangemood.cpp b/plugins/strangemood.cpp
index 4ed37944ce..2dd5f52bb3 100644
--- a/plugins/strangemood.cpp
+++ b/plugins/strangemood.cpp
@@ -548,7 +548,7 @@ command_result df_strangemood (color_ostream &out, vector <string> & parameters)
     if (unit->job.current_job)
     {
         // TODO: cancel job
-        out.printerr("Chosen unit '%s' has active job, cannot start mood!\n", Translation::TranslateName(&unit->name, false).c_str());
+        out.printerr("Chosen unit '%s' has active job, cannot start mood!\n", Translation::TranslateName(&unit->name).c_str());
         return CR_FAILURE;
     }
 
diff --git a/plugins/tailor.cpp b/plugins/tailor.cpp
index 5b746333ce..57b1f58cbd 100644
--- a/plugins/tailor.cpp
+++ b/plugins/tailor.cpp
@@ -313,7 +313,7 @@ class Tailor {
                     {
                         DEBUG(cycle).print ("tailor: %s (size %d) worn by %s (size %d) needs replacement\n",
                                             DF2CONSOLE(description).c_str(), isize,
-                                            DF2CONSOLE(Translation::TranslateName(&u->name, false)).c_str(), usize);
+                                            DF2CONSOLE(Translation::TranslateName(&u->name)).c_str(), usize);
                         needed[std::make_pair(ty, usize)] += 1;
                         ordered.insert(ty);
                     }
@@ -329,7 +329,7 @@ class Tailor {
                             "tailor: %s %s from %s.\n",
                             (confiscated ? "confiscated" : "could not confiscate"),
                             DF2CONSOLE(description).c_str(),
-                            DF2CONSOLE(Translation::TranslateName(&u->name, false)).c_str()
+                            DF2CONSOLE(Translation::TranslateName(&u->name)).c_str()
                         );
                     }
 
@@ -346,7 +346,7 @@ class Tailor {
                     TRACE(cycle).print("tailor: one %s of size %d needed to cover %s\n",
                         ENUM_KEY_STR(item_type, ty).c_str(),
                         usize,
-                        DF2CONSOLE(Translation::TranslateName(&u->name, false)).c_str());
+                        DF2CONSOLE(Translation::TranslateName(&u->name)).c_str());
                     needed[std::make_pair(ty, usize)] += 1;
                 }
             }