diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0331a2ebc..42a31ba31 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,9 +74,9 @@ friendly to newcomers are tagged [`good first issue`][good-first-issue]. ### I'd like to contribute translations -Please use the [Grimmory Weblate project](https://hosted.weblate.org/engage/grimmory/) for -non-English localization work. Weblate tracks `develop`, shows missing and outdated strings, and -sends translation updates back to the repository as reviewed pull requests. +Please use the [Grimmory Crowdin project](https://crowdin.com/project/grimmory) for +non-English localization work. Crowdin's hosted GitHub integration tracks `develop`, shows missing +and outdated strings, and sends translation updates back as reviewed pull requests. When translating, preserve placeholders exactly, such as `{{ name }}`, `{{ count }}`, and `{{ provider }}`. Do not translate placeholder names. Keep HTML tags intact when they appear in a diff --git a/README.md b/README.md index fc1d190b5..b4e8c03cd 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ [![Release](https://img.shields.io/github/v/release/grimmory-tools/grimmory?color=818CF8&logo=github)](https://github.com/grimmory-tools/grimmory/releases) [![License](https://img.shields.io/github/license/grimmory-tools/grimmory?color=fab005)](LICENSE) -Translation status +[![Crowdin](https://badges.crowdin.net/grimmory/localized.svg)](https://crowdin.com/project/grimmory) [![Docker Pulls](https://img.shields.io/docker/pulls/grimmory/grimmory?color=2496ED&logo=docker&logoColor=white)](https://hub.docker.com/r/grimmory/grimmory) [![Discord](https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white)](https://discord.gg/9YJ7HB4n8T) -[Documentation](https://grimmory.org/docs) · [Quick Start](#quick-start) · [Translations](https://hosted.weblate.org/engage/grimmory/) · [Discord](https://discord.gg/9YJ7HB4n8T) · [Releases](https://github.com/grimmory-tools/grimmory/releases) +[Documentation](https://grimmory.org/docs) · [Quick Start](#quick-start) · [Translations](https://crowdin.com/project/grimmory) · [Discord](https://discord.gg/9YJ7HB4n8T) · [Releases](https://github.com/grimmory-tools/grimmory/releases) @@ -184,7 +184,7 @@ Additional deployment examples: Contributor workflow, PR policy, and release semantics live in [CONTRIBUTING.md](CONTRIBUTING.md). -Non-English translation contributions are managed through [Weblate](https://hosted.weblate.org/engage/grimmory/). +Non-English translation contributions are managed through [Crowdin](https://crowdin.com/project/grimmory). General purpose development guidelines live in [DEVELOPMENT.md](DEVELOPMENT.md). Component-specific implementation guidance lives in: diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 000000000..15a899429 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,10 @@ +preserve_hierarchy: false + +pull_request_title: 'chore(i18n): update translations from Crowdin' +commit_message: 'chore(i18n): update translations from Crowdin' +append_commit_message: false + +files: + - source: /frontend/src/i18n/en.json + translation: /frontend/src/i18n/%two_letters_code%.json + type: json diff --git a/scripts/i18n/weblate-setup.sh b/scripts/i18n/weblate-setup.sh deleted file mode 100755 index 9811cbc3a..000000000 --- a/scripts/i18n/weblate-setup.sh +++ /dev/null @@ -1,248 +0,0 @@ -#!/usr/bin/env bash -# -# Weblate Setup Script for Grimmory -# -# Creates the Weblate project and all translation components via the API. -# Run once after creating your Hosted Weblate account. -# -# Prerequisites: -# 1. Get your API token from https://hosted.weblate.org/accounts/profile/#api -# 2. Ensure your GitHub repo (grimmory-tools/grimmory) is public (required for Libre plan) -# -# Usage: -# WEBLATE_TOKEN=your-api-token ./scripts/weblate-setup.sh -# - -set -uo pipefail - -# ─── Configuration ──────────────────────────────────────────────────────────── -WEBLATE_URL="${WEBLATE_URL:-https://hosted.weblate.org}" -API="${WEBLATE_URL}/api" -TOKEN="${WEBLATE_TOKEN:?Set WEBLATE_TOKEN to your Weblate API token}" - -PROJECT_NAME="Grimmory" -PROJECT_SLUG="grimmory" -PROJECT_WEB="https://github.com/grimmory-tools/grimmory" - -REPO_URL="https://github.com/grimmory-tools/grimmory.git" -REPO_BRANCH="develop" -FILE_BASE="frontend/src/i18n" - -SOURCE_LANG="en" - -# All languages the project supports -LANGUAGES="en es de fr hr it ja nl pl pt ru sv zh hu sl sk uk id da ko cs" - -# All translation domain files (without .json extension) -COMPONENTS=( - common - auth - nav - dashboard - settings - settings-email - settings-reader - settings-view - settings-metadata - settings-library-metadata - settings-application - settings-users - settings-naming - settings-opds - settings-tasks - settings-auth - settings-audit-logs - settings-device - settings-profile - app - shared - layout - library-creator - bookdrop - metadata - book - magic-shelf - notebook - reader-audiobook - reader-cbx - reader-ebook - reader-pdf - series-browser - stats-library - stats-user - author-browser -) - -# ─── Helpers ────────────────────────────────────────────────────────────────── -auth_header="Authorization: Token ${TOKEN}" -content_type="Content-Type: application/json" - -LANG_REGEX="^(en|es|de|fr|hr|it|ja|nl|pl|pt|ru|sv|zh|hu|sl|sk|uk|id|da|ko|cs)$" - -api_post() { - local endpoint="$1" - local data="$2" - local response - response=$(curl -s -w "\n%{http_code}" -X POST "${API}${endpoint}" \ - -H "${auth_header}" \ - -H "${content_type}" \ - -d "${data}") - local http_code - http_code=$(echo "$response" | tail -1) - local body - body=$(echo "$response" | sed '$d') - - if [[ "$http_code" -ge 200 && "$http_code" -lt 300 ]]; then - echo " OK (${http_code})" - return 0 - elif echo "$body" | grep -q "already exists"; then - echo " Already exists, skipping" - return 0 - elif [[ "$http_code" == "403" ]] && echo "$body" | grep -q "billing\|limit"; then - echo " Already exists (billing limit), skipping" - return 0 - else - echo " FAILED (${http_code}): ${body}" - return 1 - fi -} - -api_patch() { - local endpoint="$1" - local data="$2" - local response - response=$(curl -s -w "\n%{http_code}" -X PATCH "${API}${endpoint}" \ - -H "${auth_header}" \ - -H "${content_type}" \ - -d "${data}") - local http_code - http_code=$(echo "$response" | tail -1) - local body - body=$(echo "$response" | sed '$d') - - if [[ "$http_code" -ge 200 && "$http_code" -lt 300 ]]; then - echo " OK (${http_code})" - return 0 - else - echo " FAILED (${http_code}): ${body}" - return 1 - fi -} - -api_get() { - local endpoint="$1" - curl -s -X GET "${API}${endpoint}" -H "${auth_header}" -} - -# Pretty name from slug: settings-email -> Settings Email -pretty_name() { - echo "$1" | sed 's/-/ /g' | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2))}1' -} - -# ─── Step 1: Create Project ────────────────────────────────────────────────── -echo "=== Creating project: ${PROJECT_NAME} ===" -api_post "/projects/" "$(cat <