<style include="cr-shared-style settings-shared iron-flex">
/* Override the default padding of a cr-row to 0. The template inside has
left and right padding. */
.cr-row-with-template {
padding: 0;
}
/* Ensure the toggle button stretches the width of its container despite
removing its parent's padding. */
#liveCaptionToggleButton {
width: 100%;
}
.language-dropdown {
margin-inline-start: auto;
}
#captionsLanguageLabel {
color: var(--cros-sys-on_surface_variant);
}
</style>
<template is="dom-if" if="[[!enableLiveCaptionMultiLanguage_]]">
<div class="cr-row cr-row-with-template first">
<settings-toggle-button id="liveCaptionToggleButton"
pref="{{prefs.accessibility.captions.live_caption_enabled}}"
on-change="onLiveCaptionEnabledChanged_"
label="$i18n{captionsEnableLiveCaptionTitle}"
sub-label="[[enableLiveCaptionSubtitle_]]">
</settings-toggle-button>
</div>
</template>
<template is="dom-if" if="[[enableLiveCaptionMultiLanguage_]]">
<div class="cr-row cr-row-with-template first">
<settings-toggle-button id="liveCaptionToggleButton"
pref="{{prefs.accessibility.captions.live_caption_enabled}}"
on-change="onLiveCaptionEnabledChanged_"
label="$i18n{captionsEnableLiveCaptionTitle}"
sub-label="$i18n{captionsEnableLiveCaptionSubtitle}">
</settings-toggle-button>
</div>
<iron-collapse
opened="[[prefs.accessibility.captions.live_caption_enabled.value]]">
<div class="cr-row continuation">
<div class="start cr-padded-text" aria-hidden="true">
$i18n{captionsLanguage}
</div>
<settings-dropdown-menu
class="language-dropdown"
label="$i18n{captionsLanguage}"
pref="{{prefs.accessibility.captions.live_caption_language}}"
menu-options="[[languageOptions_]]">
</settings-dropdown-menu>
</div>
<div class="cr-row continuation">
<div class="flex settings-box-text">
$i18n{captionsManageLanguagesTitle}
<div class="secondary">$i18n{captionsManageLanguagesSubtitle}</div>
</div>
<cr-button id="addLanguage" on-click="onAddLanguagesClick_">
$i18n{addLanguages}
</cr-button>
</div>
<div class="list-frame">
<div id="languageList" class="vertical-list" role="list">
<template is="dom-repeat" items="[[installedLanguagePacks_]]">
<div class="list-item" role="listitem">
<div class="start cr-padded-text">[[item.displayName]]</div>
<span aria-live="polite" role="region" class="cr-secondary-text cr-row-gap">
[[item.downloadProgress]]
</span>
<cr-icon-button class="icon-delete-gray"
aria-label="[[i18n('removeLanguageAriaLabel',
item.displayName)]]"
on-click="onRemoveLanguageClick_">
</cr-icon-button>
</div>
</template>
</div>
</div>
<template is="dom-if" if="[[enableLiveTranslate_]]">
<settings-live-translate prefs="{{prefs}}"
languages="[[languages]]"
language-helper="[[languageHelper]]">
</settings-live-translate>
</template>
</iron-collapse>
</template>
<template is="dom-if" if="[[showAddLanguagesDialog_]]" restamp>
<os-settings-add-items-dialog
items="[[getLiveCaptionLanguages_()]]"
header="$i18n{addLanguagesDialogTitle}"
search-label="$i18n{searchLanguages}"
on-items-added="onLanguagesAdded_"
on-close="onAddLanguagesDialogClose_" id="liveCaptionsAddLanguagesDialog">
</os-settings-add-items-dialog>
</template>