Skip to content
Snippets Groups Projects
Commit be04a1b3 authored by srosse's avatar srosse
Browse files

no-jira: fix upgrader, missing i18n translation...

parent 44ed393d
No related branches found
No related tags found
No related merge requests found
package org.olat.core.commons.services.vfs.ui;
import java.util.Locale;
import org.apache.logging.log4j.Level;
import org.olat.core.gui.translator.Translator;
import org.olat.core.util.Util;
public class VFSUIFactory {
private static final String FILE_INFO_TRANS = "fileinfo.";
private VFSUIFactory() {}
public static String translateFileType(String fileType, Locale locale) {
Translator translator = Util.createPackageTranslator(VFSUIFactory.class, locale);
String i18nKey = FILE_INFO_TRANS + "type." + fileType.toLowerCase();
String translation = translator.translate(i18nKey, null, Level.OFF);
if(i18nKey.equals(translation) || translation.length() > 256) {
translation = fileType;
}
return translation;
}
public static String translateFileCategory(String fileCategory, Locale locale) {
Translator translator = Util.createPackageTranslator(VFSUIFactory.class, locale);
String i18nKey = FILE_INFO_TRANS + "category." + fileCategory.toLowerCase();
String translation = translator.translate(i18nKey, null, Level.OFF);
if(i18nKey.equals(translation) || translation.length() > 256) {
translation = fileCategory;
}
return translation;
}
}
......@@ -61,8 +61,7 @@ public class SearchQueryController extends FormBasicController {
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
searchInput = uifactory.addTextElement("search_input", "search.title", 255, "", formLayout);
searchInput.setLabel(null, null);
searchInput = uifactory.addTextElement("search_input", null, 255, "", formLayout);
searchInput.setPlaceholderKey("search", null);
searchButton = uifactory.addFormLink("rightAddOn", "", "", formLayout, Link.NONTRANSLATED);
......
......@@ -27,6 +27,7 @@ form.search.label.metadatatype=Metadaten
form.search.label.modified.date=Letzte \u00C4nderung
form.search.label.title=Titel
form.search.label.tooltip=Suche in: "{0}"
Forum=Forum
found.no.result.try.fuzzy.search=Kein Resultat gefunden, Suche ausgeweitet auf \u00E4hnliche Begriffe.
invalid.search.query=Die Sucheingabe ist nicht g\u00FCltig.
invalid.search.query.empty=Die Sucheingabe ist nicht g\u00FCltig - darf nicht leer sein\!
......
......@@ -28,6 +28,7 @@ form.search.label.metadatatype=Meta data
form.search.label.modified.date=Last modification
form.search.label.title=Title
form.search.label.tooltip=Search in\: "{0}"
Forum=Forum
found.no.result.try.fuzzy.search=No results found; search has been modified to find similar terms.
invalid.search.query=This query is not valid.
invalid.search.query.empty=This search query is not valid--there should not be an empty string\!
......
......@@ -31,6 +31,7 @@ form.search.label.metadatatype=M\u00E9tadonn\u00E9es
form.search.label.modified.date=Derni\u00E8re modification
form.search.label.title=Titre
form.search.label.tooltip=Recherche dans\: "{0}"
Forum=Forum
found.no.result.try.fuzzy.search=Aucun r\u00E9sultat trouv\u00E9, recherche \u00E9largie sur des termes semblables
invalid.search.query=La demande de recherche n'est pas valable.
invalid.search.query.empty=L'entr\u00E9e pour la recherche n'est valable - ne peut pas \u00EAtre vide\!
......
......@@ -173,7 +173,7 @@ public class OLATUpgrade_14_2_0 extends OLATUpgrade {
SubscriberImpl sub = new SubscriberImpl(publisher, identity);
sub.setEnabled(false);
sub.setCreationDate(new Date());
sub.setLastModified(sub.getLastModified());
sub.setLastModified(sub.getCreationDate());
dbInstance.getCurrentEntityManager().persist(sub);
dbInstance.commit();
}
......
......@@ -26,7 +26,6 @@ import java.util.List;
import java.util.UUID;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.olat.core.commons.persistence.DB;
import org.olat.core.commons.services.vfs.VFSMetadata;
......@@ -225,7 +224,6 @@ public class VFSRevisionDAOTest extends OlatTestCase {
}
@Test
@Ignore
public void getLargest() {
Identity author = JunitTestHelper.createAndPersistIdentityAsRndUser("rev-1");
VFSMetadata metadata1 = vfsMetadataDao.createMetadata(UUID.randomUUID().toString(), "test/revs", "text1.txt",
......
......@@ -21,7 +21,6 @@ package org.olat.core.commons.services.vfs.manager;
import org.junit.Assert;
import org.junit.Test;
import org.olat.core.commons.persistence.DB;
import org.olat.core.commons.services.vfs.model.VFSFileStatistics;
import org.olat.core.commons.services.vfs.model.VFSRevisionStatistics;
import org.olat.core.commons.services.vfs.model.VFSThumbnailStatistics;
......@@ -36,8 +35,6 @@ import org.springframework.beans.factory.annotation.Autowired;
*/
public class VFSStatsDAOTest extends OlatTestCase {
@Autowired
private DB dbInstance;
@Autowired
private VFSStatsDAO vfsStatsDAO;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment