-
Notifications
You must be signed in to change notification settings - Fork 3
/
tool_translations_config.py
42 lines (32 loc) · 1.16 KB
/
tool_translations_config.py
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
from toolforge_i18n.translations import TranslationsConfig
def _identity(s: str) -> str:
return s
_variables = {
'nav-logged-in': ['user_link', 'user_name'],
'index-paragraph-1': ['P2677', 'P180', 'P9664'],
'index-paragraph-2': ['url_wikidata', 'P18', 'url_sdoc'],
'index-placeholder-item-id': ['example_id', 'example_url'], # example_url is *not* a “url” argument
'index-placeholder-file-title': ['example_name', 'example_id', 'example_url'], # ditto
'alert-not-logged-in': ['url'],
'file-not-found-body': ['title'],
'wrong-data-value-type-paragraph-1': ['expected_data_value_type', 'actual_data_value_type'],
}
_derived_messages = {
'index-h1': ('tool-name', _identity),
'html-title': ('tool-name', _identity),
'nav-tool-name': ('tool-name', _identity),
'settings-link': ('settings', _identity),
'settings-h1': ('settings', _identity),
}
_allowed_html_elements = {
'abbr': {'title'},
'code': set(),
'noscript': set(),
'q': set(),
'small': set(),
}
config = TranslationsConfig(
variables=_variables,
derived_messages=_derived_messages,
allowed_html_elements=_allowed_html_elements,
)