fix #2544 Add lang attribute.
This commit is contained in:
parent
1b5e44f87b
commit
568d15a741
24 changed files with 69 additions and 44 deletions
|
@ -56,6 +56,7 @@ import org.codelibs.fess.entity.FacetQueryView;
|
|||
import org.codelibs.fess.helper.ViewHelper;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.lastaflute.di.util.LdiURLUtil;
|
||||
import org.lastaflute.web.LastaWebKey;
|
||||
import org.lastaflute.web.util.LaRequestUtil;
|
||||
import org.lastaflute.web.util.LaResponseUtil;
|
||||
import org.lastaflute.web.util.LaServletContextUtil;
|
||||
|
@ -99,6 +100,18 @@ public class FessFunctions {
|
|||
// nothing
|
||||
}
|
||||
|
||||
public static String html(final boolean isOpen) {
|
||||
if (isOpen) {
|
||||
return "<html lang=\"" + LaRequestUtil.getOptionalRequest().map(req -> {
|
||||
if (req.getAttribute(LastaWebKey.USER_LOCALE_KEY) instanceof Locale locale) {
|
||||
return locale;
|
||||
}
|
||||
return Locale.ENGLISH;
|
||||
}).orElse(Locale.ENGLISH).getLanguage() + "\">";
|
||||
}
|
||||
return "</html>";
|
||||
}
|
||||
|
||||
public static Boolean labelExists(final String value) {
|
||||
return LaRequestUtil.getOptionalRequest().map(req -> {
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -11,6 +11,18 @@
|
|||
<short-name>fe</short-name>
|
||||
<uri>fess.tags.functions</uri>
|
||||
|
||||
<function>
|
||||
<description>
|
||||
Print HTML tag.
|
||||
</description>
|
||||
<name>html</name>
|
||||
<function-class>org.codelibs.fess.taglib.FessFunctions</function-class>
|
||||
<function-signature>java.lang.String html(boolean)</function-signature>
|
||||
<example>
|
||||
${fe:html(true)}...${fe:html(false)}
|
||||
</example>
|
||||
</function>
|
||||
|
||||
<function>
|
||||
<description>
|
||||
Returns a label name.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -323,4 +323,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/advance.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<% try{ %>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -31,5 +31,5 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/search.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
<% }catch(Exception e){session.invalidate();} %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -35,4 +35,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/search.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -33,4 +33,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/search.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<% try{ %>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -31,5 +31,5 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/search.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
<% }catch(Exception e){session.invalidate();} %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -33,4 +33,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/help.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -173,4 +173,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/index.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -79,4 +79,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/admin/bootstrap.min.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/login.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -78,4 +78,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/admin/bootstrap.min.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/login.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -89,4 +89,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/admin/bootstrap.min.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/profile.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -155,4 +155,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/search.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -323,4 +323,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/advance.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<% try{ %>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -31,5 +31,5 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/search.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
<% }catch(Exception e){session.invalidate();} %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -35,4 +35,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/search.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -33,4 +33,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/search.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<% try{ %>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -31,5 +31,5 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/search.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
<% }catch(Exception e){session.invalidate();} %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -33,4 +33,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/help.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -173,4 +173,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/index.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -79,4 +79,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/admin/bootstrap.min.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/login.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -78,4 +78,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/admin/bootstrap.min.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/login.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -89,4 +89,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/admin/bootstrap.min.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/profile.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
${fe:html(true)}
|
||||
<head profile="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -155,4 +155,4 @@
|
|||
<script type="text/javascript" src="${fe:url('/js/suggestor.js')}"></script>
|
||||
<script type="text/javascript" src="${fe:url('/js/search.js')}"></script>
|
||||
</body>
|
||||
</html>
|
||||
${fe:html(false)}
|
||||
|
|
Loading…
Add table
Reference in a new issue