Skip to content

02. Preparing your Project

tetherscript edited this page Jan 31, 2025 · 12 revisions

In the Translator project folder, you will find a \Target folder. This contains the things that need to be copied over to the Target project. This must be done before you do your first Translator Scan and Translate.

  1. Copy the \Target\TranslatorTLocalized.cs file to the target project, or link to it.
  2. Copy the entire '\Target\Translator' folder to the target project. This folder will hold translation info unique to that target project. Do not include this folder and its files in target project builds or publishing (build action = none, do not copy) as it is not needed by a deployed app.

\Translator Contents

  • Cache.json
    Caches translations to save translation costs/latency. Translating will add items to the cache. It won't update existing items. The translated .resw files (non us-EN) are rebuilt from this cache. You can edit this file if you need to adjust a translation manually or clear the cache. Your edits will persist.

  • Hints.json
    Defines the prompts sent to the translator (OpenAI API in this case). Edit this in the Hints tab.

  • Resources.resw
    A blank (no data entries) resource file. Don't edit this blank file. You'll be copying this blank file initially to the /Strings/???/ folders in your target project (??? = en-US or de-DE). When you add a new language, create a new folder and add this blank file.

  • Specials.json
    Contains non-translatable items like icons, colors, and things that may need to change for some cultures. These are not translated and are added to the necessary Resources.Resw files when you translate. You can edit this file.

  • DetectedXamlElements.json
    When you do a scan, info about all detected XAML element types defined in XamlElements.json will be added here. This is informational only and is not used by Translator once the scan is complete. It is useful for viewing/troubleshooting when an element is not translated. If it isn't in this file, then the scanner did not pick it up.

  • TLocalizedGets.json
    When you use the included static class TLocalized.Get() with the debugger attached, an entry is created in this file for each unique .Get(). When you do a scan, the detected .xaml element info will be merged with these .Get()'s to produce the \Strings\en-US\Resources.resw file. You can edit this file but should not need to.

  • XamlElements.json
    These are the XAML elements and properties that can be detected when scanned. If it isn't on this list, scanning won't find it. You must edit this file.

Summary

You need to create a /Translator folder in the target project and add these files to it.

Clone this wiki locally