Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui-prompting): enhancement for translation input to provide annotation information of translation entry #2448

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions packages/ui-prompting/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
GuiOptions as BaseGuiOptions
} from '@sap-ux/inquirer-common';
import type { I18nBundle, TranslationEntry } from '@sap-ux/ui-components';
import type { SapTextType } from '@sap-ux/i18n';

export { Answers };

Expand Down Expand Up @@ -60,16 +61,29 @@ export interface ListPromptQuestionCreationProps {
placeholder?: string;
}

/**
* Translation properties for translatable entry.
*/
export interface TranslationProperties {
/**
* Text types for translatable entry.
*/
type: SapTextType;

/**
* Description of the annotation for a new entry in the translation file.
*/
annotation?: string;
}

/**
* Extended GUI interface for list question.
*/
export interface InputGuiOptions extends GuiOptions {
/**
* Renders the input field as translatable, allowing the creation of i18n entries with i18n binding.
*
* @default false
* Translation properties for translatable input. If this is defined, the input is considered translatable.
*/
translatable?: boolean;
translationProperties?: TranslationProperties;
}

/**
Expand Down
Loading