-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from bento-platform/refact/data-type-labels-u…
…sing-i18n refact: use i18n for data type / entity labels
- Loading branch information
Showing
15 changed files
with
94 additions
and
71 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// false count – just need the highest form of plural | ||
// - see https://www.i18next.com/translation-function/plurals | ||
export const T_PLURAL_COUNT = { count: 100 }; | ||
export const T_SINGULAR_COUNT = { count: 1 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,12 @@ | ||
export enum DataTypes { | ||
phenopacket = 'phenopacket', | ||
experiment = 'experiment', | ||
experiment_result = 'experiment_result', | ||
variant = 'variant', | ||
} | ||
import type { JSONSchema7 } from 'json-schema'; | ||
|
||
export const DataTypesLabels = { | ||
[DataTypes.phenopacket]: 'entities.Phenopackets', | ||
[DataTypes.experiment]: 'entities.Experiments', | ||
[DataTypes.experiment_result]: 'entities.Experiment Results', | ||
[DataTypes.variant]: 'entities.Variants', | ||
export type BentoDataType = { | ||
id: string; | ||
label: string; | ||
queryable: boolean; | ||
schema: JSONSchema7; | ||
metadata_schema: JSONSchema7; | ||
count?: number; | ||
}; | ||
|
||
export const getDataTypeLabel = (dataTypeString: string): string => { | ||
const dataTypesValues = Object.values(DataTypes) as string[]; | ||
if (dataTypesValues.includes(dataTypeString)) { | ||
const dataType: DataTypes = DataTypes[dataTypeString as keyof typeof DataTypes]; | ||
return DataTypesLabels[dataType]; | ||
} | ||
return 'Unknown Data Type'; | ||
}; | ||
export type BentoServiceDataType = BentoDataType & { service_base_url: string }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters