Skip to content

Latest commit

 

History

History
38 lines (36 loc) · 1.81 KB

README.md

File metadata and controls

38 lines (36 loc) · 1.81 KB

GoogleSheetsLocalization

Installation

1. Install NuGetForUnity via UPM:

https://github.com/GlitchEnzo/NuGetForUnity.git?path=/src/NuGetForUnity

2. Install Google API packages via NuGet:

  • Open NuGet > Manage NuGet Package
  • Install Google.Apis.Sheets.v4

    GoogleApi

3. Install GoogleSheetsLocalization via UPM:

https://github.com/Maksibi/GoogleSheetsLocalization.git

Setup

1. Create LocalizationHolder ScriptableObject

  • Assets > Create > LocalizationHolder

2. Fill out your information in LocalizationHolder

  • Api Key - your google sheets api key, you can find it here
  • Sheets ID - id of sheets in GoogleSheets, can be fount in URL of GoogleSheets

    SheetId
  • Sheet Name - name of sheet in GoogleSheets, can be found at bottom of GoogleSheets

    SheetName

3. Setup your table

  • Your table should look like this:

    SheetLayout
  • Fill your Keys and LocalizationValues according to layout of the table

4. Download localization

  • Open context menu of LocalizationHolder and press DownloadLocalization

Usage

  • One way of using this package is a built in LocalizationSingleton and LocalizedText. Place LocalizationSingleton in first scene of project, call Init with lang code and place LocalizedText on every text you want to localize
        LocalizationSingleton.Instance.CurrentLocalization["YourLocalizationKey"];
    
  • Another way of using is accessing LocalizationHolder's Dictionary with all localizations, this way you can swap languages or localization tables with ease.