Skip to content

Commit

Permalink
fix - Use display text, instead of the language code in the palette, …
Browse files Browse the repository at this point in the history
…to avoid showing GB instead of UK (#208)
  • Loading branch information
andreituicu authored Jan 5, 2024
1 parent 9aefc02 commit 8b73bf0
Show file tree
Hide file tree
Showing 8 changed files with 63,816 additions and 14 deletions.
10,428 changes: 10,428 additions & 0 deletions tools/picker/dist/index.4d663569.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tools/picker/dist/index.4d663569.css.map

Large diffs are not rendered by default.

53,371 changes: 53,371 additions & 0 deletions tools/picker/dist/index.975ef6c8.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tools/picker/dist/index.975ef6c8.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tools/picker/dist/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>ServiceNow Picker</title><link rel="stylesheet" href="index.8eb0d878.css"></head><body> <div id="app"></div> <script type="module" src="index.048ec8c9.js"></script> </body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>ServiceNow Picker</title><link rel="stylesheet" href="index.8eb0d878.css"></head><body> <div id="app"></div> <script type="module" src="index.a99f3fad.js"></script> </body></html>
19 changes: 10 additions & 9 deletions tools/picker/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ const liveURL = (path) => {
}

const LOCALES = [
'en-US',
'en-GB',
'de-DE',
'fr-FR',
'nl-NL',
{ display: 'US', key: 'en-US' },
{ display: 'UK', key: 'en-GB' },
{ display: 'DE', key: 'de-DE' },
{ display: 'FR', key: 'fr-FR' },
{ display: 'NL', key: 'nl-NL' },
];

const getItems = async (folderKey, page = 1) => {
Expand All @@ -36,14 +36,15 @@ const getItems = async (folderKey, page = 1) => {

if (folderKey === 'Authors') {
return LOCALES.map((locale) => ({
key : `Authors/${locale}`,
name: locale,
key : `Authors/${locale.display}`,
name: locale.display,
}));
}

if (folderKey && folderKey.startsWith('Authors/')) {
const locale = folderKey.split('/')[1];
return getAuthors(locale);
const localeDisplay = folderKey.split('/')[1];
const locale = LOCALES.find((locale) => locale.display === localeDisplay);
return getAuthors(locale?.key);
}

return [
Expand Down

0 comments on commit 8b73bf0

Please sign in to comment.