Skip to content

Commit

Permalink
Check for translated strings
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Jan 13, 2025
1 parent d6d65dc commit 0f233c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions dialog/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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/")
Expand Down
5 changes: 3 additions & 2 deletions dialog/folder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"path/filepath"
"testing"

"fyne.io/fyne/v2/lang"
"github.com/stretchr/testify/assert"

"fyne.io/fyne/v2"
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 0f233c6

Please sign in to comment.