Skip to content

Commit

Permalink
Localizes job forms
Browse files Browse the repository at this point in the history
  • Loading branch information
gingi committed May 30, 2023
1 parent b63287a commit 0bc8e7e
Show file tree
Hide file tree
Showing 17 changed files with 408 additions and 169 deletions.
84 changes: 84 additions & 0 deletions desktop/i18n/resources.resjson
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,38 @@
"certificate-references-picker.addOne": "Add a certificate",
"certificate-references-picker.duplicate": "Cannot reference the same certificate twice {thumbprint}",
"certificate-references-picker.noCertificates": "No certificate(s) found for this batch account, please upload your certificate(s) first.",
"common.application": "Application",
"common.apply": "Apply",
"common.back": "Back",
"common.configuration": "Configuration",
"common.confirm": "Confirm",
"common.creationTime": "Creation time",
"common.displayName": "Display name",
"common.done": "Done",
"common.general": "General",
"common.id": "ID",
"common.job": "Job",
"common.jobs": "Jobs",
"common.key": "Key",
"common.lastModified": "Last modified",
"common.learnMore": "Learn more",
"common.listbox": "Listbox",
"common.loading": "Loading",
"common.metadata": "Metadata",
"common.no": "No",
"common.none": "None",
"common.pool": "Pool",
"common.pools": "Pools",
"common.rebootAll": "Reboot all",
"common.refresh": "Refresh",
"common.refreshing": "Refreshing",
"common.required": "Required",
"common.state": "State",
"common.task": "Task",
"common.tasks": "Tasks",
"common.updated": "Updated",
"common.value": "Value",
"common.version": "Version",
"common.yes": "Yes",
"create-new-aad-app.create": "Create",
"create-new-aad-app.secret.label": "Secret",
Expand Down Expand Up @@ -144,6 +162,72 @@
"job-state.disabling.message": "Job is in the process of being disabled",
"job-state.enabling.message": "Job is returning from disabled stated",
"job-state.terminating.message": "Job is terminating",
"job.desc.generalInfo": "Basic information about the job.",
"job.desc.jobAdvancedSettings": "Specify job advanced settings including constraints, environment settings, etc.",
"job.desc.jobConfigurationTask": "Specify job manager task, job preparation task and job release task. A job release task cannot be specified without a job preparation task.",
"job.desc.poolSelection": "Choose where the job should be running.",
"job.error.belowMin": "Must be greater than or equal to {min}",
"job.error.failedTask": "Job was terminated because a task failed.",
"job.error.idPattern": "Can only contain any combination of alphanumeric characters, including hyphens and underscores",
"job.error.maxLength": "Maximum length of {max} characters",
"job.error.notInRange": "Values can range from {min} to {max}",
"job.error.poolRequired": "You must select a pool for this job to run on",
"job.error.timedOut": "Job timed out after running for {time}.",
"job.hint.nOfMaxCharacters": "{num} out of {max} characters",
"job.label.addJob": "Add a job",
"job.label.commandLine": "Command line",
"job.label.commonEnvVars": "Common environment variables",
"job.label.completedInTime": "Completed in {time}",
"job.label.constraints": "Constraints",
"job.label.containerImageName": "Container image name",
"job.label.containerRunOptions": "Container run options",
"job.label.containerSettings": "Container settings",
"job.label.currentlyActiveFor": "Currently active for {time}",
"job.label.displayName": "Display name",
"job.label.enableTaskDeps": "Enable task dependencies",
"job.label.endTime": "End time",
"job.label.envSettingCount": "{count} environment settings",
"job.label.environmentSettings": "Environment settings",
"job.label.environmentVariables": "Environment variables",
"job.label.executionInfo": "Execution information",
"job.label.executionTime": "Execution time",
"job.label.generalInfo": "General info",
"job.label.hasNoEnvVars": "This job contains no environment settings",
"job.label.hasNoMetadata": "This job contains no metadata",
"job.label.hasNoTags": "No tags",
"job.label.jobAdvancedSettings": "Job advanced settings",
"job.label.jobConfigurationTask": "Job configuration task",
"job.label.jobManagerTask": "Job manager task",
"job.label.jobNotStarted": "Job not started",
"job.label.jobPreparationTask": "Job preparation task",
"job.label.jobReleaseTask": "Job release task",
"job.label.jobStatistics": "Job statistics",
"job.label.killJobOnCompletion": "Kill job on completion",
"job.label.maxTaskRetryCount": "Max task retry count",
"job.label.maxWallClockTime": "Max wall-clock time",
"job.label.metadata": "Metadata",
"job.label.metadataItemCount": "{count} metadata items",
"job.label.onAllTasksComplete": "When all tasks complete",
"job.label.onTaskFailure": "When a task fails",
"job.label.packageReferences": "Package references",
"job.label.poolSelection": "Pool selection",
"job.label.prepReleaseTasks": "Prep/Release tasks",
"job.label.previousState": "Previous state",
"job.label.previousStateTransitionTime": "Previous state transition time",
"job.label.priority": "Priority",
"job.label.registryServer": "Registry server",
"job.label.registryUsername": "Registry username",
"job.label.requiredSlots": "Required slots",
"job.label.rerunOnNodeReboot": "Rerun on node reboot",
"job.label.retentionTime": "Retention time",
"job.label.runElevated": "Run elevated",
"job.label.runExclusive": "Run exclusive",
"job.label.startTime": "Start time",
"job.label.stateTransitionTime": "State transition time",
"job.label.taskDependencies": "Task dependencies",
"job.label.terminationReason": "Termination reason",
"job.label.viewFailedTasks": "View failed tasks",
"job.label.waitForSuccess": "Wait for success",
"list-base.filterApplied": "New filter applied, {count} results",
"list-base.filterCleared": "Filter cleared, {count} results",
"location-picker.noLocationInSubscription": "No locations available in subscription '{name}'",
Expand Down
18 changes: 18 additions & 0 deletions desktop/src/@batch-flask/ui/common.i18n.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
# To put here some common translations that are reused across the app
common:
application: Application
apply: Apply
back: Back
configuration: Configuration
creationTime: Creation time
confirm: Confirm
displayName: Display name
done: Done
general: General
id: ID
job: Job
jobs: Jobs
key: Key
lastModified: Last modified
learnMore: Learn more
listbox: Listbox
loading: Loading
metadata: Metadata
no: "No"
none: None
pool: Pool
pools: Pools
rebootAll: Reboot all
refresh: Refresh
refreshing: Refreshing
required: Required
state: State
task: Task
tasks: Tasks
updated: Updated
value: Value
version: Version
yes: "Yes"
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<bl-select [ngModel]="unit"
(ngModelChange)="updateUnit($event)"
[placeholder]="'duration-picker.unit.label' | i18n"
[disabled]="disabled"
attr.aria-label="{{label}} {{'duration-picker.unit.label' | i18n}}">
[disabled]="disabled">

