Skip to content

Commit

Permalink
[frontend] exclude x86_64 and arm64 from translation for label
Browse files Browse the repository at this point in the history
  • Loading branch information
isselparra committed Oct 7, 2024
1 parent 4c518b7 commit e1d382f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useFormatter } from '../../../i18n';
import type { Filter, PropertySchemaDTO } from '../../../../utils/api-types';
import { FilterHelpers } from './FilterHelpers';
import useSearchOptions from './useSearchOptions';
import wordsToExcludeFromTranslation from './WordsToExcludeFromTranslation';

interface Props {
filter: Filter;
Expand Down Expand Up @@ -54,7 +55,10 @@ export const BasicSelectInput: FunctionComponent<Props & { propertySchema: Prope
const { options, setOptions, searchOptions } = useSearchOptions();
useEffect(() => {
if (propertySchema.schema_property_values && propertySchema.schema_property_values?.length > 0) {
setOptions(propertySchema.schema_property_values.map((v) => ({ id: v, label: t(v.charAt(0).toUpperCase() + v.slice(1).toLowerCase()) })));
setOptions(propertySchema.schema_property_values.map((value) => {
const label = wordsToExcludeFromTranslation.includes(value) ? value : t(value.charAt(0).toUpperCase() + value.slice(1).toLowerCase());
return ({ id: value, label });
}));
} else {
searchOptions(filter.key);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const wordsToExclude = ['MacOS', 'x86_64', 'arm64'];

export default wordsToExclude;

0 comments on commit e1d382f

Please sign in to comment.