Skip to content

emptybraces/Unity_Localization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity_Localization

A text based localization system. Words are displayed on the TMP_Text from a word list defined in a text file prepared for each language in StreamingAssets, and can switched as needed regardless of Editor or Runtime.

Install

Intall via Unity Package Manager:

https://github.com/emptybraces/Unity_Localization.git?path=Assets/upm

localization

Structure

This code accomplishes the language switching by dynamically replacing the Fallback FontAsset prepared for each language. Create an base FontAsset for each theme(system, dialogues, etc) you want to use. It's almost for the fallback setter, so the atlas textures should empty or bake ASCII code use the same font for all languages for alphabets and numbers. Materials are created for this base FontAsset and are shared by all fallbacks. Then, using the TmproLocalize component, the FontAsset for each language can be loaded into the fallback to display the characters.

Setup

  • Configuration file must be created in "Assets/Localization/Create Localization Settings".
  • In configuration, set the languages to be supported and file prefix for word lists. Next, set the TMP_FontAsset for each language and press the button below to register it in Addressables.

image

  • Place a text file in the StreamingAssets folder, these files defining wordlist for languages you set above. File name format is "[PREFIX]_word.txt".
  • Keys and values are separated by spaces or tabs. The key can also have an array value that must begin with a space or tab.

files

  • AssetPostprocessor is implemented, and the word list file in the folder specified in Settings will automatically create LID.cs when detect to updated. It can also be run manually from "Assets/Localization/Create LID.cs".

image

  • Sample setup ready, but there is a little work to be done after importing. image

About

Localization system as easy as possible

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages