<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: xleonmoon-eng</title>
    <description>The latest articles on DEV Community by xleonmoon-eng (@xleonmoon).</description>
    <link>https://dev.to/xleonmoon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4286084%2Fa194cddf-cd79-4cf4-b6da-b1fbcea5b9cd.png</url>
      <title>DEV Community: xleonmoon-eng</title>
      <link>https://dev.to/xleonmoon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xleonmoon"/>
    <language>en</language>
    <item>
      <title>Unity localization: pulling every string out of scripts, prefabs, scenes and assets into one translation-ready CSV</title>
      <dc:creator>xleonmoon-eng</dc:creator>
      <pubDate>Sun, 06 Dec 2026 09:49:14 +0000</pubDate>
      <link>https://dev.to/xleonmoon/unity-localization-pulling-every-string-out-of-scripts-prefabs-scenes-and-assets-into-one-7bj</link>
      <guid>https://dev.to/xleonmoon/unity-localization-pulling-every-string-out-of-scripts-prefabs-scenes-and-assets-into-one-7bj</guid>
      <description>&lt;p&gt;Localizing a Unity project is usually described as a translation problem. In practice, a big part of it is an extraction problem: before a translator can touch anything, every string has to be found, and in most projects it is scattered everywhere.&lt;/p&gt;

&lt;p&gt;Strings live in at least four places:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.cs&lt;/code&gt; scripts — &lt;code&gt;label.text = "Game Over";&lt;/code&gt;, including interpolated strings like &lt;code&gt;$"{name} earned {coins} coins!"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.prefab&lt;/code&gt; files — serialized text fields such as &lt;code&gt;m_Text: Play&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.unity&lt;/code&gt; scenes — &lt;code&gt;m_Caption: Continue?&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.asset&lt;/code&gt; files used by ScriptableObjects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Miss one of these and the translated build ships with a line of English still in it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What has to be extracted, not just searched
&lt;/h2&gt;

&lt;p&gt;A localization pass is only as good as its coverage. What actually needs to come out of the project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;C# string literals&lt;/strong&gt;, normal and interpolated. Real parsing matters here: &lt;code&gt;$"{name} earned {coins} coins!"&lt;/code&gt; must come out as &lt;code&gt;{name} earned {coins} coins!&lt;/code&gt;, with placeholders intact for the translator.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Serialized text fields&lt;/strong&gt; inside prefabs, scenes and assets: &lt;code&gt;m_Text&lt;/code&gt;, &lt;code&gt;m_text&lt;/code&gt;, &lt;code&gt;m_Caption&lt;/code&gt;, &lt;code&gt;m_Title&lt;/code&gt;, &lt;code&gt;m_Description&lt;/code&gt;, &lt;code&gt;m_Name&lt;/code&gt;, &lt;code&gt;m_Label&lt;/code&gt;, &lt;code&gt;m_Content&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Escaped text restored&lt;/strong&gt; — &lt;code&gt;"\u4F60\u597D"&lt;/code&gt; becomes 你好, &lt;code&gt;\n&lt;/code&gt; becomes a real newline. Translators should never see escape sequences.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Duplicates grouped, with locations&lt;/strong&gt; — the same &lt;code&gt;"Back"&lt;/code&gt; may appear 40 times; you need every file and line, or you fix one and miss 39.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Junk excluded&lt;/strong&gt; — &lt;code&gt;Debug.Log&lt;/code&gt; / &lt;code&gt;LogWarning&lt;/code&gt; / &lt;code&gt;LogError&lt;/code&gt;, &lt;code&gt;print&lt;/code&gt;, &lt;code&gt;PlayerPrefs.*&lt;/code&gt;, &lt;code&gt;Resources.Load&lt;/code&gt;, &lt;code&gt;GameObject.Find&lt;/code&gt;, &lt;code&gt;FindObjectOfType(s)&lt;/code&gt;, comments and attributes. None of that belongs in a translation file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you do it by hand, that is roughly an afternoon per project, redone every time the game grows. Regex makes it worse: it mangles interpolated strings and happily returns comments and log calls.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;I wrote a small Windows tool that runs outside the Editor and does the whole pass: it reads the folder you point it at, parses C# with Roslyn (real syntax tree, not regex), reads the serialized text fields, restores escaped text, de-duplicates, and records the file and line for every string.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvhi984a748h7t517o9o2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvhi984a748h7t517o9o2.png" alt="Unity Text Extractor main window" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is also a &lt;strong&gt;lossless mode&lt;/strong&gt;: if you would rather collect everything and filter manually, it keeps every candidate instead of applying the junk filters.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8dutdjdi07kub2h6jvhy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8dutdjdi07kub2h6jvhy.png" alt="Selecting the project folder" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The output is one CSV — &lt;code&gt;Key, Id, Text, Path, Line, Type&lt;/code&gt; — that imports into I2 Localization, or opens in Excel / Google Sheets and goes straight to a translator.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0ahfw3bh5xn90uqexap0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0ahfw3bh5xn90uqexap0.png" alt="Extracted strings table" width="800" height="560"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxdklbr65ztano3y3g01i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxdklbr65ztano3y3g01i.png" alt="Exporting the results to CSV" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's here: &lt;strong&gt;&lt;a href="https://unitytextextractor.tech" rel="noopener noreferrer"&gt;https://unitytextextractor.tech&lt;/a&gt;&lt;/strong&gt; — free to try, 10,000 characters on sign-up. I'm the developer, so if it misses a string or picks up junk in your project, tell me and I'll fix it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you hand files to a translator
&lt;/h2&gt;

&lt;p&gt;A quick checklist that has saved me more than once:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;every &lt;code&gt;.cs&lt;/code&gt;, &lt;code&gt;.prefab&lt;/code&gt;, &lt;code&gt;.unity&lt;/code&gt;, &lt;code&gt;.asset&lt;/code&gt; under the project folder covered&lt;/li&gt;
&lt;li&gt;interpolated strings intact, placeholders not broken&lt;/li&gt;
&lt;li&gt;escaped characters readable&lt;/li&gt;
&lt;li&gt;duplicates de-duplicated but all locations kept&lt;/li&gt;
&lt;li&gt;one file the translator can actually open&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>unity3d</category>
      <category>gamedev</category>
      <category>localization</category>
      <category>indiedev</category>
    </item>
  </channel>
</rss>
