Compare commits

...

6 Commits

Author SHA1 Message Date
Ran-Mewo acbd90ac5a Add instructions for downloading translations 2026-02-03 11:43:51 +11:00
Ran-Mewo 731d3f63fd Undo commiting translations 2026-02-03 10:17:50 +11:00
Ran-Mewo 909168d63b Do crowdin upload sources only when there's a change. 2026-01-27 01:30:58 +11:00
Ran-Mewo 235ab0e961 Make build dependent on translations 2026-01-24 22:58:01 +06:00
Ran-Mewo 152684bbee make the translations stage automatic 2026-01-24 22:23:20 +06:00
Ran-Mewo 50fe44ebf9 trans :3 lations 2026-01-24 21:49:49 +06:00
5 changed files with 49 additions and 0 deletions
+18
View File
@@ -5,6 +5,7 @@ image: eclipse-temurin:21
# all stages need to be defined here # all stages need to be defined here
# TODO: Make stages depend on what is in versionProperties # TODO: Make stages depend on what is in versionProperties
stages: stages:
- translations
- build - build
- api - api
- pages - pages
@@ -33,6 +34,9 @@ variables:
build: build:
stage: build stage: build
needs:
- job: translations
artifacts: true
parallel: parallel:
matrix: matrix:
- MC_VER: [ - MC_VER: [
@@ -102,3 +106,17 @@ pages:
- public - public
allow_failure: false allow_failure: false
extends: .build_java extends: .build_java
translations:
stage: translations
needs: []
image: crowdin/cli:latest
script:
- if [ "$CI_COMMIT_BEFORE_SHA" = "0000000000000000000000000000000000000000" ] || git diff --name-only "$CI_COMMIT_BEFORE_SHA" "$CI_COMMIT_SHA" -- coreSubProjects/core/src/main/resources/assets/distanthorizons/lang | grep -q .; then crowdin upload sources; fi
- crowdin download --export-only-approved --skip-untranslated-files
- for f in coreSubProjects/core/src/main/resources/assets/distanthorizons/lang/*.json; do [ -e "$f" ] || continue; sed -i 's/\\\\n/\\n/g' "$f"; n="$(basename "$f" | tr '[:upper:]' '[:lower:]')"; [ "$(basename "$f")" = "$n" ] || mv "$f" "$(dirname "$f")/$n"; done
artifacts:
paths:
- coreSubProjects/core/src/main/resources/assets/distanthorizons/lang/**
expire_in: 1 day
when: always
+5
View File
@@ -12,6 +12,11 @@ Below is a video demonstrating the system:
<a href="https://youtu.be/SxQdbtjGEsc" target="_blank">![Distant Horizons - Alpha 2.0](https://i.ytimg.com/vi/SxQdbtjGEsc/hqdefault.jpg)</a> <a href="https://youtu.be/SxQdbtjGEsc" target="_blank">![Distant Horizons - Alpha 2.0](https://i.ytimg.com/vi/SxQdbtjGEsc/hqdefault.jpg)</a>
## Translations
[![Crowdin](https://badges.crowdin.net/distant-horizons/localized.svg)](https://crowdin.com/project/distant-horizons)\
Crowdin Project: [Distant Horizons](https://crowdin.com/project/distant-horizons)\
Guidelines: [translations.md](translations.md)
<br> <br>
## Minecraft and Library Versions ## Minecraft and Library Versions
+2
View File
@@ -4,7 +4,9 @@ Thanks for your interest in contributing to Distant Horizons!
Check out the [Core Wiki](https://gitlab.com/jeseibel/distant-horizons-core/-/wikis/home) for a rough overview of Distant Horizon's project structure. Check out the [Core Wiki](https://gitlab.com/jeseibel/distant-horizons-core/-/wikis/home) for a rough overview of Distant Horizon's project structure.
## Translations
See [translations.md](translations.md) for the Crowdin workflow.
## Submitting a merge request ## Submitting a merge request
+8
View File
@@ -0,0 +1,8 @@
project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN
base_path: ./coreSubProjects/core/src/main/resources/assets/distanthorizons/lang
preserve_hierarchy: true
files:
- source: /en_us.json
translation: /%locale_with_underscore%.json
type: json
+16
View File
@@ -0,0 +1,16 @@
Translations are managed via Crowdin: https://crowdin.com/project/distant-horizons
## How to help:
1. Create a Crowdin account
2. Join the project
3. Translate strings from `en_us.json`.
## Notes:
- Keys ending with `@tooltip` are tooltips.
- Keep formatting codes intact, IE: `§`, `%s`, `%d`, `%1$s`.
- For newlines, utilize **Shift + Enter** instead of `\n`.
- Do not edit non-English files in pull requests.
## To pull translations into the repo
- Downlod the [Crowdin CLI](https://github.com/crowdin/crowdin-cli/releases)
- Run `crowdin download --export-only-approved --skip-untranslated-files` in the project root.