Skip to content

Strings, `AccessibilityIdentifiers`, `ImageIdentifiers`

Winnie Teichmann edited this page Jan 12, 2026 · 8 revisions

Overview

In order to better organize certain items throughout the app, we have declared these struct types in the application. This way, there will be no errors using when typing image names, or accessibility identifiers.

Strings

Our strings live as extensions of String. However, they are logically organized according to their location in the app. For example, a string for the settings menu might be found at String.Settings.Homepage.OpeningScreenTitle

We are currently in the process of transferring our strings from the old unorganized system of strings to this better way. However, during that time, there are many strings that exist outside of this organizational order.

Each string is defined with a MZLocalizedString, with the following properties:

  • The key should be unique and composed of a relevant name, ended with the version the string was included in. Example: "FirefoxHomepage.Pocket.Sponsored.v103" is a string that lives under the homepage for the sponsored content in the pocket section, added in v103. The name is clear and explicit.
  • The tableName defines the name of the table containing the localized string. This specifically need to be defined for any strings that is part of the messaging framework, but since any string can be part of messaging in the future all strings should have a tablename.
  • The value is always the text that needs to be localized.
  • The comment is an explanation aimed towards people that will translate the string value. Make sure it follow l10n guidelines.

Note: you will find strings that do not have tableNames. Old strings are fine, but any new & updated strings should have a tableName value included.

AccessibilityIdentifiers

Similar to strings, we've organized our accessibility identifiers according to where they are located in the application.

We are currently in the process of converting accessibility identifiers from strings and moving them into their respective structs. While this process is ongoing, we will have a mix of both.

Image Identifiers

To make image usage consistent and type-safe across the iOS codebase, all image assets must be referenced through image identifier structs instead of raw string literals.

There are two distinct identifier types, matching the two image categories used on iOS:

  • StandardImageIdentifiers – for standard (Acorn) images
  • ImageIdentifiers – for normal (non-standard) images

This document only describes naming and usage rules for the identifier structs.
Detailed instructions for adding image assets live in separate documents and are linked below.

StandardImageIdentifiers

StandardImageIdentifiers is used for standard images coming from Mozilla’s design system (Acorn).

How to add Standard Images:
See the dedicated documentation here: Standard Images (Acorn icons)

Naming rules

  • Identifiers are grouped by size using sub-structs:

    • Small (16×16)
    • Medium (20×20)
    • Large (24×24)
    • ExtraLarge (30×30)
  • The size must not be included in the identifier name.

    • The size is inferred from the sub-struct.
  • Identifiers must be added:

    • To the correct size sub-struct
    • In alphabetical order

Example pattern

  • Asset name: settingsLarge
  • Entry goes in: StandardImageIdentifiers.Large
  • Constant name: settings

ImageIdentifiers

Images that are specific to Firefox for iOS should be added to ImageIdentifiers. If adding a new image asset, please be sure to add its string name to this struct in alphabetical order.

How to add Normal Images:
See the dedicated documentation here: Normal Images (non-standard images)

Clone this wiki locally