From 0f233c66934a5b8429facc274e9e4d3d0db08f62 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Mon, 13 Jan 2025 11:58:11 +0000 Subject: [PATCH] Check for translated strings Fixes #5362 --- dialog/file_test.go | 7 ++++--- dialog/folder_test.go | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dialog/file_test.go b/dialog/file_test.go index 157728bc68..39583f0ee6 100644 --- a/dialog/file_test.go +++ b/dialog/file_test.go @@ -8,6 +8,7 @@ import ( "testing" intWidget "fyne.io/fyne/v2/internal/widget" + "fyne.io/fyne/v2/lang" "github.com/stretchr/testify/assert" "fyne.io/fyne/v2" @@ -203,7 +204,7 @@ func TestShowFileOpen(t *testing.T) { ui := popup.Content.(*fyne.Container) //header title := ui.Objects[1].(*fyne.Container).Objects[1].(*widget.Label) - assert.Equal(t, "Open File", title.Text) + assert.Equal(t, lang.L("Open")+" "+lang.L("File"), title.Text) //optionsbuttons createNewFolderButton := ui.Objects[1].(*fyne.Container).Objects[0].(*fyne.Container).Objects[0].(*widget.Button) assert.Equal(t, "", createNewFolderButton.Text) @@ -239,7 +240,7 @@ func TestShowFileOpen(t *testing.T) { assert.NotEmpty(t, objects) fileName := test.TempWidgetRenderer(t, objects[0].(fyne.Widget)).Objects()[1].(*fileDialogItem).name - assert.Equal(t, "(Parent)", fileName) + assert.Equal(t, lang.L("(Parent)"), fileName) assert.True(t, open.Disabled()) var target *fileDialogItem @@ -355,7 +356,7 @@ func TestShowFileSave(t *testing.T) { assert.NotEmpty(t, objects) item := test.TempWidgetRenderer(t, objects[0].(fyne.Widget)).Objects()[1].(*fileDialogItem) - assert.Equal(t, "(Parent)", item.name) + assert.Equal(t, lang.L("(Parent)"), item.name) assert.True(t, save.Disabled()) abs, _ := filepath.Abs("./testdata/") diff --git a/dialog/folder_test.go b/dialog/folder_test.go index 7b94df0b63..acf3906658 100644 --- a/dialog/folder_test.go +++ b/dialog/folder_test.go @@ -4,6 +4,7 @@ import ( "path/filepath" "testing" + "fyne.io/fyne/v2/lang" "github.com/stretchr/testify/assert" "fyne.io/fyne/v2" @@ -35,7 +36,7 @@ func TestShowFolderOpen(t *testing.T) { ui := popup.Content.(*fyne.Container) title := ui.Objects[1].(*fyne.Container).Objects[1].(*widget.Label) - assert.Equal(t, "Open Folder", title.Text) + assert.Equal(t, lang.L("Open")+" "+lang.L("Folder"), title.Text) nameLabel := ui.Objects[2].(*fyne.Container).Objects[1].(*container.Scroll).Content.(*widget.Label) buttons := ui.Objects[2].(*fyne.Container).Objects[0].(*fyne.Container) @@ -46,7 +47,7 @@ func TestShowFolderOpen(t *testing.T) { item := test.TempWidgetRenderer(t, files).Objects()[0].(*container.Scroll).Content.(*fyne.Container).Objects[0] fileName := test.TempWidgetRenderer(t, item.(fyne.Widget)).Objects()[1].(*fileDialogItem).name - assert.Equal(t, "(Parent)", fileName) + assert.Equal(t, lang.L("(Parent)"), fileName) assert.False(t, open.Disabled()) var target *fyne.URI