diff --git a/src/mmt-stex/src/info/kwarc/mmt/stex/Extensions/DocumentExtension.scala b/src/mmt-stex/src/info/kwarc/mmt/stex/Extensions/DocumentExtension.scala
index ee613889f..ee25b2baf 100644
--- a/src/mmt-stex/src/info/kwarc/mmt/stex/Extensions/DocumentExtension.scala
+++ b/src/mmt-stex/src/info/kwarc/mmt/stex/Extensions/DocumentExtension.scala
@@ -39,7 +39,7 @@ trait SHTMLDocumentServer { this : STeXServer =>
protected case class DocParams(q: WebQuery) {
lazy val path = q.pairs.find(p => p._2.isEmpty && p._1.contains('?') && !p._1.endsWith("="))
.map(p => Path.parse(p._1))
- lazy val language = q("language").orElse(context_filepath.flatMap(parseLanguage))
+ lazy val language = q("language").getOrElse(context_filepath.flatMap(parseLanguage).getOrElse("en"))
lazy val archive = q("archive").flatMap{id => getArchive(id)}
lazy val filepath = q("filepath")
lazy val bindings = {
@@ -460,7 +460,7 @@ trait SHTMLDocumentServer { this : STeXServer =>
}
def doDeclHeader(c: Constant)(implicit dp:DocParams) = {
- val state = new OMDocState(dp.language.getOrElse("en"))
+ val state = new OMDocState(dp.language)
doSymbol(c)(state).toString()
}
@@ -555,7 +555,7 @@ trait SHTMLDocumentServer { this : STeXServer =>
}
def getAllFragmentsDefault(c : Constant)(implicit dp:DocParams) : List[(String,String)] = {
- SHTMLContentManagement.getSymdocs(c.path, dp.language.getOrElse("en"),dp.context_doc)(controller) match { // TODO language
+ SHTMLContentManagement.getSymdocs(c.path, dp.language,dp.context_doc)(controller) match { // TODO language
case Nil =>
val res = "Symbol " + c.name + " in module " + (SourceRef.get(c) match {
case Some(sr) =>
@@ -583,16 +583,12 @@ trait SHTMLDocumentServer { this : STeXServer =>
}
def sort(defs:List[(GlobalName,Node)])(implicit dp:DocParams): List[(GlobalName,Node)] = {
- dp.language match {
- case None => defs
- case Some(lang) =>
- val ls = defs.filter(_._1.module.name.toString == lang)
- if (ls.isEmpty) defs else (ls ::: defs).distinct
- }
+ val ls = defs.filter(_._1.module.name.toString == dp.language)
+ if (ls.isEmpty) defs else (ls ::: defs).distinct
}
def getFragmentDefault(c : Constant)(implicit dp:DocParams) : String = {
- SHTMLContentManagement.getSymdocs(c.path,dp.language.getOrElse("en"),dp.context_doc)(controller) match { // TODO language TODO sort by relevance
+ SHTMLContentManagement.getSymdocs(c.path,dp.language,dp.context_doc)(controller) match { // TODO language TODO sort by relevance
case Nil =>
val res = "Symbol " + c.name + " in module " + (SourceRef.get(c) match {
case Some(sr) =>
diff --git a/src/mmt-stex/src/info/kwarc/mmt/stex/Extensions/ExportExtension.scala b/src/mmt-stex/src/info/kwarc/mmt/stex/Extensions/ExportExtension.scala
index 4bc34a14a..15118db27 100644
--- a/src/mmt-stex/src/info/kwarc/mmt/stex/Extensions/ExportExtension.scala
+++ b/src/mmt-stex/src/info/kwarc/mmt/stex/Extensions/ExportExtension.scala
@@ -209,7 +209,7 @@ trait ExportExtension { self : STeXServer =>
private def doFile(file:File,to:File,top : Boolean = false,withbindings:Option[LateBinding])(implicit state:ExportState): Unit = {
val params = new DocParams(new WebQuery(Nil)) {
override lazy val path = None
- override lazy val language = None // TODO
+ override lazy val language = "en" // TODO
override lazy val filepath = Some(file.setExtension("xhtml").toString)
override lazy val bindings = withbindings
override lazy val archive = Some(state.archive)
@@ -236,7 +236,7 @@ trait ExportExtension { self : STeXServer =>
case Some(c : Constant) =>
implicit val params = new DocParams(new WebQuery(Nil)) {
override lazy val path = Some(gn)
- override lazy val language = None // TODO
+ override lazy val language = "en" // TODO
override lazy val filepath = None
override lazy val bindings = None
override lazy val archive = Some(state.archive)
@@ -263,7 +263,7 @@ trait ExportExtension { self : STeXServer =>
case Some(c: Constant) =>
implicit val params = new DocParams(new WebQuery(Nil)) {
override lazy val path = Some(gn)
- override lazy val language = None // TODO
+ override lazy val language = "en" // TODO
override lazy val filepath = None
override lazy val bindings = None
override lazy val archive = Some(state.archive)