Emd.Pacx.Plugins.AITranslator
1.0.1
This package version contains known bugs that have been fixed in the latest version. Please upgrade to the newest stable release.
See the version list below for details.
dotnet add package Emd.Pacx.Plugins.AITranslator --version 1.0.1
NuGet\Install-Package Emd.Pacx.Plugins.AITranslator -Version 1.0.1
<PackageReference Include="Emd.Pacx.Plugins.AITranslator" Version="1.0.1" />
<PackageVersion Include="Emd.Pacx.Plugins.AITranslator" Version="1.0.1" />
<PackageReference Include="Emd.Pacx.Plugins.AITranslator" />
paket add Emd.Pacx.Plugins.AITranslator --version 1.0.1
#r "nuget: Emd.Pacx.Plugins.AITranslator, 1.0.1"
#:package Emd.Pacx.Plugins.AITranslator@1.0.1
#addin nuget:?package=Emd.Pacx.Plugins.AITranslator&version=1.0.1
#tool nuget:?package=Emd.Pacx.Plugins.AITranslator&version=1.0.1
Emd.Pacx.Plugins.AITranslator ๐
Emd.Pacx.Plugins.AITranslator is a plugin for PACX that uses Azure OpenAI to automatically translate localized labels in Microsoft Dynamics 365 / Power Apps environments.
Table of Contents
- Installation โ๏ธ
- Available Commands ๐
- Attribute Translation Constants File ๐
- Example Workflow ๐ฅ
- Requirements ๐
- License ๐
Installation โ๏ธ
Make sure you have PACX installed on your system.
Install the AI Translator plugin with:
pacx plugin install -n Emd.Pacx.Plugins.AITranslator
Available Commands ๐
1. Manage Azure OpenAI Connections
Use connections to securely store your Azure OpenAI endpoints and keys.
pacx ai-translator conn [create] [delete] [list]
- create: Create and store a new Azure OpenAI connection.
- delete: Delete an existing Azure OpenAI connection by name.
- list: List all stored Azure OpenAI connections.
Create Connection
pacx ai-translator conn create --name <connection-name> --deploymentEndpoint <endpoint-url> --apiKey <api-key>
--name (-n)
: [required] The connection name.--deploymentEndpoint (-de)
: [required] Azure OpenAI Deployment Endpoint.--apiKey (-ak)
: [required] Azure OpenAI API Key.
Delete Connection
pacx ai-translator conn delete --name <connection-name>
--name (-n)
: [required] The connection name.
List Connections
pacx ai-translator conn list
2. Generate Translation Files โจ
Generates two Excel files:
- One with the original translations extracted from a solution.
- One containing newly generated translations by Azure OpenAI.
pacx ai-translator gen [options]
Options:
--solutionName (-sn)
: [required] Name of the Solution.--sourceLanguageCode (-slc)
: [required] Source language code (e.g.,1033
for English).--targetLanguageCode (-tlc)
: [required] Target language code (e.g.,1040
for Italian).--azureOpenAIConnection (-azAICn)
: [required] Name of the Azure OpenAI connection.--sourceExcelPath (-sep)
: [optional] Existing Excel file to use instead of fetching from the environment.--attributeTranslationConstantsPath (-atcp)
: [optional] Path to a JSON file containing translation constants (for Attributes and Forms).--additionalPromptRequest (-apr)
: [optional] Additional instructions for the AI (e.g., "Always translate 'account' as 'Cliente'").--exportFolder (-ef)
: [optional] Path to export the files. Defaults to the current directory.
3. Push Translations ๐
Applies the translations from a generated Excel file to the target environment.
pacx ai-translator push --translatedExcelPath <path-to-excel>
Options:
--translatedExcelPath (-tep)
: [required] Path to the Excel file containing translations to apply.
Attribute Translation Constants File ๐
When using the --attributeTranslationConstantsPath
option, you must provide a JSON file that defines constant translations for specific attributes.
This allows you to control exactly how certain technical fields are named and described.
The file must have this structure:
[
{
"FieldSchemaName": "createdby",
"DisplayName": "Autore creazione",
"Description": "Identificatore univoco dell'utente che ha creato il record."
},
{
"FieldSchemaName": "createdon",
"DisplayName": "Data creazione",
"Description": "Data e ora in cui il record รจ stato creato."
},
{
"FieldSchemaName": "ownerid",
"DisplayName": "Proprietario",
"Description": "ID proprietario"
}
// Add more fields as needed...
]
Each object must include:
FieldSchemaName
: The internal name of the attribute.DisplayName
: The translated label for the attribute.Description
: A translated description for the attribute.
๐ต If a field matches the FieldSchemaName
, its DisplayName and Description will always be overwritten with the provided values instead of being generated by AI.
Example Workflow ๐ฅ
- Create an Azure OpenAI connection:
pacx ai-translator conn create --name my-openai --deploymentEndpoint https://mydeployment.openai.azure.com/ --apiKey my-secret-key
- Generate translation files for a solution:
pacx ai-translator gen --solutionName MySolution --sourceLanguageCode 1033 --targetLanguageCode 1040 --azureOpenAIConnection my-openai
- Apply the generated translations:
pacx ai-translator push --translatedExcelPath ./translated-output.xlsx
Requirements ๐
- PACX installed and configured.
- Access to Azure OpenAI services.
- D365/Power Apps environment with proper privileges.
License ๐
This project is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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. |
-
net8.0
- EPPlus (>= 8.0.2)
- Greg.Xrm.Command.Interfaces (>= 1.1.1)
- Microsoft.Identity.Client (>= 4.71.1)
- System.Text.Json (>= 9.0.4)
- System.Text.RegularExpressions (>= 4.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.