Coverage for modules/org/openteacher/data/userDocumentation/userDocumentation : 74%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
#! /usr/bin/env python3 # -*- coding: utf-8 -*-
# Copyright 2013, Marten de Vries # # This file is part of OpenTeacher. # # OpenTeacher is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # OpenTeacher is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with OpenTeacher. If not, see <http://www.gnu.org/licenses/>.
self._mm.mods(type="translator"), )
def availableTranslations(self): """All available languages in which the documentation is translated. (English, the default, isn't included)
""" paths = os.listdir(self._mm.resourcePath("translations")) return (os.path.splitext(p)[0] for p in paths if p.endswith(".po"))
"""Returns the user documentation as an html snippet. All links to resources (e.g. images) will be pointing to ``resourceUrl``/resourceName. In other words, the caller should make sure all files in ``self.resourcesPath`` are available on the ``resourceUrl`` in some way.
The snippet will be in the language ``lang`` if available. (``lang`` should be passable to the translator module.) If lang is None, it will use the current language of OpenTeacher.
""" except IndexError: _, ngettext = str, lambda a, b, n: a if n == 1 else b else: self._mm.resourcePath("translations"), lang )
"resourceUrl": resourceUrl, "tr": _, })
except ImportError: #remain inactive return
|