Coverage for app/venv/lib/python3.14/site-packages/weblate/trans/models/_conf.py: 100%

77 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 07:15 +0000

1# Copyright © Michal Čihař <michal@weblate.org> 

2# 

3# SPDX-License-Identifier: GPL-3.0-or-later 

4 

5# mypy: disable-error-code="var-annotated" 

6from __future__ import annotations 

7 

8from typing import ClassVar 

9 

10from appconf import AppConf 

11 

12 

13class WeblateConf(AppConf): 

14 # Data directory 

15 DATA_DIR = None 

16 

17 # Cache directory 

18 CACHE_DIR = None 

19 

20 # Title of site to use 

21 SITE_TITLE = "Weblate" 

22 

23 # Site domain 

24 SITE_DOMAIN = "" 

25 

26 # Whether this is hosted.weblate.org 

27 OFFER_HOSTING = False 

28 

29 # Enable remote hooks 

30 ENABLE_HOOKS = True 

31 

32 # Enable sharing 

33 ENABLE_SHARING = True 

34 

35 # Default number of elements to display when pagination is active 

36 DEFAULT_PAGE_LIMIT = 100 

37 

38 # Number of nearby messages to show in each direction 

39 NEARBY_MESSAGES = 15 

40 

41 # Minimal number of similar messages to show 

42 SIMILAR_MESSAGES = 5 

43 

44 # Enable lazy commits 

45 COMMIT_PENDING_HOURS = 24 

46 

47 # Automatically update vcs repositories daily 

48 AUTO_UPDATE = False 

49 

50 # List of automatic fixups 

51 AUTOFIX_LIST = ( 

52 "weblate.trans.autofixes.whitespace.SameBookendingWhitespace", 

53 "weblate.trans.autofixes.chars.ReplaceTrailingDotsWithEllipsis", 

54 "weblate.trans.autofixes.chars.RemoveZeroSpace", 

55 "weblate.trans.autofixes.chars.RemoveControlChars", 

56 "weblate.trans.autofixes.chars.DevanagariDanda", 

57 "weblate.trans.autofixes.chars.PunctuationSpacing", 

58 "weblate.trans.autofixes.html.BleachHTML", 

59 ) 

60 

61 # Matomo, formerly known as Piwik 

62 MATOMO_SITE_ID = None 

63 MATOMO_URL = None 

64 

65 # Google Analytics 

66 GOOGLE_ANALYTICS_ID = None 

67 

68 # Link for support portal 

69 GET_HELP_URL = None 

70 

71 # URL with status monitoring 

72 STATUS_URL = None 

73 

74 # URL with legal docs 

75 LEGAL_URL = None 

76 PRIVACY_URL = None 

77 

78 # Disable length limitations calculated from the source string length 

79 LIMIT_TRANSLATION_LENGTH_BY_SOURCE_LENGTH = True 

80 

81 # Is the site using https 

82 ENABLE_HTTPS = False 

83 

84 # Hiding repository credentials 

85 HIDE_REPO_CREDENTIALS = True 

86 

87 CREATE_GLOSSARIES = True 

88 

89 # Default committer 

90 DEFAULT_COMMITER_EMAIL = "noreply@weblate.org" 

91 DEFAULT_COMMITER_NAME = "Weblate" 

92 

93 DEFAULT_TRANSLATION_PROPAGATION = True 

94 DEFAULT_MERGE_STYLE = "rebase" 

95 

96 DEFAULT_ACCESS_CONTROL = 0 

97 DEFAULT_RESTRICTED_COMPONENT = False 

98 DEFAULT_SHARED_TM = True 

99 DEFAULT_AUTOCLEAN_TM = False 

100 

101 DEFAULT_PUSH_ON_COMMIT = True 

102 DEFAULT_AUTO_LOCK_ERROR = True 

103 DEFAULT_VCS = "git" 

104 DEFAULT_COMMIT_MESSAGE = ( 

105 "Translated using Weblate ({{ language_name }})\n\n" 

106 "Currently translated at {{ stats.translated_percent }}% " 

107 "({{ stats.translated }} of {{ stats.all }} strings)\n\n" 

108 "Translation: {{ project_name }}/{{ component_name }}\n" 

109 "Translate-URL: {{ url }}" 

110 ) 

111 

112 DEFAULT_ADD_MESSAGE = "Added translation using Weblate ({{ language_name }})\n\n" 

113 

114 DEFAULT_DELETE_MESSAGE = ( 

115 "Deleted translation using Weblate ({{ language_name }})\n\n" 

116 ) 

117 

118 DEFAULT_MERGE_MESSAGE = ( 

119 "Merge branch '{{ component_remote_branch }}' into Weblate.\n\n" 

120 ) 

121 

122 DEFAULT_ADDON_MESSAGE = """Update translation files 

123 

124Updated by "{{ addon_name }}" add-on in Weblate. 

125 

126Translation: {{ project_name }}/{{ component_name }} 

127Translate-URL: {{ url }}""" 

128 

129 DEFAULT_PULL_MESSAGE = """Translations update from {{ site_title }} 

130 

131Translations update from [{{ site_title }}]({{ site_url }}) for [{{ project_name }}/{{ component_name }}]({{url}}). 

132 

133{% if component_linked_children %} 

134It also includes following components: 

135{% for linked in component_linked_children %} 

136* [{{ linked.project_name }}/{{ linked.name }}]({{ linked.url }}) 

137{% endfor %} 

138{% endif %} 

139 

140Current translation status: 

141 

142![Weblate translation status]({{widget_url}}) 

143""" 

144 

145 # Billing 

146 INVOICE_PATH = "" 

147 INVOICE_PATH_LEGACY = "" 

148 VAT_RATE = 1.21 

149 SUPPORT_API_URL = "https://weblate.org/api/support/" 

150 

151 # Rate limiting 

152 IP_BEHIND_REVERSE_PROXY = False 

153 IP_PROXY_HEADER = "HTTP_X_FORWARDED_FOR" 

154 IP_PROXY_OFFSET = -1 

155 

156 # Authentication 

157 AUTH_TOKEN_VALID = 172800 

158 AUTH_LOCK_ATTEMPTS = 10 

159 AUTH_PASSWORD_DAYS = 180 

160 

161 # Mail customization 

162 ADMINS_CONTACT: ClassVar[list] = [] 

163 ADMINS_HOSTING: ClassVar[list] = [] 

164 ADMINS_BILLING: ClassVar[list] = [] 

165 

166 # Special chars for visual keyboard 

167 SPECIAL_CHARS = ("\t", "\n", "\u00a0", "…") 

168 

169 DEFAULT_ADDONS: ClassVar[dict] = {} 

170 

171 SUGGESTION_CLEANUP_DAYS = None 

172 COMMENT_CLEANUP_DAYS = None 

173 REPOSITORY_ALERT_THRESHOLD = 25 

174 UNUSED_ALERT_DAYS = 365 

175 BACKGROUND_TASKS = "monthly" 

176 

177 SINGLE_PROJECT = False 

178 LICENSE_EXTRA: ClassVar[list] = [] 

179 LICENSE_FILTER = None 

180 LICENSE_REQUIRED = False 

181 WEBSITE_REQUIRED = True 

182 FONTS_CDN_URL = None 

183 PROJECT_BACKUP_KEEP_DAYS = 30 

184 PROJECT_BACKUP_KEEP_COUNT = 3 

185 

186 EXTRA_HTML_HEAD = "" 

187 

188 IP_ADDRESSES: ClassVar[list] = [] 

189 

190 class Meta: 

191 prefix = ""