How to use

Common Setup

  1. Import BGLocalization package
  2. Create your own database ( more info)
  3. Enable localization addon
  4. Go to Database->Localization and add your locales. Locale name- letters only, 8 chars maximum.
    Note, locales is just a regular table, so you can add your own fields, like native spelling, flag icons etc.

Setup single value table

Single value table is easy to use, but can have only one field.

  1. Go to Configuration and create a table (type of the table is LocalizationSingleValue), chose the type of data to be stored.
  2. Go to Database->"Your created table", add some rows. You can edit values for all locales here. Also you can use machine translation (Learn more about auto-translation here)

Setup embedded fields

Embedded fields allow you to embed localization fields into normal rows along with other fields and require more actions.

  1. Go to Configuration and create a table for your locale data (type of the table is Localization), chose the type of data to be stored.
  2. Create a normal table (row)
  3. Add a localized field to this table. You will need to chose a related table (created at step 1) here
  4. Go to Database->"Your created table", add some rows. You can edit localized values here (current locale will be used)
  5. Another option- is to chose "localization" table and edit values for all locales at once. You can use Auto-translation here
  6. Learn more about auto-translation here
  7. Once you data is ready, you can localize your Components (any field or property). For more details, please read the following section

How to localize fields/properties

More details can be found here

If you need to localize single field/property, use BGDataBinderFieldGo component (or legacy BGLocalizationGo)

If you need to use text template, use BGDataBinderTemplateGo component

If you want to localize multiple fields/properties from multiple GameObjects with single component, use BGDataBinderBatchGo component

Localization plugin adds the following features to data binding:

  1. For single value localization, it adds special $locale field, if your meta has localizationSingleValue type
  2. For templates you can also use $locale as field name, if your meta has localizationSingleValue type

How to change locale

    var addon = BGRepo.I.Addons.Get<BGAddonLocalization>();
    addon.CurrentLocale = "en"; // replace en with your locale name