<bl-option [value]="DurationUnit.Unlimited" [label]="'duration-picker.unit.unlimited' | i18n" *ngIf="allowUnlimited"></bl-option>
<bl-option [value]="DurationUnit.Days" [label]="'duration-picker.unit.days' | i18n"></bl-option>
Expand Down
52 changes: 27 additions & 25 deletions desktop/src/app/components/job/action/add/add-job-form.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@
<bl-complex-form [formGroup]="form" [submit]="submit" [containerRef]="sidebarRef" [config]="complexFormConfig" [fileUri]="fileUri">
<bl-form-page main-form-page [title]="title" [subtitle]="subtitle" [formGroup]="form">
<bl-form-section title="General info" subtitle="Basic information about the job">
<bl-form-section title="{{'job.label.generalInfo' | i18n}}" subtitle="{{'job.desc.generalInfo' | i18n}}">
<div class="grow">
<div class="gcol">
<bl-form-field class="form-element required">
<input blInput #idInput formControlName="id" placeholder="ID" maxlength="64">
<input blInput #idInput formControlName="id" placeholder="{{'common.id' | i18n}}" maxlength="64">

<bl-hint align="end" attr.aria-label="{{idInput.value.length}} characters out of 64">{{idInput.value.length}} / 64</bl-hint>
<bl-hint align="end" attr.aria-label="{{'job.hint.nOfMaxCharacters'|i18n: { 'num': idInput.value.length, 'max': 64} }}">
{{idInput.value.length}} / 64
</bl-hint>

