Translating field labels does not make a fixed US address schema international. The form can force an Irish customer to choose a state, display a Japanese address in the wrong order, or reject a valid postal code with a ZIP-code rule. The user entered a legitimate address, but checkout still fails or stores data that cannot be used for delivery.
A sound international address form gets its structure from country metadata. It stores semantic components without treating the screen order as the data model, applies several levels of validation, and formats the result for its destination. Mobile clients and the API need to follow the same rules.
Diagnose the fixed-schema failure
A common address model starts with these fields:
- address line 1
- address line 2
- city
- state
- ZIP code
- country
The strings make this shape look generic, but the policy is specific to one market. It assumes every address has a state-like subdivision, puts that subdivision after the city, uses one postal-code label everywhere, and requires the same fields for every destination.
Practitioners have asked how to reproduce a mobile contact form where address fields change when the country changes. In the example, the US form uses Zip, while another country uses Postal Code. Country choice affects more than that label. It can change which fields apply, which are required, how they are ordered, the examples shown, and the validation rules.
Another developer asks whether an application should store a structured address, city, state, ZIP, and country or use flexible address lines. A free-form block accepts unfamiliar input but is hard to validate, search, or send to a carrier. A rigid schema is easier to automate but can reject real addresses. Keep the semantic components that country metadata defines, and preserve the address lines the user entered instead of inventing components that are not there.
Before changing code, reproduce the failure with destination countries that do not fit the current model. Check whether the form:
- requires a subdivision where none applies
- limits postal codes to digits or a fixed length
- rejects non-Latin text
- loses values when country selection rebuilds the form
- sends labels instead of stable field identifiers to the API
- formats the stored address in the input screen's visual order
- treats autocomplete output as valid without user confirmation
The results show which part of the flow makes the country-specific assumption: the screen, stored record, validator, or some combination of them.
Make destination country the schema input
Use the destination country to choose the address structure. App language controls labels and guidance, not postal rules. A French-language user shipping to Japan needs a Japanese address schema presented with French interface labels. Device region can supply an initial country, but it stops being authoritative once the user chooses the destination. The same split between language and region decides which measurement units an app displays.
Google's maintained libaddressinput project uses address metadata to identify required country fields and flag missing or invalid values. Its Java implementation has an Android address-input widget, while its non-UI logic can be adapted elsewhere. Follow the same division in your system. Metadata describes the address, and each client renders that description with native components.
Model the metadata independently of translated UI copy:
type AddressField =
| "recipient"
| "organization"
| "addressLine1"
| "addressLine2"
| "dependentLocality"
| "locality"
| "administrativeArea"
| "postalCode"
| "sortingCode";
type CountryAddressSchema = {
countryCode: string;
orderedFields: AddressField[];
requiredFields: AddressField[];
subdivisionMode: "select" | "text" | "hidden";
postalCodePattern?: string;
exampleValues: Partial<Record<AddressField, string>>;
metadataVersion: string;
};
Do not put translated labels in the data contract. The UI can display administrativeArea as State, Province, Prefecture, Region, or another local term, while the API receives the same semantic identifier. Copy can then change without a database migration.
Select the country before showing the rest of the form when the product flow permits it. If country appears last, users can fill a generic form and lose data when a later selection changes the schema. When an existing address is being edited, load its country and metadata version before building fields.
Preserve data when the schema changes
Do not delete hidden values as soon as the country changes. Someone can choose the wrong country, enter several fields, correct the choice, and then switch back. Keep entered values in an in-memory semantic map for the life of the screen. Hide fields that no longer apply, then erase them only when the user confirms the new address or a documented retention rule requires it.
Store and transmit a stable country code such as an ISO alpha-2 value, not a localized country name. Retain the user's original text for address lines, locality, organization, and recipient. If a carrier requires transliteration, save it as a derived value rather than silently replacing the source-script address.
A practical stored record can contain:
{
"countryCode": "JP",
"recipient": "山田 太郎",
"addressLines": ["千代田1-1"],
"locality": "千代田区",
"administrativeArea": "東京都",
"postalCode": "100-0001",
"metadataVersion": "2026-05",
"validationStatus": "user-confirmed"
}
The example is a data shape, not a universal Japanese mailing template. Actual field requirements and formatting should come from verified metadata. Store schema version so a later rules update does not make old records impossible to interpret.
Client and server must agree about optional fields. A mobile client that hides administrativeArea cannot succeed if the API marks the database column mandatory. Share a schema package or expose a versioned schema endpoint. At minimum, test the same country fixtures against both validators.
Validate in layers instead of blocking unfamiliar input
Separate local completeness checks, syntax checks, and remote validation. One Boolean cannot explain what failed or whether the user can continue.
Start with structural checks from the country schema. Confirm that required fields are present and that values fit safe length limits. The app must be able to run these checks offline.
Apply conservative syntax checks next. A postal-code pattern can catch an obvious format error, but it cannot prove that an address exists. Do not reject letters, spaces, hyphens, apostrophes, accents, or non-Latin scripts just because the original market did not use them. If no verified pattern exists, mark the value unverified rather than invalid.
Add remote validation only when the delivery risk warrants it. Google's Address Validation API accepts an address, identifies and validates components, standardizes it for mailing, and can return coordinates. Its documentation describes a correction flow for questionable components. This service evaluates submitted data; it does not choose the labels or controls the form should have before the user types.
Do not overwrite the user's address with a service response without confirmation. Suggested standardization may change abbreviations, script, or component boundaries. Show the original and suggested forms when the difference matters. Record whether the user accepted the suggestion, kept the original, or could not be validated because the service was unavailable.
Define explicit outcomes instead of one Boolean:
incomplete: required local fields are missinginvalid-format: a safe country rule failedneeds-confirmation: a service suggested a material correctionuser-confirmed: the user kept or accepted a complete addressservice-unavailable: local checks passed but remote validation did not run
The product can now decide which outcomes block checkout. A validation-service outage no longer turns a locally complete address into bad user input.
Format for display and mailing separately
The order of input controls is not a display template. Render saved addresses through a country-aware formatter. Apple's CNPostalAddressFormatter handles international postal-address formatting. Where no platform formatter exists, use the country metadata that drove collection and keep the formatting code outside individual screens.
Display and mailing may need different styles. A compact account card can use fewer lines, while a shipping label must preserve the destination's postal order. Accessibility output should read a coherent address rather than announce isolated form labels. Do not join components with a hardcoded comma because punctuation, order, and line breaks can vary.
Keep formatting deterministic for a stored record and metadata version. If metadata updates alter presentation, test whether existing addresses should adopt the new format immediately or only after confirmation. Never mutate stored components merely because the display template changed.
Handle autocomplete without surrendering the contract
Autocomplete saves typing, but provider output is another schema to translate. Providers can use different component names, omit apartment information, or combine locality levels differently by country. Map that response through a dedicated adapter into the application's semantic address model. Retain the raw response only when policy allows it. Application code should not depend directly on provider keys.
After selection, leave every field editable. Ask the user to supply missing unit, building, or recipient details. Run the same structural checks used for manual input. An autocomplete selection is evidence that a place candidate exists, not proof that the final postal address is complete or deliverable.
Include country and metadata version in cached autocomplete and validation results. Reusing a suggestion under another destination country or schema revision can restore fields the current form does not understand.
Verify the international address form across boundaries
A valid US address and a translated screenshot prove very little. Build release fixtures for structural differences and failure paths:
- a country with no required administrative area
- a country with alphanumeric postal codes
- a country whose normal display order differs from the source market
- source-script input with accents or non-Latin characters
- an address with a dependent locality or sorting code
- a country change after partially entering the form
- offline schema loading and remote validation failure
- an autocomplete result missing a required user-entered component
- an old address saved under a previous metadata version
- client and server validation of the same payload
For each fixture, assert field order, localized labels, required markers, retained values, API payload, validation outcome, formatted display, and screen-reader order. Logs can include country code, metadata version, validator version, and outcome category. Do not log the full address because it is personal data.
Monitor validation failures by country and schema version. A sudden rise in invalid-format after a metadata update is a release signal. A high rate of user overrides may indicate an overaggressive service suggestion or an incorrect component adapter. Metrics should help identify a rule defect without collecting address text unnecessarily.
Put one country-aware path into production
Start with the address flow that causes the most blocked submissions or support work. Replace its fixed field list with a versioned country schema, preserve values during country changes, and align the API validator with the client. Add country-aware display formatting before migrating another screen.
Choose five structurally different destination countries and encode one shared fixture for each. Run the fixtures through form rendering, submission, validation, storage, and display. If any layer uses a translated label or visual position as its data contract, fix that boundary before expanding the rollout.
References
- Google libaddressinput supports country-driven required fields, address metadata, validation, and an Android input widget.
- Google Address Validation API overview explains component validation, mailing standardization, correction workflows, and validation outcomes.
- Apple CNPostalAddressFormatter supports international formatting of stored postal addresses.
- Stack Overflow: Address fields by country supplies practitioner evidence for country-driven mobile field labels and structure.
- Stack Overflow: International phone and address data records the practical tradeoff between rigid structured fields and flexible international input.
