|
37 | 37 | fontMatcher, formatFileFilter, formatInt, formatTime, formatTimeStamp, |
38 | 38 | formatVersion, fuzzyTime, getFileSize, hexToInt, isHandle, isItemClass, |
39 | 39 | isItemLayout, isItemType, isListInstance, isTitleTag, joinLines, |
40 | | - jsonCombine, jsonEncode, makeFileNameSafe, minmax, numberToRoman, |
41 | | - openExternalPath, processDialogSymbols, readTextFile, simplified, |
42 | | - transferCase, uniqueCompact, utf16CharMap, xmlElement, xmlIndent, |
43 | | - xmlSubElem, yesNo |
| 40 | + jsonCombine, jsonEncode, languageName, makeFileNameSafe, minmax, |
| 41 | + numberToRoman, openExternalPath, processDialogSymbols, processLangCode, |
| 42 | + readTextFile, simplified, transferCase, uniqueCompact, utf16CharMap, |
| 43 | + xmlElement, xmlIndent, xmlSubElem, yesNo |
44 | 44 | ) |
45 | 45 | from novelwriter.enum import nwItemClass |
46 | 46 |
|
@@ -411,6 +411,21 @@ def testBaseCommon_processDialogSymbols(): |
411 | 411 | assert processDialogSymbols("-\u2013\u2014\u2015") == "\u2013\u2014\u2015" |
412 | 412 |
|
413 | 413 |
|
| 414 | +@pytest.mark.base |
| 415 | +def testBaseCommon_processLangCode(): |
| 416 | + """Test the processLangCode function.""" |
| 417 | + assert processLangCode("") == "" |
| 418 | + assert processLangCode(" ") == "" |
| 419 | + assert processLangCode("en") == "en-US" |
| 420 | + assert processLangCode("en_gb") == "en-GB" |
| 421 | + |
| 422 | + |
| 423 | +@pytest.mark.base |
| 424 | +def testBaseCommon_languageName(): |
| 425 | + """Test the languageName function.""" |
| 426 | + assert languageName("en-GB") == "British English" |
| 427 | + |
| 428 | + |
414 | 429 | @pytest.mark.base |
415 | 430 | def testBaseCommon_elide(): |
416 | 431 | """Test the elide function.""" |
|
0 commit comments