A grammatical rule in many languages requiring that adjectives, articles, verbs, and other words change their form to match the gender of the noun or subject they relate to.
In languages like French, Spanish, German, Italian, Arabic, and Hebrew, nouns carry a grammatical gender (masculine, feminine, or in some languages, neuter) and other words in the sentence must reflect that gender consistently. This is gender agreement. In French, “un chat noir” (a black cat, masculine) uses the masculine form of both the article and the adjective, while “une voiture noire” (a black car, feminine) switches both to feminine, even though neither a cat nor a car has biological sex.
For native speakers, gender agreement is automatic. For translators, it requires careful attention to every element in a sentence. For developers building multilingual software, it is one of the most technically demanding aspects of internationalization.
English largely lacks grammatical gender, which means developers building software in English rarely encounter it. When that software needs to be localized into Spanish, French, German, Arabic, or Hebrew, gender agreement suddenly becomes a structural problem built into the code itself.
The most common culprit is string concatenation — building sentences by joining fragments of text with variables. A string like "Your " + itemType + " has been saved" works fine in English. In Spanish, the adjective and article before itemType need to agree in gender with whatever word fills that variable. If the variable is archivo (file, masculine), the string reads differently than if it is carpeta (folder, feminine). A hardcoded template with no gender awareness will produce grammatically wrong output for one or both cases.
The same problem appears in user-facing messages that refer to the user themselves. In English, “Welcome back!” works for everyone. In Hebrew or Arabic, the greeting changes form depending on whether the user is male or female. If the application does not know or store the user’s gender, serving the correct grammatical form becomes a logic problem on top of a translation problem.
Now, there is a certain distinction between these two types that should be clarified to address them correctly:
Grammatical gender refers to the fixed gender assigned to nouns in a language, regardless of the real-world object. In Spanish, el coche (the car) is masculine and la mesa (the table) is feminine. This is a property of the word itself, not of what the word refers to. Adjectives, articles, and pronouns must agree with this assigned gender.
Semantic gender (or natural gender) refers to the biological or social gender of a person or entity being described. When a UI string says “You are now registered,” languages like Arabic and Hebrew require different word forms depending on whether “you” refers to a man or a woman. This is semantic gender, and it depends on real-world identity, not grammatical convention.
Both types require different solutions in software: grammatical gender is handled through translation variants and careful string design, while semantic gender usually requires storing user gender preferences and using conditional logic to serve the right string.
The most practical approach is to use ICU MessageFormat syntax to define gender variants directly in translation strings. For example, a greeting that changes based on user gender can be written as a single key with male, female, and other variants. The i18n library selects the correct form at runtime based on the gender value passed in.
For grammatical gender tied to variable nouns, the cleanest solution is to avoid partial sentence strings entirely. Instead of inserting a noun into a sentence fragment, write complete sentences for each variant or use a translation key structure that groups related gender forms together, such as item.file.saved and item.folder.saved, giving translators the context they need.