feat/Added translation option for text 'segment' (#4624)

This commit is contained in:
nithin-trenser 2025-01-03 21:08:34 +05:30 committed by GitHub
parent 4ef67c0cf7
commit 860679126a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 12 deletions

View File

@ -14,6 +14,7 @@ import {
} from '@cornerstonejs/tools';
import { Types as OhifTypes } from '@ohif/core';
import i18n from '@ohif/i18n';
import {
callLabelAutocompleteDialog,
showLabelAnnotationPopup,
@ -902,7 +903,7 @@ function commandsModule({
segments: options.createInitialSegment
? {
1: {
label: 'Segment 1',
label: `${i18n.t('Segment')} 1`,
active: true,
},
}

View File

@ -15,6 +15,7 @@ import {
Types as cstTypes,
} from '@cornerstonejs/tools';
import { PubSubService, Types as OHIFTypes } from '@ohif/core';
import i18n from '@ohif/i18n';
import { easeInOutBell, reverseEaseInOutBell } from '../../utils/transitions';
import { mapROIContoursToRTStructData } from './RTSTRUCT/mapROIContoursToRTStructData';
import { SegmentationRepresentations } from '@cornerstonejs/tools/enums';
@ -362,7 +363,7 @@ class SegmentationService extends PubSubService {
? options.segments
: {
1: {
label: 'Segment 1',
label: `${i18n.t('Segment')} 1`,
active: true,
},
},
@ -799,7 +800,7 @@ class SegmentationService extends PubSubService {
} = {}
): void {
if (config?.segmentIndex === 0) {
throw new Error('Segment index 0 is reserved for "no label"');
throw new Error(i18n.t('Segment') + ' index 0 is reserved for "no label"');
}
const csSegmentation = this.getCornerstoneSegmentation(segmentationId);
@ -813,7 +814,7 @@ class SegmentationService extends PubSubService {
// update the segmentation
if (!config.label) {
config.label = `Segment ${segmentIndex}`;
config.label = `${i18n.t('Segment')} ${segmentIndex}`;
}
const currentSegments = csSegmentation.segments;

View File

@ -2,6 +2,7 @@ import OHIF from '@ohif/core';
import * as cs from '@cornerstonejs/core';
import * as csTools from '@cornerstonejs/tools';
import { classes } from '@ohif/core';
import i18n from '@ohif/i18n';
import getThresholdValues from './utils/getThresholdValue';
import createAndDownloadTMTVReport from './utils/createAndDownloadTMTVReport';
@ -182,7 +183,7 @@ const commandsModule = ({ servicesManager, commandsManager, extensionManager }:
const segmentationId = await segmentationService.createLabelmapForDisplaySet(displaySet, {
label: `Segmentation ${currentSegmentations.length + 1}`,
segments: { 1: { label: 'Segment 1', active: true } },
segments: { 1: { label: `${i18n.t('Segment')} 1`, active: true } },
});
segmentationService.addSegmentationRepresentation(withPTViewportId, {