-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Strings, `AccessibilityIdentifiers`, `ImageIdentifiers`
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.
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
tableNamedefines 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.
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.
In order to more easily use images throughout the application, we're adding them, as we go, to the ImageIdentifier struct. This will allow us to more easily work with images.
If adding a new image asset, please be sure to add its string name to the struct.