File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 3838 '_templates' ,
3939]
4040
41-
4241exclude_patterns = [
4342 '_build' ,
4443]
9190# -- Options for LaTeX output ------------------------------------------------
9291# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-latex-output
9392
94-
9593latex_elements = {
9694}
9795latex_documents = [
154152current_docs = 'user_manual'
155153html_context ['versions' ] = generateVersionsDocs (current_docs )
156154html_context ['theme_vcs_pageview_mode' ] += current_docs
157- html_context ['available_languages' ] = [
155+
156+ # Automatically detect available languages and pass to template
157+
158+ locale_path = os .path .join (os .path .dirname (__file__ ), 'locale' )
159+ available_languages = []
160+
161+ if os .path .isdir (locale_path ):
162+ available_languages = [
163+ lang for lang in os .listdir (locale_path )
164+ if os .path .isdir (os .path .join (locale_path , lang )) and lang != 'source'
158165 ]
166+ if 'en' not in available_languages :
167+ available_languages .append ('en' )
168+ available_languages .sort ()
159169
170+ html_context ['available_languages' ] = available_languages
You can’t perform that action at this time.
0 commit comments