Localization sheets
A localization sheet holds your game's text in every language. Rows are keys and columns are locales.
A localization sheet is an ordinary SheetForge sheet. It imports, validates, exports, pushes and round-trips exactly like a data sheet.
When the Unity Localization package (com.unity.localization) is installed, every completed import also fills the package's own String Table collections from the sheet. Your runtime then consumes standard LocalizedString references while the sheet stays the single source of truth.
This chapter is about your game's text. The 10-language UI of SheetForge itself is a separate subject. See UI language.
In this chapter
This page covers the sheet itself: its shape, how data sheets reference its text, and what an import generates from it.
- Unity Localization bridge: fill String Table collections from the sheet, bring existing tables into a sheet, and hand text to translators.
The sheet shape
A sheet becomes a localization sheet by carrying an @loc marker row. Like @overlap and @style, the row sits anywhere above the data. Its cell in each column names that column's locale code.
@loc | | en | ko | |
@name | codeName | en | ko | smart | comment
@type | RecordId | string? | string? | bool? | string?
@desc | key | source text | Korean | |
| ui.ok | OK | 확인 | false | Confirm button
| ui.cancel | Cancel | 취소 | |The key column
The RecordId key column is required. Each row's key value, such as ui.ok, is the localization key.
The tab name is the String Table collection name. One tab is one collection.
Locale columns
A locale column is a string column whose @loc cell carries the locale code, such as en, ko or pt-BR. Any identifier-like tag is accepted.
- At least one locale code is required.
- SheetForge validates the spelling shape of a code, not the code's existence.
- Two columns whose codes differ only by case are rejected.
Write locale columns as string?. An untranslated cell is then a missing translation, not an import error. See Coverage.
The first locale column is the source locale. Its text is what a data sheet's reference cell previews inline, and what auto-minting writes.
Reserved columns
Two optional columns are reserved. SheetForge matches them by name.
| Column | Type | What it does |
|---|---|---|
smart | Boolean | Marks the entry as a Unity Localization Smart String |
comment | String | Synchronized into the entry's comment metadata |
When a reserved column is present, the sheet is the truth for those bits. When it is absent, the bridge leaves the corresponding table metadata untouched.
A reserved column may not also carry a locale code.
Conflict with enum sheets
A sheet cannot be both an enum sheet and a localization sheet. @enum + @loc is a conflict error, reported once.
What a localization tab outputs
Everything else is an ordinary sheet. Staging and Ctrl+Z, structure editing, @style grouping, xlsx and Google round-trips, Push, and the web app all treat it as a normal table.
What changes is the output. A localization tab emits no generated record class, no Database ScriptableObject and no Addressables address.
Instead it feeds two things: the key constants and the bridge.
Reference text from a data sheet
A data sheet points at a localization entry with a LocRef reference column. The notation is LocRef@Tab.
@name | codeName | displayName
@type | RecordId | LocRef@Strings
@desc | unique key | shown in UI
| item.sword | item.sword.nameLocRef@Strings behaves exactly like the built-in references, such as RecordId@Tab.
Validation at import
References are integrity-validated at import. A typo fails at import, not at runtime.
- A key that does not exist in the
Stringstab is a structured error with a nearest-match suggestion. - The target must be a localization sheet. Otherwise the import reports
LocRefTargetNotLocalizationSheet. LocRefwithout@Targetis rejected, with the correct spelling suggested.
Reference features
A LocRef column has everything a reference column has:
- The searchable key picker
- Key-rename propagation
- Graph edges on the record canvas
- Exported dropdown rules
- Orphan detection (records that nothing references)
Renaming a key rewrites every referencing cell in the same batch. All of these work in the editor and the web app alike.
Lists and optional references
LocRef composes like any reference. List<LocRef@Strings> and the optional form LocRef@Strings? both work. In the optional form, an empty cell is an empty reference.
References across workbooks
LocRef crosses workbooks like any reference. The Strings tab may belong to another settings asset. Tab names are unique project-wide, so the notation is the same.
A key minted from the cell is staged into that workbook. It is written to that workbook's source when you reflect. See Reflect into several workbooks.
Source text in the cell
The cell shows the text, not only the key. A LocRef cell previews the entry's source-locale text inline, so a sheet full of keys still reads as sentences.
The record canvas does the same. Reference rows carry the source text inline. A truncated value always holds its full text in the tooltip.
Mint an entry from a cell
Type the source text into an empty LocRef cell, then press Enter or leave the cell. SheetForge stages three things as one gesture and one undo step:
- A new key in the target localization sheet, made from the record and field names.
- The text you typed, as the key's source-locale value.
- The reference, in the cell you typed into.
In the Data Studio, the new key joins the row's key and the column name with _. If that key is taken, a number is appended. When the text you typed is exactly an existing key of the target sheet, the cell connects to that key and nothing is minted. A list cell, such as List<LocRef@Strings>, does not mint.
To choose the key name yourself, press the ▾ button in the cell and use the create line at the bottom of the picker. Type the key and press Enter. A key made this way starts with empty source text.
The staged edits reach the source when you reflect. You can rename the key freely later. Propagation keeps every reference intact.
Minting works in both hosts, the Unity editor and the web app.
What lands in your code
Codegen emits the field as LocRef. It is a plain serializable struct that holds the target table and the key.
The struct lives in the SheetForge runtime assembly. It compiles whether or not the Unity Localization package is installed. Generated code and baked ScriptableObjects never contain a package type.
With the package installed, one extension call bridges into it:
var text = definition.displayName.ToLocalizedString(); // UnityEngine.Localization.LocalizedStringToLocalizedString() exists only when the package is present. A version-define, SHEETFORGE_LOCALIZATION, turns the extension layer on. SHEETFORGE_ADDRESSABLES uses the same mechanism.
Without the package, the field is still a well-formed table/key pair that you can consume yourself.
What an import generates
Alongside the regular outputs, an import writes one SheetForgeLocalizationKeys.cs per generated-code folder.
The file holds a static class per localization tab, such as StringsKeys. Each class holds one public const string per key.
Each class is in the namespace of the workbook that owns the tab.
Game code can say StringsKeys.ui_ok instead of a bare "ui.ok". That gives you compile-time safety and IDE completion.
Member names
Member names are the keys sanitized to C# identifiers.
- Characters outside ASCII letters, digits and
_become_. - A name that starts with a digit, or that is a C# keyword, gets a leading
_. - Collisions get a deterministic numeric suffix:
_2,_3and so on, in sheet row order.
If you want usable constants, keep keys ASCII. A fully non-ASCII key sanitizes into a row of underscores.
Where the file lands
Like the sheet-defined enum file, the constants file is a shared output. It always lands in the generated-code folder named in that workbook's settings.
The file holds the tabs of every workbook that generates there, from what each workbook last generated.
The assembly note for sheet-defined enums applies to this file too. See Sheet-defined enums land in the generated-code folder.
Tabs with no rows
A localization tab with no rows keeps an empty class. Clearing a sheet does not break code that references the type.
Next steps
- Unity Localization bridge
Sync the sheet into String Table collections and work with translators.
- Sheet syntax
The
@locmarker andLocRefin the notation reference. - Data Studio
The window where minting and renames happen.
- Several workbooks
LocRefcells and key constants across settings assets.