<bl-error controlName="id" code="required">{{'common.required' | i18n }}</bl-error>
<bl-error controlName="id" code="maxlength">ID has a maximum length of 64 characters</bl-error>
<bl-error controlName="id" code="pattern">ID can contain any combination of alphanumeric characters including hyphens and underscores.</bl-error>
<bl-error controlName="id" code="maxlength">{{'job.error.maxLength' | i18n: { 'max': 64 } }}</bl-error>
<bl-error controlName="id" code="pattern">{{'job.error.idPattern' | i18n }}</bl-error>
</bl-form-field>
</div>
<div class="gcol">
<bl-form-field class="form-element">
<input blInput formControlName="displayName" placeholder="Display name">
<bl-error controlName="displayName" code="maxlength">Display name has a maximum length of 1024 characters</bl-error>
<input blInput formControlName="displayName" placeholder="{{'job.label.displayName' | i18n}}">
<bl-error controlName="displayName" code="maxlength">{{'job.error.maxLength' | i18n: { 'max': 1024 } }}</bl-error>
</bl-form-field>
</div>
</div>
<div class="form-element">
<bl-key-value-picker label="Common environment variables" formControlName="commonEnvironmentSettings">
<bl-key-value-picker label="{{'job.label.commonEnvVars' | i18n}}" formControlName="commonEnvironmentSettings">
</bl-key-value-picker>
<bl-error controlName="priority" code="validateRange">Priority values can range from -1000 to 1000</bl-error>
<bl-error controlName="priority" code="validateRange">{{'job.error.notInRange'| i18n: { 'min': -100, 'max': 100 } }}</bl-error>
</div>
<div class="form-element">
<bl-key-value-picker formControlName="metadata" label="Metadata"></bl-key-value-picker>
<bl-key-value-picker formControlName="metadata" label="{{'job.label.metadata' | i18n}}"></bl-key-value-picker>
</div>
</bl-form-section>
<bl-form-section *ngIf="showPoolPicker" title="Pool selection" subtitle="Choose where the job should be running">
<bl-form-section *ngIf="showPoolPicker" title="{{'job.label.poolSelection' | i18n}}" subtitle="{{'job.desc.poolSelection' | i18n}}">
<div class="form-element">
<bl-pool-picker formControlName="poolInfo"></bl-pool-picker>
<bl-error controlName="poolInfo" code="required">You must select a pool for this job to run on</bl-error>
<bl-error controlName="poolInfo" code="required">{{'job.error.poolRequired' | i18n}}</bl-error>
</div>
</bl-form-section>
<bl-form-section *ngIf="showJobConfiguration" title="Job configuration task" subtitle="Specify job manager task, job preparation task and job release task. A job release task cannot be specified without a job preparation task.">
<bl-form-section *ngIf="showJobConfiguration" title="{{'job.label.jobConfigurationTask' | i18n}}" subtitle="{{'job.desc.jobConfigurationTask' | i18n}}">
<bl-form-picker formControlName="jobManagerTask" #jobManagerTaskPicker>
<div no-value-title>Job manager task</div>
<div no-value-title>{{'job.label.jobManagerTask' | i18n}}</div>
<div value-title>{{jobManagerTask?.id}}</div>
<div nested-form>
<bl-job-manager-task-picker
Expand All @@ -48,7 +50,7 @@
</div>
</bl-form-picker>
<bl-form-picker formControlName="jobPreparationTask" (clear)="resetJobPreparationTask()" #jobPreparationTaskPicker>
<div no-value-title>Job preparation task</div>
<div no-value-title>{{'job.label.jobPreparationTask' | i18n}}</div>
<div value-title>{{jobPreparationTask?.id}}</div>
<div nested-form>
<bl-job-preparation-task-picker
Expand All @@ -59,7 +61,7 @@
</div>
</bl-form-picker>
<bl-form-picker *ngIf="showJobReleaseTask" formControlName="jobReleaseTask" #jobReleaseTaskPicker>
<div no-value-title>Job release task</div>
<div no-value-title>{{'job.label.jobReleaseTask' | i18n}}</div>
<div value-title>{{jobReleaseTask?.id}}</div>
<div nested-form>
<bl-job-release-task-picker
Expand All @@ -70,40 +72,40 @@
</div>
</bl-form-picker>
</bl-form-section>
<bl-form-section title="Job advanced settings" subtitle="Specify job advanced settings including constraints, environment settings and so on.">
<bl-form-section title="{{'job.label.jobAdvancedSettings' | i18n}}" subtitle="{{'job.desc.jobAdvancedSettings' | i18n}}">
<div class="form-element">
<bl-form-field>
<input blInput formControlName="priority" placeholder="Priority" type="number" min="-1000" max="1000">
<input blInput formControlName="priority" placeholder="{{'job.label.priority' | i18n}}" type="number" min="-1000" max="1000">
</bl-form-field>
<bl-error controlName="priority" code="validateRange">Priority values can range from -1000 to 1000</bl-error>
<bl-error controlName="priority" code="validateRange">{{'job.error.notInRange' | i18n:{'min': -1000, 'max': 1000} }}</bl-error>
</div>
<div formGroupName="constraints">
<bl-form-field>
<bl-duration-picker formControlName="maxWallClockTime" label="Max wall-clock time"></bl-duration-picker>
<bl-duration-picker formControlName="maxWallClockTime" label="{{'job.label.maxWallClockTime' | i18n}}"></bl-duration-picker>
</bl-form-field>
<bl-form-field>
<input blInput formControlName="maxTaskRetryCount" placeholder="Max retry count" type="number" min="-1" max="100">
<bl-error controlName="maxTaskRetryCount" code="validateRange">Retry count values can range from -1 to 100</bl-error>
<input blInput formControlName="maxTaskRetryCount" placeholder="{{'job.label.maxTaskRetryCount' | i18n}}" type="number" min="-1" max="100">
<bl-error controlName="maxTaskRetryCount" code="validateRange">{{'job.error.notInRange' | i18n:{'min': -1, 'max': 100} }}</bl-error>
</bl-form-field>
</div>
<div class="form-element">
<bl-form-field>
<bl-select formControlName="onAllTasksComplete" color="primary" placeholder="When all tasks complete">
<bl-select formControlName="onAllTasksComplete" color="primary" placeholder="{{'job.label.onAllTasksComplete' | i18n}}">
<bl-option [value]="AllTasksCompleteAction.noaction" label="NoAction"></bl-option>
<bl-option [value]="AllTasksCompleteAction.terminatejob" label="TerminateJob"></bl-option>
</bl-select>
</bl-form-field>
</div>
<div class="form-element">
<bl-form-field>
<bl-select formControlName="onTaskFailure" color="primary" placeholder="When a task fails">
<bl-select formControlName="onTaskFailure" color="primary" placeholder="{{'job.label.onTaskFailure' | i18n}}">
<bl-option [value]="TaskFailureAction.noaction" label="NoAction"></bl-option>
<bl-option [value]="TaskFailureAction.performexitoptionsjobaction" label="PerformExitOptionsJobAction"></bl-option>
</bl-select>
</bl-form-field>
</div>
<div class="form-element">
<mat-checkbox color="primary" formControlName="usesTaskDependencies">Enable task dependency</mat-checkbox>
<mat-checkbox color="primary" formControlName="usesTaskDependencies">{{'job.label.enableTaskDeps' | i18n}}</mat-checkbox>
</div>
</bl-form-section>
</bl-form-page>
Expand Down
Loading

0 comments on commit 0bc8e7e

Please sign in to comment.