Skip to content

Commit

Permalink
feature: add quickpick strings (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
levivilet authored Dec 8, 2024
1 parent 32a72d9 commit 731fb2b
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/file-search-worker/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/file-search-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"@jest/globals": "^29.7.0",
"@lvce-editor/assert": "^1.3.0",
"@lvce-editor/fuzzy-search": "^1.0.0",
"@lvce-editor/i18n": "^1.1.0",
"@lvce-editor/rpc": "^1.4.0",
"@lvce-editor/verror": "^1.6.0",
"eslint": "9.15.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@lvce-editor/i18n'
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import * as I18NString from '../I18NString/I18NString.ts'

/**
* @enum {string}
*/
const UiStrings = {
Files: 'Files',
GoToFile: 'Go to file',
NoMatchingColorThemesFound: 'No matching color themes found',
NoMatchingResults: 'No matching results',
NoRecentlyOpenedFoldersFound: 'No recently opened folders found',
NoResults: 'No Results',
NoSymbolFound: 'No symbol found',
NoWorkspaceSymbolsFound: 'no workspace symbols found',
OpenRecent: 'Open Recent',
SelectColorTheme: 'Select Color Theme',
SelectToOpen: 'Select to open',
ShowAndRunCommands: 'Show And Run Commands',
TypeNameOfCommandToRun: 'Type the name of a command to run.',
TypeTheNameOfAViewToOpen: 'Type the name of a view, output channel or terminal to open.',
}

export const noMatchingColorThemesFound = (): string => {
return I18NString.i18nString(UiStrings.NoMatchingColorThemesFound)
}

export const selectColorTheme = (): string => {
return I18NString.i18nString(UiStrings.SelectColorTheme)
}

export const typeNameofCommandToRun = (): string => {
return I18NString.i18nString(UiStrings.TypeNameOfCommandToRun)
}

export const showAndRunCommands = (): string => {
return I18NString.i18nString(UiStrings.ShowAndRunCommands)
}

export const noMatchingResults = (): string => {
return I18NString.i18nString(UiStrings.NoMatchingResults)
}

export const files = (): string => {
return I18NString.i18nString(UiStrings.Files)
}

export const goToFile = (): string => {
return I18NString.i18nString(UiStrings.GoToFile)
}

export const noResults = (): string => {
return I18NString.i18nString(UiStrings.NoResults)
}

export const selectToOpen = (): string => {
return I18NString.i18nString(UiStrings.SelectToOpen)
}

export const openRecent = (): string => {
return I18NString.i18nString(UiStrings.OpenRecent)
}

export const noRecentlyOpenedFoldersFound = (): string => {
return I18NString.i18nString(UiStrings.NoRecentlyOpenedFoldersFound)
}

export const noSymbolFound = (): string => {
return I18NString.i18nString(UiStrings.NoSymbolFound)
}

export const noWorkspaceSymbolsFound = (): string => {
return I18NString.i18nString(UiStrings.NoWorkspaceSymbolsFound)
}

export const typeTheNameOfAViewToOpen = (): string => {
return I18NString.i18nString(UiStrings.TypeTheNameOfAViewToOpen)
}
58 changes: 58 additions & 0 deletions packages/file-search-worker/test/QuickPickStrings.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { expect, test } from '@jest/globals'
import * as QuickPickStrings from '../src/parts/QuickPickStrings/QuickPickStrings.ts'

test('files returns string', () => {
expect(QuickPickStrings.files()).toBe('Files')
})

test('goToFile returns string', () => {
expect(QuickPickStrings.goToFile()).toBe('Go to file')
})

test('noMatchingColorThemesFound returns string', () => {
expect(QuickPickStrings.noMatchingColorThemesFound()).toBe('No matching color themes found')
})

test('noMatchingResults returns string', () => {
expect(QuickPickStrings.noMatchingResults()).toBe('No matching results')
})

test('noRecentlyOpenedFoldersFound returns string', () => {
expect(QuickPickStrings.noRecentlyOpenedFoldersFound()).toBe('No recently opened folders found')
})

test('noResults returns string', () => {
expect(QuickPickStrings.noResults()).toBe('No Results')
})

test('noSymbolFound returns string', () => {
expect(QuickPickStrings.noSymbolFound()).toBe('No symbol found')
})

test('noWorkspaceSymbolsFound returns string', () => {
expect(QuickPickStrings.noWorkspaceSymbolsFound()).toBe('no workspace symbols found')
})

test('openRecent returns string', () => {
expect(QuickPickStrings.openRecent()).toBe('Open Recent')
})

test('selectColorTheme returns string', () => {
expect(QuickPickStrings.selectColorTheme()).toBe('Select Color Theme')
})

test('selectToOpen returns string', () => {
expect(QuickPickStrings.selectToOpen()).toBe('Select to open')
})

test('showAndRunCommands returns string', () => {
expect(QuickPickStrings.showAndRunCommands()).toBe('Show And Run Commands')
})

test('typeNameofCommandToRun returns string', () => {
expect(QuickPickStrings.typeNameofCommandToRun()).toBe('Type the name of a command to run.')
})

test('typeTheNameOfAViewToOpen returns string', () => {
expect(QuickPickStrings.typeTheNameOfAViewToOpen()).toBe('Type the name of a view, output channel or terminal to open.')
})

0 comments on commit 731fb2b

Please sign in to comment.