선택적 Weblate 모듈¶
설치에 사용할 수 있는 여러 선택적 모듈이 있습니다.
Git 내보내기¶
HTTP(S)를 사용하여 기본 Git 저장소에 대한 읽기 전용 접근을 제공합니다.
설치¶
settings.py의 설치된 앱에weblate.gitexport를 추가함:INSTALLED_APPS += ("weblate.gitexport",)
설치 후 데이터베이스를 마이그레이션하여 기존 저장소를 내보냅니다:
weblate migrate
힌트
Git exporter is turned on in our official Docker image. To turn it off, use:
WEBLATE_REMOVE_APPS=weblate.gitexport
사용법¶
이 모듈은 Weblate에 자동으로 연결되어 구성요소 설정 에 내보내기 저장소 URL을 설정합니다. 저장소는 Weblate URL의 /git/ 부분에서 접근할 수 있습니다. 예: https://example.org/git/weblate/main/.
공개적으로 사용 가능한 프로젝트의 저장소는 인증 없이 클론할 수 있음:
git clone 'https://example.org/git/weblate/main/'
접근이 제한된 저장소를 탐색하려면 (Private 접근 제어 또는 REQUIRE_LOGIN 이 활성화된 경우) 사용자 프로필 에서 얻을 수 있는 API 토큰이 필요함:
git clone 'https://user:KEY@example.org/git/weblate/main/'
참고
Weblate serves the Git repository itself, but it does not serve Git LFS
objects. See Git LFS for supported behavior. Clone repositories using
Git LFS from the upstream repository and add Weblate as another remote. If
you only need Git-tracked files, you can clone from Weblate with
GIT_LFS_SKIP_SMUDGE=1 to skip downloading Git LFS objects.
힌트
By default members of Users group and anonymous user have access to the repositories for public projects via Access repository and Power user roles.
결제¶
호스팅 Weblate 에서 결제 플랜 정의, 청구서 및 사용량 한도 추적에 사용됩니다.
설치¶
1. Add weblate.billing to installed apps in
settings.py:
INSTALLED_APPS += ("weblate.billing",)
선택적으로 모듈의 추가 데이터베이스 구조를 설치하려면 데이터베이스 마이그레이션을 실행함:
weblate migrate
결제 플랜 생성 및 할당¶
먼저 결제를 활성화하려면 결제 플랜을 만들어야 합니다. 관리 섹션(렌치 아이콘으로 표시)으로 이동하여 ` 도구` 화면을 엽니다. 거기서 Django 관리자 인터페이스 로 진행합니다.
Django 관리자 인터페이스에서 BILLING 섹션을 찾아 결제 플랜을 추가합니다. 예를 들어 비용이 없는 Free 플랜을 추가할 수 있습니다.
기존 프로젝트에 결제 플랜을 할당하려면 Django 관리자 인터페이스 에서 Customer billings 옵션을 사용하여 수행할 수도 있습니다.
마지막으로 Django 관리자 인터페이스 에서 고객 결제를 기록하는 Invoice 옵션을 제공합니다.
사용법¶
설치 후 관리자 인터페이스에서 결제를 제어할 수 있습니다. 결제가 활성화된 사용자는 사용자 프로필 에 새로운 결제 탭이 표시됩니다.
Superusers can view the 20 most recent billing audit entries on the billing detail page. Select View all in the Audit log section to browse older entries using the pagination controls.
결제 모듈은 추가로 사용자가 슈퍼유저가 아니어도 새 프로젝트와 구성요소를 만들 수 있게 합니다(번역 프로젝트 및 구성요소 추가 참조). 다음 조건이 충족되면 가능합니다:
결제가 설정된 한도 내에 있고 (초과 사용 시 프로젝트/구성요소 생성이 차단됨) 결제가 완료된 경우 (가격이 0이 아닌 경우)
사용자가 결제 플랜이 적용되는 작업공간에 대해 작업공간에 프로젝트 추가 권한을 가지고 있습니다.
프로젝트를 만들 때 사용자는 프로젝트가 포함될 작업공간을 선택할 수 있습니다. 결제가 있는 작업공간에서 만든 프로젝트는 해당 작업공간에 할당된 결제 플랜에 계산됩니다. 작업공간 설정 편집 권한이 있는 사용자는 결제 플랜을 보고 결제할 수 있으며, 결제 알림 이메일은 이 사용자들에게 전송됩니다. 자세한 내용은 결제 을 참조하세요.
법적 모듈¶
호스팅 Weblate 에서 필수 법적 문서를 제공하는 데 사용됩니다. 빈 문서가 제공되며 문서에서 다음 템플릿을 작성해야 함:
legal/documents/tos.html서비스 약관 문서
legal/documents/privacy.html개인정보 처리방침 문서
legal/documents/summary.html서비스 약관 및 개인정보 처리방침의 간략한 개요
legal/documents/contracts.html하청업체 정보
The legal module embeds these templates inside Weblate. Its confirmation page
uses legal/documents/tos.html and, when a privacy policy link is
available, requires one agreement covering both the terms of service and the
privacy policy. This is separate from LEGAL_URL and
PRIVACY_URL, which are meant for linking to externally hosted legal
documents from the footer when the legal module is not enabled or as fallbacks
for hidden internal pages. When the legal module is enabled, Weblate links to
the internal legal pages by default.
On changing the terms of service or privacy policy, adjust
LEGAL_TOS_DATE when users should be forced to agree with the updated
documents.
참고
Weblate s.r.o.가 운영하는 호스팅 Weblate 서비스의 법적 문서는 이 Git 저장소에서 확인할 수 있음: <https://github.com/WeblateOrg/wllegal/tree/main/wllegal/templates/legal/documents>.
The bundled terms of service and related legal documents are specific to services operated by Weblate s.r.o. They can serve as an implementation example, but should not be used as a basis for legal documents of other services.
설치¶
1. Add weblate.legal to installed apps in
settings.py:
INSTALLED_APPS += ("weblate.legal",)
# Optional:
# Social auth pipeline to confirm TOS upon registration/subsequent sign in
SOCIAL_AUTH_PIPELINE = list(SOCIAL_AUTH_PIPELINE)
SOCIAL_AUTH_PIPELINE.insert(
SOCIAL_AUTH_PIPELINE.index("weblate.accounts.pipeline.second_factor") + 1,
"weblate.legal.pipeline.tos_confirm",
)
# Middleware to enforce TOS confirmation of signed in users
MIDDLEWARE += [
"weblate.legal.middleware.RequireTOSMiddleware",
]
Insert terms confirmation after two-factor authentication and before team synchronization so that logins awaiting terms acceptance do not change team memberships.
선택적으로 모듈의 추가 데이터베이스 구조를 설치하려면 데이터베이스 마이그레이션을 실행함:
weblate migrate
Provide legal document templates matching your service, as described in Customizing legal documents and styles.
힌트
In Docker deployments, enable the legal module using
WEBLATE_LEGAL_INTEGRATION instead of editing
settings.py. Use tos-confirm to enable the legal module and
legal document confirmation enforcement, or wllegal to additionally
load the hosted legal document templates used by services operated by
Weblate s.r.o. These templates are not intended for general use. To provide
your own templates in Docker, place them in
/app/data/python/customize/templates/legal/documents, see
로고 및 기타 정적 파일 교체.
Recreate the Docker container after changing environment variables, for example using docker compose up -d. Restarting an existing container does not apply changed environment values.
사용법¶
After installation and customization, the legal documents are shown in the Weblate UI.
The legal document templates are regular Django templates. Text is translated
only when you use Django translation tags such as {% translate %} or
{% blocktranslate %}; plain HTML text is shown as written.
Legal pages and the sign-in and registration overview provide terms_url and
privacy_url variables for linking to the terms of service and privacy
policy documents.
Customizing legal documents and styles¶
Provide your own legal documents by overriding these templates in a Python 모듈 생성:
templates/legal/documents/tos.htmltemplates/legal/documents/privacy.htmltemplates/legal/documents/summary.htmltemplates/legal/documents/contracts.htmltemplates/legal/styles.htmlstatic/weblate_customization/legal.css
Place the customization app before weblate.legal and any other app
providing legal template overrides in INSTALLED_APPS so that
Django selects its templates. Only templates you provide are overridden; the
remaining legal templates continue to use the defaults from later apps.
The legal/styles.html template is included in the HTML head of every
legal page. Use it to load a stylesheet from your customization app:
{% load static %}
<link rel="stylesheet" href="{% static 'weblate_customization/legal.css' %}" />
Run weblate collectstatic --noinput after adding or changing the static
file.
In Docker deployments, place document templates in
/app/data/python/customize/templates/legal/documents,
styles.html in
/app/data/python/customize/templates/legal/styles.html, and the
stylesheet in /app/data/python/customize/static/legal.css. The
stylesheet template then uses {% static 'legal.css' %}. Restart the
container to apply the changes, see 로고 및 기타 정적 파일 교체.
By default, legal document wrappers use the tos CSS class. Weblate does not
attach any styling to this class; target it from your custom stylesheet, or set
LEGAL_DOCUMENT_CSS_CLASS to another class matching your document
markup. Set the setting to an empty string if no wrapper class is needed.
Use LEGAL_HIDDEN_DOCUMENTS to hide optional legal pages such as
subcontractors from the legal menu. Hidden pages return a 404 response when
requested directly. If terms or privacy is hidden, links using
terms_url or privacy_url fall back to LEGAL_URL or
PRIVACY_URL when configured, otherwise the link is omitted.
To use externally hosted legal documents with legal confirmation, configure
LEGAL_HIDDEN_DOCUMENTS to hide terms and privacy and set
LEGAL_URL and PRIVACY_URL. The confirmation page then
links to those external documents and requires one agreement covering both
without needing a legal/documents/tos.html template override. If no
privacy policy link is available, the confirmation covers only the terms of
service.
아바타¶
아바타는 기본적으로 아바타를 제공하는 사이트로의 정보 유출을 줄이기 위해 서버 측에서 다운로드되고 캐시됩니다. 이메일 주소에서 아바타를 가져오는 내장 지원은 ENABLE_AVATARS 를 사용하여 끌 수 있습니다.
Weblate는 현재 다음을 지원함:
현지화 CDN¶
자바스크립트 현지화 CDN 및 번역 파일 CDN 애드온은 파일을 LOCALIZE_CDN_PATH 에 씁니다. Weblate는 이를 제공하지 않습니다. LOCALIZE_CDN_URL 을 제공하는 웹 서버 또는 CDN을 공개 읽기 전용 정적 파일 호스트로 구성하세요.
게시된 모든 CDN 파일을 공개로 취급하세요. URL 안의 애드온별 UUID는 접근 제어 수단이 아닙니다. 비공개 문자열, 미출시 제품 문구, 고객 데이터, 내부 URL, API 예제, 저장소 경로, 번역자 의견 또는 노출되어서는 안 되는 파일 형식 메타데이터가 포함된 구성요소에는 CDN 애드온을 활성화하지 마세요.
번역 파일 CDN 애드온은 Weblate가 지원하는 형식의 원시 번역 파일을 게시합니다. 일부 형식은 브라우저나 다른 클라이언트에서 HTML, SVG, XML, JavaScript, YAML 또는 애플리케이션별 구성으로 해석될 수 있습니다. CDN은 Weblate 및 번역을 사용하는 애플리케이션과 분리된 전용 도메인에서 제공하세요. 인증 쿠키를 CDN 도메인과 공유하지 마세요.
권장 서버 구성:
LOCALIZE_CDN_PATH로 구성된 디렉터리만 제공하세요. Weblate 저장소, 백업, 미디어, 구성 또는 전체 데이터 디렉터리를 노출하지 마세요.디렉터리 목록 표시를 비활성화하세요.
Deny access to
.kotlin-sdk-stagingand all its contents. The Kotlin SDK add-on uses this directory for temporary preparation, not publication. Apply this restriction before enabling the add-on, including when a CDN copies files from the origin directory.HTTPS를 사용하고 웹 서버에서 CDN 호스트를 읽기 전용으로 만드세요.
nosniff와 함께 X-Content-Type-Options 를 보내세요.보수적인 MIME 유형을 구성하세요. 알 수 없는 번역 형식은 text/plain 또는 application/octet-stream 으로 제공하고,
weblate.js만 JavaScript로 제공하세요.브라우저에서 렌더링할 목적이 아닌 원시 번역 형식의 경우
attachment와 함께 Content-Disposition 을 추가하는 것을 고려하세요.파일에 대한 브라우저 접근이 필요한 사이트에 대해서만
Access-Control-Allow-Origin을 구성하세요.업데이트 기대치에 맞는 캐시 수명을 지정하고, 오래된 번역을 빠르게 사라지게 해야 할 때는 CDN 캐시를 제거하세요.
다음 nginx 조각은 구성된 CDN 디렉터리만 제공하고 원시 번역 파일에 보수적인 기본값을 적용합니다:
#
# nginx configuration for the Weblate localization CDN
#
# You will want to change:
#
# - server_name to match the host configured in LOCALIZE_CDN_URL
# - root to match LOCALIZE_CDN_PATH
# - Access-Control-Allow-Origin to the sites that need browser access
# - TLS configuration if HTTPS is not terminated before nginx
#
server {
listen 80;
server_name cdn.example.com;
# LOCALIZE_CDN_PATH
root /home/weblate/data/l10n-cdn;
autoindex off;
disable_symlinks on;
location = / {
return 404;
}
# Kotlin SDK preparation files must never be served.
location ^~ /.kotlin-sdk-staging {
return 404;
}
# The JavaScript localization add-on publishes this loader.
location ~ "^/[0-9a-f]{32}/weblate\.js$" {
try_files $uri =404;
types {
application/javascript js;
}
default_type application/javascript;
add_header X-Content-Type-Options nosniff always;
# add_header Access-Control-Allow-Origin "https://www.example.com" always;
expires 1h;
}
# Content-addressed Android artifacts never change at the same URL.
location ~ "^/[0-9a-f]{32}/artifacts/[0-9a-f]{64}\\.arsc$" {
try_files $uri =404;
types { }
default_type application/octet-stream;
add_header X-Content-Type-Options nosniff always;
add_header Content-Disposition "attachment" always;
add_header Cache-Control "public, max-age=31536000, immutable";
# add_header Access-Control-Allow-Origin "https://www.example.com" always;
}
# Other CDN files are translation files. Serve them conservatively so raw
# formats are not interpreted as active browser content.
# Manifest JSON files also use this one-hour cache policy.
location / {
try_files $uri =404;
types {
}
default_type text/plain;
add_header X-Content-Type-Options nosniff always;
add_header Content-Disposition "attachment" always;
# add_header Access-Control-Allow-Origin "https://www.example.com" always;
expires 1h;
}
}
GnuPG로 Git 커밋 서명¶
모든 커밋은 Weblate 인스턴스의 GnuPG 키로 서명할 수 있습니다.
WEBLATE_GPG_IDENTITY를 켭니다. (Weblate는 필요 시 GnuPG 키를 생성하고 모든 번역 커밋을 서명하는 데 사용합니다.)이 기능은 GnuPG 2.1 이상이 설치되어 있어야 합니다.
DATA_DIR에서 키를 찾을 수 있으며 공개 키는 “정보” 페이지에 표시됨:
또는 gpg를 호출할 때
HOME=$DATA_DIR/home을 설정하여 기존 키를 Weblate로 가져올 수도 있습니다.
힌트
키 자료는 Weblate에 의해 오랜 기간 캐시됩니다. WEBLATE_GPG_IDENTITY 로 Weblate가 키를 생성하게 한 다음 기존 키를 사용하기 위해 동일한 ID로 키를 가져온 경우, 이러한 변경의 효과를 확인하려면 Redis 캐시를 비우는 것이 권장됩니다.
참고
여러 호스트 간에 DATA_DIR 을 공유할 때 GnuPG 서명이 안정적으로 작동하도록 https://wiki.gnupg.org/NFS의 지침을 따르세요.
더 보기
속도 제한¶
버전 4.6에서 변경: 속도 제한은 로그인한 슈퍼유저에게 더 이상 적용되지 않습니다.
Several operations in Weblate are rate limited. Rate limits are evaluated
independently for each scope. At most RATELIMIT_ATTEMPTS attempts are
allowed within RATELIMIT_WINDOW seconds in one scope. That scope is
then blocked for RATELIMIT_LOCKOUT; Weblate does not turn this into a
sitewide temporary IP ban. Exceeding one scope, such as TRANSLATE or
SEARCH, does not by itself block unrelated scopes such as LOGIN or
SECOND_FACTOR. There are also settings specific to scopes, for example
RATELIMIT_CONTACT_ATTEMPTS or RATELIMIT_TRANSLATE_ATTEMPTS. The table
below is a full list of available scopes.
다음 작업에 속도 제한이 적용됨:
이름 |
범위 |
허용된 시도 횟수 |
속도 제한 윈도우 |
잠금 기간 |
|---|---|---|---|---|
가입 |
|
5 |
300 |
600 |
관리자에게 메시지 보내기 |
|
2 |
300 |
600 |
로그인 시 비밀번호 인증 |
|
5 |
300 |
600 |
비밀번호 재설정 |
|
5 |
300 |
600 |
2단계 인증 |
|
5 |
300 |
600 |
사이트 전체 검색 |
|
6 |
60 |
60 |
번역 |
|
30 |
60 |
600 |
용어집에 추가 |
|
30 |
60 |
600 |
새 언어로 번역 시작 |
|
2 |
300 |
600 |
새 프로젝트 만들기 |
|
5 |
600 |
600 |
Connecting a GitHub account |
|
100 |
3600 |
600 |
Rendering a Markdown preview |
|
60 |
60 |
60 |
Within each scope, the rate limiting is based on sessions when user is signed in and on IP address if not.
Strict enforcement across concurrent workers requires a cache backend with atomic increment and decrement operations. The standard 캐시 설정 configuration using Valkey or Redis provides these operations.
For signed-in users, Weblate records the first rejected request during each active scope lockout in the 감사 로그, including the scope and request path. Repeated rejections during the same lockout do not create additional audit-log entries.
사용자가 AUTH_LOCK_ATTEMPTS 시간에 로그인하지 않으면 암호 인증은 암호 재설정 프로세스를 통해 사라질 때까지 계정에 꺼집니다.
설정 이름에 WEBLATE_ 접두사를 추가하여 Docker 컨테이너에서도 설정을 적용할 수 있습니다. 예를 들어 RATELIMIT_ATTEMPTS 는 WEBLATE_RATELIMIT_ATTEMPTS 가 됩니다.
API에는 별도의 속도 제한 설정이 있습니다 ( API 속도 제한 참조).
더 보기