Skip to main content

String Editor

The String Editor is used to manage and edit string resources for the game. It replaces the lang file system completely, treating strings as individual resources loaded by the engine. This is a more natural approach for game development and is similar to editing decls for content creation in-game. There is one main english.lang file plus feature-specific lang files that are compiled together into one blang.

string editor 1

To open the editor from in-game, use the command editstrings.

String Editor Interface​


string editor interface

1 - Toolbar​

The toolbar contains:

  • A Language dropdown menu
  • A Filter search box
  • Various buttons for Save, Open, New, etc.

2 - String Table​

This section displays the string table or a filtered subset of the string table.

There are three columns for each string:

  • Key: A string key is a unique identifier which is consistent across all localizations.
  • Contents: Contents show the text that will be displayed in-game.
  • Source: The source is the lang file or feature-specific lang file the key comes from.
    • If this column is left empty, the source used is the base lang file (e.g. english.lang).

3 - Edit Area​

This section allows you to edit the selected string.

Filtering Strings​


You can use the Filter search box in the toolbar to locate existing strings (see image below). The filter can use string keys, contents, or sources to sort strings.

String editor filtering 1

The Case-Sensitivity button controls whether the filter is case-sensitive or not.

String editor filtering 2

The search history is saved on shutdown and persists across launches of idStudio.

String editor filtering 3

Localization​


Use the Language dropdown to switch between language files. Click on Language and select your desired language, as in the image below.

String editor localization

Editing Existing Strings​


  1. Select the string you want to edit from the list.

    info

    Some editing options will appear towards the bottom of the String Editor.

    Editing existing strings step 1

  2. Edit the string key directly.

    info

    The String Editor will validate your changes. If the key already exists, the Editor will provide a warning and block you from saving the new key. See the image below as an example of the warning provided.

    Editing existing strings step 2

  3. Select the lang file used as a source for the string key using the Source dropdown, shown below.

    Editing existing strings step 3

    This dropdown lists all available feature-specific lang files. Use the + button next to the Source dropdown to add a new feature-specific lang file.

    info

    If nothing has been selected in this dropdown, the string will be left in the base lang file (e.g. english.lang).

  4. Edit the string body using the Insert Color dropdown, as shown below.

    Editing existing strings step 4

    This will insert id Tech color markup around any selected text.

  5. Use the Character Count box to limit string length, as shown below.

    Editing existing strings step 5

    This feature is used when there are UI space constraints. There are two possible results based on the value you choose, shown in the table below.

    ValueResult
    Set to -1The string will not have a maximum length.
    Set to >-1The string will have the corresponding length.
    info

    If the string is too long, the Editor will provide a warning and block you from saving it.

  6. Use the Save button shown below to save your changes to the string table stored in memory.

    Editing existing strings step 6

    Your changes will then be available immediately in-engine.

Adding New Strings​


There are two ways to add new strings:

  • Using the Wizard
  • Importing from CSV

From the Wizard​

  1. To open the new string wizard, click the Create A New String button in the toolbar (or CTRL + N).
  2. Select a Prefix and Component.
  • These will become the first part of the string key.
info

You can add new prefixes and components to the file game/base/idstudio/string_editor.state.

warning

You must add a user key, this will become the second part of the string key.

tip

You can save your selections as a preset, which may speed up the process of adding many strings of similar types. When you make a new string, it will remember the last preset you used.

![Adding new strings step 2](../../static/img/ui/string-editor-add-new-step-2.png)

3. Save to update the string table.

tip

Certain characters may be processed incorrectly when imported from CSV, namely special characters (e.g. ^ and '). To ensure that a string is read correctly, put quotation marks around the string. For example:

  • 0Hi will incorrectly import as 0 Hi.

  • "0Hi" will import correctly as 0Hi.

Import From CSV​

  1. Bulk import many strings using the Import from CSV button (CTRL + I).

    Import from csv step 1

  2. Your file must be saved as a csv and must contain only two columns:

    • String ID

    • String Contents

      Import from csv step 2

Removing Strings​


  1. Select one or more strings.

  2. Hit the red Trash button to delete the string(s).

    Remove strings

  3. Save to update the string table.