Skip to content
Snippets Groups Projects
Commit 96f7004e authored by Jake's avatar Jake
Browse files

Merge branch 'translations' into 'master'

Translations

See merge request GAUMI-fginfo/fg-website!21
parents d11e8cb3 77e50dcc
No related branches found
No related tags found
No related merge requests found
Pipeline #356018 passed
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
} }
}, },
"lang": { "lang": {
"supported": ["de"],
"de": { "de": {
"sitename": "Dokumentation Fachgruppenwebseite", "sitename": "Dokumentation Fachgruppenwebseite",
"banner": { "banner": {
...@@ -25,5 +26,6 @@ ...@@ -25,5 +26,6 @@
"title": "Dokumentation Fachgruppenwebseite Atom Feed" "title": "Dokumentation Fachgruppenwebseite Atom Feed"
} }
} }
} }
} }
...@@ -100,20 +100,25 @@ class Generator: ...@@ -100,20 +100,25 @@ class Generator:
writer.write_file(f.link.path, f.rawcontents, mode="wb") writer.write_file(f.link.path, f.rawcontents, mode="wb")
for lang in self.config['lang']['supported']: for lang in self.config['lang']['supported']:
# all published pages # all published pages
print(lang, "-> Generatng all published pages.")
for page in self.context['pages'][lang].values(): for page in self.context['pages'][lang].values():
writer.write_template(page.template, page.link.path, lang, {'page': page}, page.config) writer.write_template(page.template, page.link.path, lang, {'page': page}, page.config)
# all hidden pages # all hidden pages
print(lang, "-> Generatng all hidden pages.")
for page in self.context['hidden_pages'][lang].values(): for page in self.context['hidden_pages'][lang].values():
#print(page.slug) #print(page.slug)
writer.write_template(page.template, page.link.path, lang, {'page': page}, page.config) writer.write_template(page.template, page.link.path, lang, {'page': page}, page.config)
# all tags # all tags
print(lang, "-> Generatng all tags.")
for tag in self.context['tags'][lang].values(): for tag in self.context['tags'][lang].values():
writer.write_template('tag.html', tag.link.path, lang, {'tag': tag}, tag.config) writer.write_template('tag.html', tag.link.path, lang, {'tag': tag}, tag.config)
# homepages for languages # homepages for languages
print(lang, "-> Generatng homepage.")
self.generate_homepage(writer, lang, lang + "/index.html") self.generate_homepage(writer, lang, lang + "/index.html")
# homepage # homepage
......
...@@ -21,6 +21,7 @@ class Writer: ...@@ -21,6 +21,7 @@ class Writer:
print("templates: ", self.env.list_templates()) print("templates: ", self.env.list_templates())
def write_template(self, template, path, lang, extra_context, localized_config): def write_template(self, template, path, lang, extra_context, localized_config):
#print("write_template:", template, path, lang, extra_context, localized_config)
tmpl = self.env.get_template(template) tmpl = self.env.get_template(template)
pathsplit = path.split('/') pathsplit = path.split('/')
......
...@@ -62,5 +62,65 @@ ...@@ -62,5 +62,65 @@
"toc": { "toc": {
"header": "Inhaltsverzeichnis" "header": "Inhaltsverzeichnis"
} }
},
"en": {
"langname": "English",
"sitename": "<Your sitename>",
"title_prefix": "",
"title_suffix": "",
"title_seperator": " | ",
"banner": {
"title": "Homepage <Your sitename>",
"prefix": "",
"suffix": "",
"alt": ""
},
"date_format": "%d.%m.%Y %H:%M Uhr",
"page": {
"published_prefix": "Created: ",
"published_suffix": " | ",
"modified_prefix": "Last&nbsp;change: ",
"modified_suffix": "",
"authors_prefix": "Authors: ",
"authors_suffix": "",
"languages_prefix": "Languages: ",
"languages_suffix": "",
"category_prefix": "Category: ",
"category_suffix": " | ",
"tags_prefix": "Tags: ",
"tags_suffix": "",
"slug_prefix": "Slug: ",
"slug_suffix": "",
"edit_url_text": "[Edit&nbsp;page]",
"view_url_text": "[Source]",
"history_url_text": "[History]",
"redirect_prefix": "This page links to another page. You will be redirected to ",
"redirect_suffix": " shortly. If the automatic redirection doesn't work, just click the link directly."
},
"tag": {
"edit_url_text": "[Edit&nbsp;text]",
"view_url_text": "[Source]",
"history_url_text": "[History]"
},
"atom": {
"title": "<Your sitename> Atom Feed"
},
"only_pages": {
"title": "Pages"
},
"no_content": "This page has no content.",
"quotations": {
"double": {
"left": "&bdquo;",
"right": "&ldquo;"
},
"single": {
"left": "&sbquo;",
"right": "&lsquo;"
}
},
"toc": {
"header": "Table of contents"
}
} }
} }
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