Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12560,7 +12560,7 @@ class Git {
*/
static isValidRef(ref) {
try {
(0, child_process_1.execSync)(`git rev-parse --verify "${ref}"`, {
(0, child_process_1.execSync)(`git rev-parse --verify "${ref}^{object}"`, {
encoding: 'utf8',
cwd: process.cwd(),
stdio: 'pipe', // Suppress output
Expand Down Expand Up @@ -12685,6 +12685,10 @@ class Git {
content,
});
}
else if (firstChar === ' ') {
// Context line - skip it (we only care about added/removed lines)
continue;
}
else {
throw new Error(`Unknown line type! First character of line is ${firstChar}`);
}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/generateTranslations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ jobs:
- name: Setup Node
uses: ./.github/actions/composite/setupNode

- name: Setup tmate
if: runner.debug == '1'
uses: mxschmitt/action-tmate@e5c7151931ca95bad1c6f4190c730ecf8c7dde48
timeout-minutes: 60

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why a 60 minute timeout? That seems long

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just copy/pasted this from auth. You'll notice that tmate only runs if runner.debug == '1'. For context, what this does is suspend execution of the runner and open an ssh portal into the runner. Then you can ssh in and do whatever you want. When you close the ssh connection, the runner continues execution.

The 60 minute timeout just means that you'd have 60 minutes to ssh in and debug whatever you want to debug. I agree it's kind of long, but 🤷🏼

with:
limit-access-to-actor: true

- name: Check if English translations were modified
id: check-en-changes
uses: ./.github/actions/javascript/getPullRequestIncrementalChanges
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/translationDryRun.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Translation Dry Run

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to the other changes here. Just :eye_twitch:


on:
pull_request:
types: [opened, synchronize]
Expand Down
7 changes: 5 additions & 2 deletions scripts/utils/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const GIT_ERRORS = {

/**
* Represents a single changed line in a git diff.
* With -U0, only added and removed lines are present (no context).
* Only added and removed lines are tracked (context lines are skipped during parsing).
*/
type DiffLine = {
number: number;
Expand Down Expand Up @@ -64,7 +64,7 @@ class Git {
*/
static isValidRef(ref: string): boolean {
try {
execSync(`git rev-parse --verify "${ref}"`, {
execSync(`git rev-parse --verify "${ref}^{object}"`, {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Fix

Excellent fix! Using ^{object} ensures that the reference actually exists in the object database, not just that it's a valid SHA format. This addresses the root cause of the git diff failure in the translation workflow.

encoding: 'utf8',
cwd: process.cwd(),
stdio: 'pipe', // Suppress output
Expand Down Expand Up @@ -200,6 +200,9 @@ class Git {
type: 'removed',
content,
});
} else if (firstChar === ' ') {
// Context line - skip it (we only care about added/removed lines)
continue;
} else {
throw new Error(`Unknown line type! First character of line is ${firstChar}`);
}
Expand Down
4 changes: 2 additions & 2 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ const translations = {
disabled: 'Deaktiviert',
import: 'Importieren',
offlinePrompt: 'Sie können diese Aktion momentan nicht ausführen.',
outstanding: 'Hervorragend',
outstanding: 'Ausstehend',
chats: 'Chats',
tasks: 'Aufgaben',
unread: 'Ungelesen',
Expand All @@ -636,7 +636,7 @@ const translations = {
downloadAsCSV: 'Als CSV herunterladen',
help: 'Hilfe',
expenseReports: 'Spesenabrechnungen',
rateOutOfPolicy: 'Außerhalb der Richtlinie bewerten',
rateOutOfPolicy: 'Satz außerhalb der Richtlinien',
reimbursable: 'Erstattungsfähig',
editYourProfile: 'Bearbeiten Sie Ihr Profil',
comments: 'Kommentare',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ const translations = {
tax: 'Tax',
shared: 'Shared',
drafts: 'Drafts',
// @context as a noun, not a verb

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Context Documentation

Great addition of context comments! These @context comments help translators understand the intended meaning and ensure accurate translations. This is a best practice for internationalization.

draft: 'Draft',
finished: 'Finished',
upgrade: 'Upgrade',
Expand Down Expand Up @@ -604,6 +605,7 @@ const translations = {
disabled: 'Disabled',
import: 'Import',
offlinePrompt: "You can't take this action right now.",
// @context meaning "remaining to be paid, done, or dealt with", not "exceptionally good"
outstanding: 'Outstanding',
chats: 'Chats',
tasks: 'Tasks',
Expand All @@ -628,6 +630,7 @@ const translations = {
downloadAsCSV: 'Download as CSV',
help: 'Help',
expenseReports: 'Expense Reports',
// @context Rate as a noun, not a verb
rateOutOfPolicy: 'Rate out of policy',
reimbursable: 'Reimbursable',
editYourProfile: 'Edit your profile',
Expand Down Expand Up @@ -1688,6 +1691,7 @@ const translations = {
general: 'General',
},
closeAccountPage: {
// @context close as a verb, not an adjective
closeAccount: 'Close account',
reasonForLeavingPrompt: 'We’d hate to see you go! Would you kindly tell us why, so we can improve?',
enterMessageHere: 'Enter message here',
Expand Down
4 changes: 2 additions & 2 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ const translations = {
disabled: 'Désactivé',
import: 'Importation',
offlinePrompt: 'Vous ne pouvez pas effectuer cette action pour le moment.',
outstanding: 'Exceptionnel',
outstanding: 'En attente',
chats: 'Chats',
tasks: 'Tâches',
unread: 'Non lu',
Expand All @@ -636,7 +636,7 @@ const translations = {
downloadAsCSV: 'Télécharger en CSV',
help: 'Aide',
expenseReports: 'Rapports de dépenses',
rateOutOfPolicy: 'Évaluer hors politique',
rateOutOfPolicy: 'Taux hors politique',
reimbursable: 'Remboursable',
editYourProfile: 'Modifier votre profil',
comments: 'Commentaires',
Expand Down
8 changes: 3 additions & 5 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ const translations = {
disabled: 'Disabilitato',
import: 'Importa',
offlinePrompt: 'Non puoi eseguire questa azione in questo momento.',
outstanding: 'Eccezionale',
outstanding: 'In sospeso',
chats: 'Chat',
tasks: 'Attività',
unread: 'Non letto',
Expand All @@ -636,7 +636,7 @@ const translations = {
downloadAsCSV: 'Scarica come CSV',
help: 'Aiuto',
expenseReports: 'Report di spesa',
rateOutOfPolicy: 'Valuta fuori politica',
rateOutOfPolicy: 'Tariffa fuori politica',
reimbursable: 'Rimborsabile',
editYourProfile: 'Modifica il tuo profilo',
comments: 'Commenti',
Expand Down Expand Up @@ -678,9 +678,7 @@ const translations = {
}: {
command?: string;
} = {}) =>
`Non sei autorizzato a eseguire questa azione quando il supporto è connesso (comando: ${
command ?? ''
}). Se ritieni che Success debba essere in grado di eseguire questa azione, avvia una conversazione su Slack.`,
`Non sei autorizzato a eseguire questa azione quando il supporto è connesso (comando: ${command ?? ''}). Se ritieni che Success debba essere in grado di eseguire questa azione, avvia una conversazione su Slack.`,
},
lockedAccount: {
title: 'Account bloccato',
Expand Down
6 changes: 3 additions & 3 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ const translations = {
tax: '税金',
shared: '共有',
drafts: '下書き',
draft: 'ドラフト',
draft: '下書き',
finished: '完了',
upgrade: 'アップグレード',
downgradeWorkspace: 'ワークスペースをダウングレードする',
Expand Down Expand Up @@ -611,7 +611,7 @@ const translations = {
disabled: '無効',
import: 'インポート',
offlinePrompt: '現在、この操作を行うことはできません。',
outstanding: '未払い',
outstanding: '未処理',
chats: 'チャット',
tasks: 'タスク',
unread: '未読',
Expand All @@ -636,7 +636,7 @@ const translations = {
downloadAsCSV: 'CSVとしてダウンロード',
help: '助けて',
expenseReports: '経費報告書',
rateOutOfPolicy: 'ポリシー外の評価',
rateOutOfPolicy: 'ポリシー外のレート',
reimbursable: '払い戻し可能',
editYourProfile: 'プロフィールを編集',
comments: 'コメント',
Expand Down
6 changes: 3 additions & 3 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ const translations = {
tax: 'Belasting',
shared: 'Gedeeld',
drafts: 'Concepten',
draft: 'Ontwerp',
draft: 'Conceptversie',
finished: 'Voltooid',
upgrade: 'Upgrade',
downgradeWorkspace: 'Werkruimte downgraden',
Expand Down Expand Up @@ -611,7 +611,7 @@ const translations = {
disabled: 'Uitgeschakeld',
import: 'Importeren',
offlinePrompt: 'Je kunt deze actie nu niet uitvoeren.',
outstanding: 'Uitstekend',
outstanding: 'Uitstaand',
chats: 'Chats',
tasks: 'Taken',
unread: 'Ongelezen',
Expand All @@ -635,7 +635,7 @@ const translations = {
downloadAsCSV: 'Downloaden als CSV',
help: 'Help',
expenseReports: "Onkostennota's",
rateOutOfPolicy: 'Beoordeel buiten beleid',
rateOutOfPolicy: 'Tarief buiten beleid',
reimbursable: 'Vergoedbaar',
editYourProfile: 'Bewerk je profiel',
comments: 'Opmerkingen',
Expand Down
4 changes: 2 additions & 2 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ const translations = {
disabled: 'Wyłączony',
import: 'Importuj',
offlinePrompt: 'Nie możesz teraz podjąć tej akcji.',
outstanding: 'Zaległe',
outstanding: 'Zaległy',
chats: 'Czaty',
tasks: 'Zadania',
unread: 'Nieprzeczytane',
Expand All @@ -636,7 +636,7 @@ const translations = {
downloadAsCSV: 'Pobierz jako CSV',
help: 'Pomoc',
expenseReports: 'Raporty wydatków',
rateOutOfPolicy: 'Oceń poza polityką',
rateOutOfPolicy: 'Stawka poza polityką',
reimbursable: 'Podlegające zwrotowi',
editYourProfile: 'Edytuj swój profil',
comments: 'Komentarze',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ const translations = {
disabled: 'Desativado',
import: 'Importar',
offlinePrompt: 'Você não pode realizar esta ação no momento.',
outstanding: 'Excelente',
outstanding: 'Pendente',
chats: 'Chats',
tasks: 'Tarefas',
unread: 'Não lido',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ const translations = {
disabled: '禁用',
import: '导入',
offlinePrompt: '您现在无法执行此操作。',
outstanding: '优秀',
outstanding: '未完成的',
chats: '聊天',
tasks: '任务',
unread: '未读',
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/GitTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Git', () => {
const result = Git.isValidRef('main');

expect(result).toBe(true);
expect(mockExecSync).toHaveBeenCalledWith('git rev-parse --verify "main"', {
expect(mockExecSync).toHaveBeenCalledWith('git rev-parse --verify "main^{object}"', {
encoding: 'utf8',
cwd: process.cwd(),
stdio: 'pipe',
Expand Down
Loading