Skip to content

Commit

Permalink
Remove localization feature flag and improve CI workflow (#10208)
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMalfait authored Feb 14, 2025
1 parent f2da915 commit 1090fb8
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 88 deletions.
50 changes: 0 additions & 50 deletions .github/workflows/i18n-compile.yaml

This file was deleted.

31 changes: 30 additions & 1 deletion .github/workflows/i18n-pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,37 @@ jobs:
github_base_url: 'github.com'
github_user_name: 'Crowdin Bot'
github_user_email: '[email protected]'

env:
GITHUB_TOKEN: ${{ github.token }}
CROWDIN_PROJECT_ID: '1'
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

- name: Compile translations
if: inputs.force_pull || steps.compile_translations.outcome == 'failure'
run: |
npx nx run twenty-server:lingui:compile
npx nx run twenty-emails:lingui:compile
npx nx run twenty-front:lingui:compile
- name: Check and commit compiled files
id: check_changes
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add .
if ! git diff --staged --quiet --exit-code; then
git commit -m "chore: compile translations [skip ci]"
echo "changes_detected=true" >> $GITHUB_OUTPUT
else
echo "changes_detected=false" >> $GITHUB_OUTPUT
fi
- name: Push changes
if: steps.check_changes.outputs.changes_detected == 'true'
run: git push origin HEAD:i18n

- name: Create pull request
if: steps.check_changes.outputs.changes_detected == 'true'
run: gh pr create -B main -H i18n --title 'i18n - translations' --body 'Created by Github action' || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .github/workflows/i18n-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
if ! git ls-remote --heads origin i18n | grep i18n; then
git checkout -b i18n
else
git fetch origin i18n
git checkout i18n
git merge origin/main
fi
Expand All @@ -44,6 +45,12 @@ jobs:
npx nx run twenty-emails:lingui:extract
npx nx run twenty-front:lingui:extract
- name: Compile translations
run: |
npx nx run twenty-server:lingui:compile
npx nx run twenty-emails:lingui:compile
npx nx run twenty-front:lingui:compile
- name: Check and commit any files created
id: check_changes
run: |
Expand Down
1 change: 0 additions & 1 deletion packages/twenty-front/src/generated-metadata/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,6 @@ export enum FeatureFlagKey {
IsCustomDomainEnabled = 'IsCustomDomainEnabled',
IsEventObjectEnabled = 'IsEventObjectEnabled',
IsJsonFilterEnabled = 'IsJsonFilterEnabled',
IsLocalizationEnabled = 'IsLocalizationEnabled',
IsNewRelationEnabled = 'IsNewRelationEnabled',
IsPermissionsEnabled = 'IsPermissionsEnabled',
IsPostgreSQLIntegrationEnabled = 'IsPostgreSQLIntegrationEnabled',
Expand Down
3 changes: 1 addition & 2 deletions packages/twenty-front/src/generated/graphql.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
import { gql } from '@apollo/client';
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
Expand Down Expand Up @@ -460,7 +460,6 @@ export enum FeatureFlagKey {
IsCustomDomainEnabled = 'IsCustomDomainEnabled',
IsEventObjectEnabled = 'IsEventObjectEnabled',
IsJsonFilterEnabled = 'IsJsonFilterEnabled',
IsLocalizationEnabled = 'IsLocalizationEnabled',
IsNewRelationEnabled = 'IsNewRelationEnabled',
IsPermissionsEnabled = 'IsPermissionsEnabled',
IsPostgreSQLIntegrationEnabled = 'IsPostgreSQLIntegrationEnabled',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@ import { SettingsPageContainer } from '@/settings/components/SettingsPageContain
import { SettingsPath } from '@/types/SettingsPath';
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
import { useColorScheme } from '@/ui/theme/hooks/useColorScheme';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';

import { Trans, useLingui } from '@lingui/react/macro';
import { FeatureFlagKey } from '~/generated/graphql';
import { DateTimeSettings } from '~/pages/settings/profile/appearance/components/DateTimeSettings';
import { LocalePicker } from '~/pages/settings/profile/appearance/components/LocalePicker';
import { getSettingsPath } from '~/utils/navigation/getSettingsPath';

export const SettingsExperience = () => {
const { colorScheme, setColorScheme } = useColorScheme();

const isLocalizationEnabled = useIsFeatureEnabled(
FeatureFlagKey.IsLocalizationEnabled,
);

const { t } = useLingui();

return (
Expand Down Expand Up @@ -51,15 +45,13 @@ export const SettingsExperience = () => {
<DateTimeSettings />
</Section>

{isLocalizationEnabled && (
<Section>
<H2Title
title={t`Language`}
description={t`Select your preferred language`}
/>
<LocalePicker />
</Section>
)}
<Section>
<H2Title
title={t`Language`}
description={t`Select your preferred language`}
/>
<LocalePicker />
</Section>
</SettingsPageContainer>
</SubMenuTopBarContainer>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ export const seedFeatureFlags = async (
workspaceId: workspaceId,
value: true,
},
{
key: FeatureFlagKey.IsLocalizationEnabled,
workspaceId: workspaceId,
value: true,
},
{
key: FeatureFlagKey.IsRichTextV2Enabled,
workspaceId: workspaceId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,11 @@ type FeatureFlagMetadata = {
};

export type PublicFeatureFlag = {
key: Extract<
FeatureFlagKey,
FeatureFlagKey.IsLocalizationEnabled | FeatureFlagKey.IsWorkflowEnabled
>;
key: Extract<FeatureFlagKey, FeatureFlagKey.IsWorkflowEnabled>;
metadata: FeatureFlagMetadata;
};

export const PUBLIC_FEATURE_FLAGS: PublicFeatureFlag[] = [
{
key: FeatureFlagKey.IsLocalizationEnabled,
metadata: {
label: 'Localization',
description:
"Enable this and go to Settings > Experience to change your account's language. You can also help us improve the translations on Github.",
imagePath: 'https://twenty.com/images/releases/labs/translation.png',
},
},
{
key: FeatureFlagKey.IsWorkflowEnabled,
metadata: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export enum FeatureFlagKey {
IsCommandMenuV2Enabled = 'IS_COMMAND_MENU_V2_ENABLED',
IsJsonFilterEnabled = 'IS_JSON_FILTER_ENABLED',
IsCustomDomainEnabled = 'IS_CUSTOM_DOMAIN_ENABLED',
IsLocalizationEnabled = 'IS_LOCALIZATION_ENABLED',
IsBillingPlansEnabled = 'IS_BILLING_PLANS_ENABLED',
IsRichTextV2Enabled = 'IS_RICH_TEXT_V2_ENABLED',
IsNewRelationEnabled = 'IS_NEW_RELATION_ENABLED',
Expand Down

0 comments on commit 1090fb8

Please sign in to comment.