Skip to content

Commit

Permalink
fix: capitalized correction for native name
Browse files Browse the repository at this point in the history
  • Loading branch information
kabeep committed May 9, 2024
1 parent 21bc790 commit d3781b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/iso-639-1-x.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Iso6391X {
* @returns {string} - The name of the language.
*/
getName(code: string) {
return additionalCodes[code.toString() as AdditionalCode]?.name ?? iso6391.getName(code);
return additionalCodes[code.toLowerCase() as AdditionalCode]?.name ?? iso6391.getName(code);
}

/**
Expand All @@ -51,7 +51,7 @@ class Iso6391X {
* @returns {string} - The native name of the language.
*/
getNativeName(code: string) {
return additionalCodes[code.toString() as AdditionalCode]?.nativeName ?? iso6391.getNativeName(code);
return additionalCodes[code.toLowerCase() as AdditionalCode]?.nativeName ?? iso6391.getNativeName(code);
}

/**
Expand Down Expand Up @@ -93,7 +93,7 @@ class Iso6391X {
for (const code of codes) {
if (has(additionalCodes, code.toLowerCase())) {
googleLanguages.push({
code: code as LanguageCode,
code: code.toLowerCase() as LanguageCode,
...(additionalCodes as Record<string, AdditionalCodeOption>)[code],
});
} else {
Expand Down

0 comments on commit d3781b1

Please sign in to comment.