-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlanguage.py
More file actions
134 lines (131 loc) · 4.02 KB
/
language.py
File metadata and controls
134 lines (131 loc) · 4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
TITLES = {
"en": {
"ado": "teen",
"allblogs": "All blog posts",
"author": "author",
"blocref_node": "",
"blog_entry": (
"The original entry is located in " "<<%s>>, line %d and can be found "
),
"blogpost": "blogpost",
"book": "book",
"brefmes": "(<<%s>> : %s, line %d)",
"by category:": "By category:",
"by month:": "By month:",
"by title:": "By title :",
"catsmaonths": "All categories and months",
"changes": "Changes",
"child": "child",
"cmdmes": "(<<%s>> : %s, line %d)",
"code": "code",
"comic": "comic",
"disc": "disc",
"download": "download",
"exmes": "(<<%s>> : %s, line %d)",
"exref_node": "Examples",
"FAQ": "FAQ",
"faqmes": "(<<%s>> : %s, line %d)",
"faqref_node": "FAQ",
"film": "movie",
"glossary": "Glossary",
"hide": "hide",
"In": "<<<",
"license": "License",
"Magic commands": "Magic commands",
"main": "blog list",
"main2": "blog main page",
"main_title": "blog page",
"manga": "manga",
"mathdef_node": "",
"mathmes": "(<<%s>> : %s, line %d)",
"more": "post",
"nbmes": "(<<%s>> : %s, line %d)",
"nbref_node": "Magic command",
"original entry": "original entry",
"Out": ">>>",
"Out2": "Raw",
"outl": "output",
"page1": "first page",
"show": "show",
"toc": "Contents",
"toc0": "Links",
"toc1": "Information",
"todo": "Todo",
"todo_node": "Todo",
"todoext_node": "",
"todomes": "(The <<%s>> is located in %s, line %d.)",
"unhide": "unhide",
},
"fr": {
"ado": "ado",
"allblogs": "Tous les articles de blog",
"author": "auteur",
"blocref_node": "",
"blog_entry": "Source <<%s>>, line %d and can be found ",
"blogpost": "article",
"book": "livre",
"brefmes": "(<<%s>> : %s, ligne %d)",
"by category:": "Par catégorie :",
"by month:": "Par mois :",
"by title:": "Par titre :",
"catsmaonths": "Catégories et mois",
"changes": "Changements",
"child": "enfant",
"cmdmes": "(<<%s>> : %s, line %d)",
"code": "code",
"comic": "bande dessinée",
"disc": "disque",
"download": "télécharger",
"exmes": "(<<%s>> : %s, ligne %d)",
"exref_node": "Exemples",
"FAQ": "FAQ",
"faqmes": "(<<%s>> : %s, ligne %d)",
"faqref_node": "FAQ",
"film": "film",
"glossary": "Glossaire",
"hide": "cacher",
"In": "<<<",
"license": "Licence",
"Magic commands": "Commandes magiques",
"main": "liste d'articles du blog",
"main2": "page principale du blog",
"main_title": "page de blog",
"manga": "dessin animé",
"mathdef_node": "",
"mathmes": "(<<%s>> : %s, ligne %d)",
"more": "article",
"nbmes": "(<<%s>> : %s, ligne %d)",
"nbref_node": "Commande magique",
"original entry": "source",
"Out": ">>>",
"Out2": "Sortie brute",
"outl": "la sortie",
"page1": "première page",
"show": "série",
"toc": "Contenu",
"toc0": "Liens",
"toc1": "Information",
"todo": "A faire",
"todo_node": "A faire",
"todoext_node": "",
"todomes": "(<<%s>> : %s, ligne %d)",
"unhide": "montrer",
},
}
def sphinx_lang(env, default_value="en"):
"""
Returns the language defined in the configuration file.
:param env: environment
:param default_value: default value
:return: language
"""
if hasattr(env, "settings"):
settings = env.settings
if hasattr(settings, "language_code"):
lang = env.settings.language_code
else:
lang = "en"
else:
settings = None
lang = "en"
return lang