-
Notifications
You must be signed in to change notification settings - Fork 0
02. Preparing your Project
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.
Tip
Look at the sample apps and examine their \Translator, \Strings and TLocalized.cs.
- Copy the
\Target\TranslatorTLocalized.cs
file to the target project, or link to it. - In your project, create
\Strings\en-US\
and copy theTranslator\Resources.resw
file into it. Create folders for each language you want to translate. - 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. You may edit theCache.json
,XamlElements.json
,TTF_*.json
andSpecials.json
. All other files are managed by the Translator app, so don't edit them.
-
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 (nonus-EN
) are rebuilt from this cache. You can edit this file with the Translator Cache Editor. Your edits will persist. -
DetectedXamlElements.json
When you do a scan, all detected XAML 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. -
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
orde-DE
). When you add a new language, create a new folder and add this 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 theResources.Resw
files when you scan and translate. You can edit this file. -
TLocalizedGets.json
When you use the included static classTLocalized.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. -
TTF_OpenAI_1.json
Defines the prompts sent to the OpenAI_1 Translation Function. You can edit this file. -
other TTF_*.json files
Each Translation Function has one of these files. You only need the ones for the Translation Function you want to use for translation. -
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 can, and will be editing this file.