TNTC 25.3.56593

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global TNTC --version 25.3.56593
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local TNTC --version 25.3.56593
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=TNTC&version=25.3.56593
                    
nuke :add-package TNTC --version 25.3.56593
                    

TNTC - The .NET Translation Tool

TNTC is a command-line tool designed to help manage translations in .NET projects. It extracts strings from source code, manages translations across multiple languages, and provides a structured workflow for handling localization. It is loosely inspired by the original TNT project, but fully implemented in C# and supporting LLM-based translations via an OpenAI integration.

Features

  • String Extraction: Automatically extracts translatable strings from C# source code
  • Multi-language Support: Handles translations for multiple languages including:
    • Chinese
    • German
    • French
    • Spanish
    • Italian
    • Portuguese
  • Translation State Management: Tracks the state of translations (New, NeedsReview, NeedsReviewTranslation, Translated, Final)
  • JSON-based Storage: Stores translations in a structured JSON format
  • Source Location Tracking: Keeps track of where translated strings are used in the codebase

Installation

The tool requires .NET 9.0 or later. To build the project:

dotnet build

Usage

TNTc provides several commands:

Extract Command

tntc extract <projectFolder>

Extracts all strings from source files and updates translations. The tool will look for any folder with a .tnt folder as a project to be translated.

Note: This command requires an OpenAI API key to be set in the environment variable OPENAI_API_KEY for automatic translation functionality.

# Example with API key
export OPENAI_API_KEY='your-api-key-here'
tntc extract <projectFolder>

Upgrade from TNT Command

tntc upgrade-from-tnt <projectFolder>

Upgrades existing TNT translations to the new JSON format. This is useful when migrating from an older version of the tool.

Project Structure

Project Structure

  • .tnt/: Configuration directory for translation settings
    • translation-{language}.json: Translation files for each supported language
    • extra-sources.json: Configuration for additional source directories
  • .tnt-content/: Directory containing the final translation files used by the application
    • Contains the processed and finalized translations ready for use
  • Source files are scanned for translatable strings using the Roslyn compiler platform
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
25.3.56810 137 3/18/2025
25.3.56597 162 3/10/2025
25.3.56595 147 3/10/2025
25.3.56593 160 3/10/2025
25.3.56592 158 3/10/2025
25.3.56590 152 3/10/2025
25.3.56589 159 3/10/2025