Locales
The Use fake data method replaces a value with a generated value of the same label: a name, an address, a phone number, an identifier... Many labels can generate values for a specific language or country. This is the locale of the label.
For example, a location/phone field with the locale es-CL gets Chilean phone
numbers, and with en-AU it gets Australian ones.
How the Locale Is Chosen
Discovery Operation Generated value
--------- --------- ---------------
field "telefono" -> Use fake data -> +56 9 1234 5678
label location/phone label location/phone
locale es-CL locale es-CL (editable)
type mobile type mobile (editable)- Discovery assigns a label to each field. The label can also carry the
locale of the data (for example
person/namewithes-AR). - In an anonymize or synthesize operation, the Use fake data method generates values for the field's label.
- Click the pen icon (✎) of the field to see the options (see
Edit Function Options).
The editor shows one selector per label option, named after the option:
- locale: the locales the label supports (see the table below). It
starts with the locale of the field's label, or
en. If that locale is not in the list, the first locale of the list is selected. - type and format: only for the labels that have them.
- locale: the locales the label supports (see the table below). It
starts with the locale of the field's label, or
- In custom functions, pass the locale as the second
argument of
genLabel. Without it, the locale isen_US. The Text format option (case) works with every locale:
genLabel('person/name', 'es-AR');
genLabel('location/phone', 'es-CL', { type: 'mobile' });
genLabel('location/city', 'pt_BR', { case: 'upper' });Locale Codes
A locale is a language code, optionally followed by a country code:
| Code | Language and country |
|---|---|
en, en-US | English (United States) |
en-GB | English (United Kingdom) |
en-AU | English (Australia) |
en-NZ | English (New Zealand) |
es, es-ES | Spanish (Spain) |
es-MX | Spanish (Mexico) |
es-AR | Spanish (Argentina) |
es-PE | Spanish (Peru) |
es-EC | Spanish (Ecuador) |
es-CL | Spanish (Chile) |
es-CR | Spanish (Costa Rica) |
es-CO | Spanish (Colombia) |
eu-ES | Basque (Spain) |
it, it-IT | Italian |
fr | French |
pt, pt-BR, pt_BR | Portuguese (Brazil) |
de, de-DE | German |
Some labels list the locale with an underscore (pt_BR) and others with a
hyphen (pt-BR), but both forms are the same locale: pt_BR, pt-BR and
pt-br generate the same values in every label, in saved rules and in
genLabel.
Locales per Label
| Label | Locales | Other options |
|---|---|---|
person/name | en, es, es-MX, eu-ES, es-AR, es-PE, es-EC, es-CL, en-AU, en-NZ, fr, it | type: first, last, full, last_first |
person/sex | en, es, fr | type: full, abbr |
location/address | es-ES, es-MX, es-AR, es-PE, es-EC, es-CL, it, en, pt_BR, fr, en-AU, en-NZ | |
location/city | es-ES, es-MX, es-AR, es-PE, es-EC, es-CL, it, en, pt_BR, fr, en-NZ | |
location/state | es-ES, es-MX, es-AR, es-PE, es-EC, es-CL, it, en, pt_BR, fr, en-AU, en-NZ | type: abbr, full |
location/country | any, es-ES, es-MX, it, en, pt_BR, fr | |
location/nationality | en, es, it, pt | |
location/phone | es-ES, es-MX, es-AR, es-PE, es-EC, es-CL, es-CR, it, en, pt-BR, fr, en-AU, en-NZ | type and format, depending on the locale |
location/zip_code | de-DE, es-ES, es-MX, es-AR, es-PE, es-EC, es-CL, es-CR, en, it, pt-BR, fr, en-GB, en-AU, en-NZ | |
vehicle/plate | en-AU, en-NZ, en-US, es-AR, es-CL, es-EC, es-ES, es-MX, es-PE | |
vehicle/fuel, vehicle/types | en, es, pt | |
flights/fare | en, es, pt | |
general/colors | en, es, pt | |
business/order_status | en, es, pt | |
entertainment/movie/genre | en, es, pt | |
business/department | de, en, es, pt | |
business/job_title | en, es | |
datetime/weekday | en, es, pt | type: abbr, full |
identifier/cedula_identidad | es-CR, es-CO, es-AR, es-PE | format |
identifier/driver_license | it-IT, es-CL | |
identifier/passport | es-CL | format: random, letter, numeric |
finance/bank_account | es-CL | type: cuentarut, account |
health/ficha_clinica, health/prevision | es-CL | |
health/prevision_number | es-CL | type: tramo, afiliacion |
finance/bsb, identifier/abn, identifier/tfn, identifier/medicare | en-AU | |
identifier/ird | en-NZ |
Country-Specific Labels
These labels always generate values of one country, so they have no locale:
| Country | Labels |
|---|---|
| Spain | identifier/dni |
| Mexico | identifier/nss, identifier/curp, identifier/rfc |
| Italy | identifier/cf |
| United Kingdom | identifier/nino, identifier/nhs |
| United States | identifier/ssn, identifier/dea |
| Chile | identifier/rut (format: ##.###.###-# or ########-#) |
| Ecuador | identifier/cedula_ecuador (format: ########## or #########-#) |
Locale Details
Names
| Locale | Source |
|---|---|
| eu-ES | Basque first and last names |
| es-AR, es-PE, es-EC, es-CL, en-NZ | Names of each country |
| en, en-AU, es, es-MX, fr, it | Generic name generator for the language |
type selects first (first name), last (last name), full (first and
last name) or last_first (last and first name).
Addresses, Cities and States
- es-AR, es-PE, es-EC and es-CL use their own lists of streets,
cities and regions. type
abbrgives the region abbreviation. - en-NZ uses its own lists of streets, cities and regions.
location/statealways gives the full region name: there is no list of New Zealand region abbreviations, so typeabbris ignored. location/cityhas no en-AU locale: there is no list of Australian cities.- The other locales use the generic generator for the language.
location/countrywithanygives the country names in English.
Phone Numbers
| Locale | type | Generated numbers |
|---|---|---|
| es-ES | landline, mobile | Landlines start with 9 (format madrid: 91, eus/alava: 945). Mobiles start with 6 |
| es-MX | Mexican area code + 7 digits | |
| es-AR | landline, mobile | 10 digits with the area code. Mobiles add a leading 9 (11 digits) |
| es-PE | landline, mobile | Landlines with area code (######## or ####-####). Mobiles start with 9 (######### or ### ### ###) |
| es-EC | landline, mobile | Landlines with a province digit (######## or ####-####). Mobiles start with 09 (########## or ### ### ####) |
| es-CL | landline, mobile | 9 digits, or +56 # #### ####. Mobiles start with 9 |
| es-CR | landline, mobile, mixed | 8 digits: ########, ####-#### or #### #### |
| en-AU | landline, mobile | Landlines 0X## ### ### with the area code of Sydney, Melbourne, Brisbane or Perth (format). Mobiles 04## ### ### |
| en-NZ | landline, mobile | Landlines 0X ### #### with the area code of Auckland, Wellington or Christchurch (format). Mobiles 02X ### #### |
| it, en, pt-BR, fr | Generic generator for the language, or format #########, ###-###-### or ## ### ## ## |
Zip Codes
| Locale | Generated codes |
|---|---|
| es-AR | 4 digits |
| es-PE | 5 digits starting with a department code |
| es-EC | 6 digits: province, canton and parish |
| es-CL | 7 digits |
| es-CR | Real Costa Rican postal codes |
| en-NZ | 4 digits, from 0110 to 9893 |
| Others | Generic generator for the country |
Vehicle Plates
| Locale | Examples |
|---|---|
| es-ES | 1234BCD |
| es-MX | BCD-123-F |
| es-AR | AB 123 CD or ABC 123 |
| es-PE | ABC-123 or A1B-234 |
| es-EC | ABC-1234 |
| es-CL | ABCD-12 or AB-CD-12 |
| en-AU | AB-12-CD, ABC-123 or 123-ABC |
| en-NZ | ABC123 |
| Others | US state abbreviation + 4 characters, for example CA7K2P |
Identifiers
| Label | Locale | Generated values |
|---|---|---|
identifier/cedula_identidad | es-CR | 9 digits: #.####.####, # #### ####, #-####-#### or ######## |
| es-CO | 10 digits: #.###.###.###, # ### ### ###, #-###-###-### or ########## | |
| es-AR | 7 or 8 digits: ##.###.###, ## ### ###, ##-###-###, ########, #.###.### or ####### | |
| es-PE | 8 digits | |
identifier/driver_license | it-IT | Italian driver license |
| es-CL | A Chilean RUT (the license number is the holder's RUT) | |
identifier/passport | es-CL | letter: a letter + 8 digits. numeric: 8 or 9 digits |
finance/bank_account | es-CL | cuentarut: CuentaRUT account, the RUT without the check digit (7 or 8 digits). account: 8 to 12 digits |
health/prevision | es-CL | FONASA, ISAPRE or AFP affiliation |
health/prevision_number | es-CL | tramo: FONASA bracket (Tramo A...). afiliacion: 6 to 10 digits |
Language-Only Labels
vehicle/fuel, vehicle/types, flights/fare, location/nationality,
general/colors, business/order_status, entertainment/movie/genre and
person/sex only have a language (en, es, pt, it, fr). The values
come in English when the generator has no list for that language.
location/nationality has lists for es, pt and it. general/colors,
business/order_status, entertainment/movie/genre and location/nationality
also accept the language with a country (es-ES, pt-BR).
business/department, business/job_title and datetime/weekday use the
generic generator for the language. pt gives Portuguese (Brazil) values.
Accents and Fallbacks
- Generated text has its accents removed:
JosébecomesJose, andBegoñabecomesBegona. - A locale whose language and country codes are the same (
fr-FR,de-DE,it-IT) is used as the language (fr,de,it). - If the generic generator has no data for a country, it uses the language of
the locale:
es-CRuseses, anden-NZusesen. - If it has no data for a language alone, it uses the first country of the
language:
ptusespt-BR. - If the locale is empty or the generic generator has no data for its language
(for example
eu-ES),enis used. A value never takes the language of the previous value.
See Also
- Anonymize: the Use fake data method and its options
- Synthesize
- Custom functions:
genLabel - Labels