The Intl.Locale.prototype.minimize() method attempts to remove information about the locale that would be added by calling Locale.maximize().



Return value

A Locale instance whose baseName property returns the result of the Remove Likely Subtags algorithm executed against locale.baseName


This method carries out the reverse of maximize(), removing any language, script, or region subtags from the locale language identifier (essentially the contents of baseName). This is useful when there are superfluous subtags in the language identifier; for instance, "en-Latn" can be simplified to "en", since "Latn" is the only script used to write English. minimize() only affects the main subtags that comprise the language identifier: language, script, and region subtags. Other subtags after the "-u" in the locale indentifier are called extension subtags and are not affected by the minimize() method. Examples of these subtags include Locale.hourCycle, Locale.calendar, and Locale.numeric.


Using minimize

let myLocale = new Intl.Locale("fr-Latn-FR", {hourCycle: "h24", calendar: "gregory"});
console.log(myLocale.baseName); // Prints "fr-Latn-FR"
console.log(myLocale.toString()); // Prints "fr-Latn-FR-u-ca-gregory-hc-h24"

let myLocMinimized = myLocale.minimize();

// Prints "fr", since French is only written in the Latin script
// and is most likely to be spoken in France.

// Prints "fr-u-ca-gregory-hc-h24". 
// Note that the extension tags (after "-u") remain unchanged.


ECMAScript Internationalization API (ECMA-402)

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
minimizeChrome Full support 74Edge Full support 79Firefox Full support 75IE No support NoOpera Full support 62Safari No support NoWebView Android Full support 74Chrome Android Full support 74Firefox Android No support NoOpera Android Full support 53Safari iOS No support NoSamsung Internet Android Full support 11.0nodejs Full support 12.0.0
Full support 12.0.0
Notes Before version 13.0.0, only the locale data for en-US is available by default. See the Locale() constructor for more details.


Full support  
Full support
No support  
No support
See implementation notes.
See implementation notes.

See also