mirror of
https://github.com/imputnet/cobalt.git
synced 2025-12-16 13:08:52 +00:00
api/language-codes: remove region part of the language code
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service functionality (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Some checks are pending
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Run service tests / test service functionality (push) Waiting to run
Run service tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
and convert language codes if they're not 3 characters long
This commit is contained in:
@@ -49,5 +49,6 @@ const maps = {
|
||||
}
|
||||
|
||||
export const convertLanguageCode = (code) => {
|
||||
code = code.split("-")[0].split("_")[0];
|
||||
return maps[code.length]?.[code.toLowerCase()] || null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user