enable hide localization toggle (#4004)

## What type of PR is this? (check all applicable)

- [ ] Refactor
- [ ] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
- [ ] Community Node Submission


## Have you discussed this change with the InvokeAI team?
- [ ] Yes
- [ ] No, because:

      
## Have you updated all relevant documentation?
- [ ] Yes
- [ ] No


## Description


## Related Tickets & Documents

<!--
For pull requests that relate or close an issue, please include them
below. 

For example having the text: "closes #1234" would connect the current
pull
request to issue 1234.  And when we merge the pull request, Github will
automatically close the issue.
-->

- Related Issue #
- Closes #

## QA Instructions, Screenshots, Recordings

<!-- 
Please provide steps on how to test changes, any hardware or 
software specifications as well as any other pertinent information. 
-->

## Added/updated tests?

- [ ] Yes
- [ ] No : _please replace this line with details on why tests
      have not been included_

## [optional] Are there any post deployment tasks we need to perform?
This commit is contained in:
blessedcoolant 2023-07-27 03:01:52 +12:00 committed by GitHub
commit 13ac5c6899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,6 +104,7 @@ type ConfigOptions = {
shouldShowAdvancedOptionsSettings: boolean; shouldShowAdvancedOptionsSettings: boolean;
shouldShowClearIntermediates: boolean; shouldShowClearIntermediates: boolean;
shouldShowNodesToggle: boolean; shouldShowNodesToggle: boolean;
shouldShowLocalizationToggle: boolean;
}; };
type SettingsModalProps = { type SettingsModalProps = {
@ -125,6 +126,8 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
const shouldShowClearIntermediates = const shouldShowClearIntermediates =
config?.shouldShowClearIntermediates ?? true; config?.shouldShowClearIntermediates ?? true;
const shouldShowNodesToggle = config?.shouldShowNodesToggle ?? true; const shouldShowNodesToggle = config?.shouldShowNodesToggle ?? true;
const shouldShowLocalizationToggle =
config?.shouldShowLocalizationToggle ?? true;
useEffect(() => { useEffect(() => {
if (!shouldShowDeveloperSettings) { if (!shouldShowDeveloperSettings) {
@ -325,16 +328,18 @@ const SettingsModal = ({ children, config }: SettingsModalProps) => {
onChange={handleToggleNodes} onChange={handleToggleNodes}
/> />
)} )}
<IAIMantineSelect {shouldShowLocalizationToggle && (
disabled={!isLocalizationEnabled} <IAIMantineSelect
label={t('common.languagePickerLabel')} disabled={!isLocalizationEnabled}
value={language} label={t('common.languagePickerLabel')}
data={Object.entries(LANGUAGES).map(([value, label]) => ({ value={language}
value, data={Object.entries(LANGUAGES).map(([value, label]) => ({
label, value,
}))} label,
onChange={handleLanguageChanged} }))}
/> onChange={handleLanguageChanged}
/>
)}
</StyledFlex> </StyledFlex>
{shouldShowDeveloperSettings && ( {shouldShowDeveloperSettings && (