Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

Install via UPM

Add to Unity Package Manager using this URL

https://www.pkglnk.dev/track/inputsystemlocalisation.git

README

Input System Localisation for Unity

Description

Localised keys for Unity's new Input System. When calling InputControlPath.ToHumanReadableString, the returned string will always be in english (e.g. the 'Space' key), but we would like an accurate translation for any language.

This is an attempt at providing a framework to translate these keys to any language.

The source file with the input strings and translation is located in Resources/InputKeysDictionary.csv.

Usage

Assuming InputControlPath.ToHumanReadableString returns the first entry in the examples. Example usage:

Debug.Log(Giezi.Tools.InputSystemLocalisation.GetTranslation("Space", "Fr"));
Debug.Log(Giezi.Tools.InputSystemLocalisation.GetTranslation("Space", "De"));
Debug.Log(Giezi.Tools.InputSystemLocalisation.GetTranslation("Any Key", "Fr"));
Debug.Log(Giezi.Tools.InputSystemLocalisation.GetTranslation("Any Key", "De"));
Debug.Log(Giezi.Tools.InputSystemLocalisation.GetTranslation("Numpad *", "Fr"));
Debug.Log(Giezi.Tools.InputSystemLocalisation.GetTranslation("Numpad *", "De"));

Which outputs:

Espace
Leehrtaste
N'importe quelle touche
Irgend eine Taste
Pavé Numérique *
Nummernblock *

The class returns the input string if the value is not found.

Installation

Add the line

"ch.giezi.tools.inputsystemlocalisation": "https://github.com/GieziJo/UnityInputSystemLocalisation.git#main"

to the file Packages/manifest.json under dependencies, or in the Package Manager add the link

https://github.com/GieziJo/UnityInputSystemLocalisation.git#main

under + -> "Add package from git URL....

Contribute

Feel free to modify the code or add entries to the dictionary, either additional languages or keys I've missed. Then open a pull request and they will be merged.

Total Installs
0
Last 30 days
Unique IPs
0
Approximate users

Installs Over Time

Operating Systems

No data yet

Top Countries

No data yet

Git Versions

No data yet

Embed Install Badge

Add an install count badge to your README

Style
Preview
pkglnk installs badge
Markdown
[![pkglnk installs](https://www.pkglnk.dev/badge/inputsystemlocalisation.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/inputsystemlocalisation)
HTML
<a href="https://www.pkglnk.dev/pkg/inputsystemlocalisation"><img src="https://www.pkglnk.dev/badge/inputsystemlocalisation.svg?style=pkglnk" alt="pkglnk installs"></a>

Comments

No comments yet. Be the first!