KSV.Lib.Traducoes.Unity 2.0.1

dotnet add package KSV.Lib.Traducoes.Unity --version 2.0.1
                    
NuGet\Install-Package KSV.Lib.Traducoes.Unity -Version 2.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KSV.Lib.Traducoes.Unity" Version="2.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KSV.Lib.Traducoes.Unity" Version="2.0.1" />
                    
Directory.Packages.props
<PackageReference Include="KSV.Lib.Traducoes.Unity" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add KSV.Lib.Traducoes.Unity --version 2.0.1
                    
#r "nuget: KSV.Lib.Traducoes.Unity, 2.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package KSV.Lib.Traducoes.Unity@2.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=KSV.Lib.Traducoes.Unity&version=2.0.1
                    
Install as a Cake Addin
#tool nuget:?package=KSV.Lib.Traducoes.Unity&version=2.0.1
                    
Install as a Cake Tool

KSV.Lib.Traducoes.Unity

Biblioteca de traducoes para projetos Unity com carregamento de JSON por arquivo externo.

Estrutura esperada

O TradutorManager carrega um arquivo Traducoes.json por caminho configurado no Inspector.

Se o caminho informado for relativo, ele sera resolvido a partir de Application.streamingAssetsPath.

Exemplo padrao:

StreamingAssets/Shared/Traducoes/Traducoes.json

Formato:

{
  "World of Blocks": {
    "#MENU_PLAY#": {
      "PortuguesBr": "Jogar",
      "PortuguesPt": "Jogar",
      "InglesUs": "Play",
      "EspanholEs": "Jugar",
      "FrancesFr": "Jouer",
      "RussoRu": "Play RU",
      "AlemaoDe": "Spielen",
      "JaponesJa": "Play JA",
      "Italiano": "Gioca",
      "Coreano": "Play KO"
    }
  }
}

Uso basico

Adicione o componente TradutorManager em um GameObject da cena inicial.

No Inspector:

  • Caminho Arquivo Traducoes: caminho absoluto ou relativo do Traducoes.json
  • Projetos De Traducao: lista carregada automaticamente a partir do JSON para voce marcar quais projetos deseja usar

Se a lista de projetos ficar vazia, todos os projetos do JSON serao carregados.

var titulo = TradutorManager.Traduzir("#MENU_PLAY#");
TradutorManager.AlterarIdioma(IdiomasEnum.InglesUs);

Observacoes

  • O arquivo de traducoes fica no projeto consumidor, nao dentro da DLL.
  • Tags duplicadas entre projetos usam o ultimo valor carregado.

Fluxo de distribuicao via NuGet

Este repositorio continua sendo um projeto Unity para desenvolvimento da lib. O artefato distribuido e um pacote NuGet com a DLL compilada da assembly Lib.Traducoes.

Como gerar o pacote

  1. Compile a lib no projeto Unity para gerar Lib.Traducoes.dll.
  2. Rode:
.\scripts\Pack-NuGet.ps1

Se quiser usar a DLL gerada por build local fora da pasta Library, rode:

.\scripts\Pack-NuGet.ps1 -UseTempBuildOutput

Se quiser publicar uma versao especifica:

.\scripts\Pack-NuGet.ps1 -Version 1.0.1

O pacote sera gerado em:

Assets/Pacotes/Lib.Traducoes.NuGet/artifacts/bin/Debug/

Como consumir em outro projeto Unity

  1. Instale o NuGetForUnity no projeto consumidor.
  2. Adicione sua fonte NuGet privada ou local.
  3. Instale o pacote KSV.Lib.Traducoes.Unity.
  4. Coloque o Traducoes.json no local desejado, por exemplo em StreamingAssets/Shared/Traducoes/Traducoes.json.
  5. Adicione TradutorManager na cena inicial.
  6. No TradutorManager, informe o caminho do arquivo e os nomes dos projetos que devem ser carregados.
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 333 3/17/2026
2.0.0 115 3/17/2026
1.0.9 118 3/14/2026
1.0.8 115 3/14/2026
1.0.7 110 3/14/2026
1.0.6 114 3/14/2026
1.0.4 115 3/14/2026
1.0.3 121 3/14/2026
1.0.1 117 3/14/2026