@@ -85,7 +85,7 @@ func (m *ListModel[TRecord, TRecordCreate, TRecordUpdate, TRecordId, TFilter]) U
8585 m .records = msg .records
8686 m .refreshTable ()
8787 if msg .err != nil {
88- return choicepopup .Open ("Error loading " + m .crud .Texts .EntityNameMultiple + ":\n " + msg .err .Error (), choicepopup.Choices {
88+ return choicepopup .Open ("Error loading " + m .crud .Texts .EntityNameMultiple () + ":\n " + msg .err .Error (), choicepopup.Choices {
8989 choicepopup.Choice {Name : "Close" , Cmd : m .crud .routerControll .Pop (1 ), KeyBindings : keys.KeyBindingList {keys .Close ()}},
9090 choicepopup.Choice {Name : "Reload" , Cmd : m .reload (), KeyBindings : nil },
9191 })
@@ -115,7 +115,7 @@ func (m *ListModel[TRecord, TRecordCreate, TRecordUpdate, TRecordId, TFilter]) U
115115
116116 case listMsgDeleteResult [TRecord ]:
117117 if msg .err != nil {
118- return messagepopup .Open (messagepopup .Error , "Error deleting " + m .crud .Texts .EntityNameSingular + ":\n " + msg .err .Error (), nil )
118+ return messagepopup .Open (messagepopup .Error , "Error deleting " + m .crud .Texts .EntityNameSingular () + ":\n " + msg .err .Error (), nil )
119119 }
120120 // full reload
121121 if m .crud .listReloadAfterChange {
@@ -137,7 +137,7 @@ func (m *ListModel[TRecord, TRecordCreate, TRecordUpdate, TRecordId, TFilter]) U
137137 case key .Matches (msg , ListBaseKeyMap .Edit ):
138138 selectedRecord := m .selectedRecord ()
139139 if selectedRecord == nil {
140- return messagepopup .Open (messagepopup .Info , "Please select a " + m .crud .Texts .EntityNameSingular + " to edit." , nil )
140+ return messagepopup .Open (messagepopup .Info , "Please select a " + m .crud .Texts .EntityNameSingular () + " to edit." , nil )
141141 }
142142 return m .crud .routerControll .Push (util .ModelPointer (NewUpdate (
143143 m .crud ,
@@ -147,15 +147,15 @@ func (m *ListModel[TRecord, TRecordCreate, TRecordUpdate, TRecordId, TFilter]) U
147147 case key .Matches (msg , ListBaseKeyMap .Delete ):
148148 selectedRecord := m .selectedRecord ()
149149 if selectedRecord == nil {
150- return messagepopup .Open (messagepopup .Info , "Please select a " + m .crud .Texts .EntityNameSingular + " to delete." , nil )
150+ return messagepopup .Open (messagepopup .Info , "Please select a " + m .crud .Texts .EntityNameSingular () + " to delete." , nil )
151151 }
152152 return choicepopup .Open (
153- "Do you realy want to delete this " + m .crud .Texts .EntityNameSingular + "?" ,
153+ "Do you realy want to delete this " + m .crud .Texts .EntityNameSingular () + "?" ,
154154 choicepopup.Choices {
155155 {Name : "Cancel" , Cmd : nil , KeyBindings : keys.KeyBindingList {keys .Cancel ()}},
156156 {Name : "Delete" , Cmd : progresspopup .Open (
157157 progresspopup .Spinner ,
158- "Deleting " + m .crud .Texts .EntityNameSingular ,
158+ "Deleting " + m .crud .Texts .EntityNameSingular () ,
159159 func (ctx context.Context , _ progresspopup.ProgressChan ) tea.Cmd {
160160 err := m .crud .deleteRecord (ctx , m .crud .getRecordId (* selectedRecord ))
161161 return func () tea.Msg {
@@ -204,7 +204,7 @@ func (m *ListModel[TRecord, TRecordCreate, TRecordUpdate, TRecordId, TFilter]) F
204204 m .focussed = true
205205 m .table .Focus ()
206206 return tea .Batch (
207- windowtitle .Announce (m .crud .Texts .EntityNameMultiple ),
207+ windowtitle .Announce (m .crud .Texts .EntityNameMultiple () ),
208208 util .AnnounceKeyMapCmd (parentKeyMap , ListBaseKeyMap , m .crud .listGlobalKeyMap ),
209209 )
210210}
@@ -221,7 +221,7 @@ var _ util.Model = (*ListModel[any, any, any, any, any])(nil)
221221func (m * ListModel [TRecord , TRecordCreate , TRecordUpdate , TRecordId , TFilter ]) reload () tea.Cmd {
222222 return progresspopup .Open (
223223 progresspopup .Spinner ,
224- "Loading " + m .crud .Texts .EntityNameMultiple , func (ctx context.Context , pc progresspopup.ProgressChan ) tea.Cmd {
224+ "Loading " + m .crud .Texts .EntityNameMultiple () , func (ctx context.Context , pc progresspopup.ProgressChan ) tea.Cmd {
225225 records , err := m .crud .getRecords (ctx , util .NewZero [TFilter ]())
226226 return util .TeaMsgToCmd (listMsgReloaded [TRecord ]{records , err })
227227 },
0 commit comments