Skip to content

Commit

Permalink
feat: Transifex app remove the default locale restriction (contentful…
Browse files Browse the repository at this point in the history
  • Loading branch information
foteinigk authored May 20, 2024
1 parent eee55c9 commit e438d59
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions apps/transifex/src/locations/ConfigScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ function ConfigScreen() {
const [projectTargetLanguages, setProjectTargetLanguages] = useState([]);
const [selectedContentTypes, setSelectedContentTypes] = useState([]);
const [selectAllChecked, setSelectAllChecked] = useState(false);
const [defaultLocaleDoesNotMatch, setDefaultLocaleDoesNotMatch] = useState(false);
const [installationId, setInstallationId] = useState('');
const [appIsInstalled, setAppIsInstalled] = useState('');
const [pushTrigger, setPushTrigger] = useState('t');
Expand Down Expand Up @@ -269,16 +268,6 @@ function ConfigScreen() {
setProjectAlreadyConnected(
tokenData.data.attributes.is_project_connected,
);
if (locales && locales.length > 0) {
const defaultLocale = locales.filter(
(locale) => locale.default === true,
)[0];
if (defaultLocale.code.replace(/-/g, '_') !== key) {
setDefaultLocaleDoesNotMatch(true);
} else {
setDefaultLocaleDoesNotMatch(false);
}
}
setProjectType(tokenData.included[0].attributes.project_type);
}
if (tokenData && tokenData.included && tokenData.included[1]) {
Expand All @@ -296,13 +285,6 @@ function ConfigScreen() {
return false;
}

if (defaultLocaleDoesNotMatch) {
sdk.notifier.error(
"This space's default locale should match Transifex project's source language.",
);
return false;
}

if (projectAlreadyConnected) {
sdk.notifier.error(
'The selected project is connected already with another space. Please select another project.',
Expand Down Expand Up @@ -549,14 +531,6 @@ function ConfigScreen() {
</Note>
</Box>
)}
{defaultLocaleDoesNotMatch && (
<Box marginTop="spacingM" marginBottom="spacingM">
<Note variant="negative">
This space&apos;s default locale should match
Transifex project&apos;s source language
</Note>
</Box>
)}
<Heading>Connected Transifex Project</Heading>
<Paragraph>
Project name:&nbsp;
Expand Down

0 comments on commit e438d59

Please sign in to comment.