Replace string concatenation with proper i18n

This commit is contained in:
Andreas Svanberg 2024-07-10 13:25:23 +02:00
parent 0684919bb2
commit 9f583f9e7a
3 changed files with 5 additions and 3 deletions

@ -5,7 +5,7 @@
<div wicket:id="edit_note_modal"></div>
<span wicket:id="shortened_note"></span>
<wicket:container wicket:id="full_note"></wicket:container>
<a wicket:id="view_note">[view/edit note]</a>
<a wicket:id="view_note"><wicket:message key="note.view.edit"/></a>
</wicket:panel>
</body>
</html>

@ -0,0 +1,2 @@
note.modal.title=View/edit note for ${title}
note.view.edit=View/edit note

@ -16,6 +16,7 @@ import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.StringResourceModel;
import se.su.dsv.scipro.components.LargeModalWindow;
import se.su.dsv.scipro.components.MaxLengthLabel;
import se.su.dsv.scipro.components.ModalWindowPlus;
@ -63,7 +64,7 @@ public class ProjectNoteColumn extends AbstractExportableColumn<Project, String>
super(id, model);
ModalWindowPlus modal = new LargeModalWindow("edit_note_modal");
modal.setTitle(model.map(Project::getTitle).map(projectTitle -> "View/Edit note for " + projectTitle));
modal.setTitle(new StringResourceModel("note.modal.title", this, model));
modal.setContent(componentId -> new ViewAndEditNoteForm(componentId, model));
add(modal);
@ -91,7 +92,6 @@ public class ProjectNoteColumn extends AbstractExportableColumn<Project, String>
modal.show(target);
}
};
noteLink.setBody(Model.of("View/Edit note"));
add(noteLink);
}
}