Home Reference Source Test Repository

Function

Static Public Summary
public

Normalizes language codes by case and separator.

Static Public

public normalizeLanguageCode(langCode: String): String source

import {normalizeLanguageCode} from 'electron-spellchecker/src/utility.js'

Normalizes language codes by case and separator. Unfortunately, different platforms have slightly different standards for language codes (i.e. 'en_US' vs 'en-us'). This method flattens them all to the way that Chromium uses internally

Params:

NameTypeAttributeDescription
langCode String

The language code to normalize

Return:

String

The language code in Chromium format.