Skip to content

The open alternative to Salesforce, designed for AI.

Stop showing lines on translation files (#10313)

Félix Malfait7f4b5795bf6f
diff --git a/.github/workflows/i18n-pull.yaml b/.github/workflows/i18n-pull.yaml
index 763d21885e6..25fb0aa4cf0 100644
--- a/.github/workflows/i18n-pull.yaml
+++ b/.github/workflows/i18n-pull.yaml
@@ -76,7 +76,7 @@ jobs:
download_translations: true
export_only_approved: false
localization_branch_name: i18n
- commit_message: 'i18n - translations'
+ commit_message: 'i18n - pull translations'
pull_request_title: 'i18n - translations'
base_url: 'https://twenty.api.crowdin.com'
auto_approve_imported: false
diff --git a/.github/workflows/i18n-push.yaml b/.github/workflows/i18n-push.yaml
index a99ab018249..b65438f4bac 100644
--- a/.github/workflows/i18n-push.yaml
+++ b/.github/workflows/i18n-push.yaml
@@ -40,31 +40,44 @@ jobs:
npx nx run twenty-emails:lingui:extract
npx nx run twenty-front:lingui:extract
+ - name: Check and commit extracted files
+ id: check_extract_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: extract translations"
+ echo "changes_detected=true" >> $GITHUB_OUTPUT
+ else
+ echo "changes_detected=false" >> $GITHUB_OUTPUT
+ fi
+
- 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
+ - name: Check and commit compiled files
+ id: check_compile_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: extract translations"
+ git commit -m "chore: compile translations"
echo "changes_detected=true" >> $GITHUB_OUTPUT
else
echo "changes_detected=false" >> $GITHUB_OUTPUT
fi
- name: Push changes and create remote branch if needed
- if: steps.check_changes.outputs.changes_detected == 'true'
+ if: steps.check_extract_changes.outputs.changes_detected == 'true' || steps.check_compile_changes.outputs.changes_detected == 'true'
run: git push origin HEAD:i18n
- name: Upload missing translations
- if: steps.check_changes.outputs.changes_detected == 'true'
+ if: steps.check_extract_changes.outputs.changes_detected == 'true'
uses: crowdin/github-action@v2
with:
upload_sources: true
@@ -80,7 +93,7 @@ jobs:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
- name: Create a pull request
- if: steps.check_changes.outputs.changes_detected == 'true'
+ if: steps.check_extract_changes.outputs.changes_detected == 'true' || steps.check_compile_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 }}
diff --git a/packages/twenty-emails/lingui.config.js b/packages/twenty-emails/lingui.config.js
index ec41a75d727..bf8aa5793a0 100644
--- a/packages/twenty-emails/lingui.config.js
+++ b/packages/twenty-emails/lingui.config.js
@@ -1,4 +1,5 @@
import { defineConfig } from '@lingui/cli';
+import { formatter } from '@lingui/format-po';
import { APP_LOCALES } from 'twenty-shared';
export default defineConfig({
@@ -19,4 +20,5 @@ export default defineConfig({
],
catalogsMergePath: '<rootDir>/src/locales/generated/{locale}',
compileNamespace: 'ts',
+ format: formatter({ lineNumbers: false }),
});
diff --git a/packages/twenty-front/lingui.config.ts b/packages/twenty-front/lingui.config.ts
index 6b31ed6eee8..e3974088917 100644
--- a/packages/twenty-front/lingui.config.ts
+++ b/packages/twenty-front/lingui.config.ts
@@ -1,4 +1,5 @@
import { defineConfig } from '@lingui/cli';
+import { formatter } from '@lingui/format-po';
import { APP_LOCALES } from 'twenty-shared';
export default defineConfig({
@@ -16,4 +17,5 @@ export default defineConfig({
],
catalogsMergePath: '<rootDir>/src/locales/generated/{locale}',
compileNamespace: 'ts',
+ format: formatter({ lineNumbers: false }),
});
diff --git a/packages/twenty-server/lingui.config.js b/packages/twenty-server/lingui.config.js
index 5bbfd1bc194..7dda417469d 100644
--- a/packages/twenty-server/lingui.config.js
+++ b/packages/twenty-server/lingui.config.js
@@ -1,4 +1,5 @@
import { defineConfig } from '@lingui/cli';
+import { formatter } from '@lingui/format-po';
import { APP_LOCALES } from 'twenty-shared';
export default defineConfig({
@@ -20,4 +21,5 @@ export default defineConfig({
catalogsMergePath:
'<rootDir>/src/engine/core-modules/i18n/locales/generated/{locale}',
compileNamespace: 'ts',
+ format: formatter({ lineNumbers: false }),
});