diff --git a/.github/workflows/addons.yml b/.github/workflows/addons.yml index 04bf4e7..cf9b818 100644 --- a/.github/workflows/addons.yml +++ b/.github/workflows/addons.yml @@ -1,76 +1,46 @@ name: Addons package -# Builds Core Rules Community Add-ons Collection, one self-installing -# AppImage with the add-ons inside (crates/cr-addons), and, on main or by -# hand, publishes it on GitHub Packages as the OCI artifact -# ghcr.io//corerules-community-addons, tagged with the app version -# and latest, and as the file itself in the Maven registry of GitHub -# Packages, and on the release "addons", whose tag follows main: there -# CoreRules-Community-Addons-x86_64.AppImage is always the newest, for a -# download link that does not change. The zip job puts the same add-ons -# there as CoreRules-Community-Addons.zip, for Import Add-ons… in the app. +# Builds the Core Rules Community Add-ons Collection as one .zip +# (addons/tools/addons_zip.py) for Import Add-ons… in the app, on Linux, +# Windows and macOS: Comunidade.xpx with the pictures, pictures.tsv and the +# texts. On main or by hand it publishes the zip on the release "addons", +# whose tag follows main: there CoreRules-Community-Addons.zip is always the +# newest, for a download link that does not change. on: push: branches: [main] paths: - 'addons/**' - - 'crates/cr-addons/**' - - 'data/addons/**' - - 'packaging/appimage/**' - '.github/workflows/addons.yml' pull_request: paths: - 'addons/**' - - 'crates/cr-addons/**' - - 'data/addons/**' - - 'packaging/appimage/**' - '.github/workflows/addons.yml' workflow_dispatch: permissions: contents: write - packages: write jobs: - package: + zip: runs-on: ubuntu-24.04 - container: - image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-51 - options: --privileged steps: - uses: actions/checkout@v4 - # The checkout belongs to the runner's user; root inside the SDK - # sandbox has no capabilities to write there. - - run: chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE" - id: v run: echo "version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)" >> "$GITHUB_OUTPUT" - - run: packaging/appimage/build-in-sdk.sh ${{ steps.v.outputs.version }} addons - - name: Check the AppImage + - run: python3 -I addons/tools/addons_zip.py ${{ steps.v.outputs.version }} dist + - name: Check the zip run: | - cd target/AppDir - test -x usr/bin/corerules-community-addons - test -f usr/share/icons/hicolor/256x256/apps/io.github.brahm.CoreRules.Addons.png - ls -l "$GITHUB_WORKSPACE"/dist/CoreRules-Community-Addons-*.AppImage - - if: github.event_name != 'pull_request' - uses: actions/upload-artifact@v4 + zip=dist/CoreRules-Community-Addons-${{ steps.v.outputs.version }}.zip + unzip -tq "$zip" + unzip -l "$zip" | grep -q 'Comunidade.xpx$' + test "$(unzip -l "$zip" | grep -ci '\.bmp$')" -ge 600 + cp "$zip" dist/CoreRules-Community-Addons.zip + (cd dist && sha256sum *.zip) + - uses: actions/upload-artifact@v4 with: - name: addons-appimage - path: dist/CoreRules-Community-Addons-${{ steps.v.outputs.version }}-x86_64.AppImage - - if: github.event_name != 'pull_request' - uses: oras-project/setup-oras@v1 - - if: github.event_name != 'pull_request' - name: Publish on GitHub Packages - run: | - version=${{ steps.v.outputs.version }} - owner=$(echo "$GITHUB_REPOSITORY_OWNER" | tr '[:upper:]' '[:lower:]') - echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u "${{ github.actor }}" --password-stdin - cd dist - oras push "ghcr.io/$owner/corerules-community-addons:$version,latest" \ - --artifact-type application/vnd.corerules.addons \ - --annotation "org.opencontainers.image.source=https://github.com/${GITHUB_REPOSITORY}" \ - --annotation "org.opencontainers.image.description=Core Rules Community Add-ons Collection: 672 community add-ons for AD&D Core Rules 2.0 Expansion, in one self-installing AppImage. Download it from https://github.com/${GITHUB_REPOSITORY}/releases/download/addons/CoreRules-Community-Addons-x86_64.AppImage or with: oras pull ghcr.io/$owner/corerules-community-addons:latest" \ - --annotation "org.opencontainers.image.version=$version" \ - "CoreRules-Community-Addons-$version-x86_64.AppImage:application/vnd.appimage" + name: addons-zip + path: dist/CoreRules-Community-Addons-${{ steps.v.outputs.version }}.zip - if: github.event_name != 'pull_request' name: Move the addons tag to this commit uses: actions/github-script@v7 @@ -83,8 +53,6 @@ jobs: if (e.status !== 422 && e.status !== 404) throw e; await github.rest.git.createRef({ ...ref, ref: 'refs/tags/addons', sha: context.sha }); } - - if: github.event_name != 'pull_request' - run: cp dist/CoreRules-Community-Addons-${{ steps.v.outputs.version }}-x86_64.AppImage dist/CoreRules-Community-Addons-x86_64.AppImage - if: github.event_name != 'pull_request' name: Publish on the addons release uses: softprops/action-gh-release@v2 @@ -93,119 +61,19 @@ jobs: name: Core Rules Community Add-ons Collection make_latest: false body: | - The self-installing AppImage of the [Core Rules Community Add-ons Collection](https://github.com/brahm/corerules/blob/main/addons/README.md), built with Core Rules ${{ steps.v.outputs.version }}. + The [Core Rules Community Add-ons Collection](https://github.com/brahm/corerules/blob/main/addons/README.md) as one .zip, built with Core Rules ${{ steps.v.outputs.version }}: 672 community add-ons in 36,525 items, with their 668 pictures and their authors' texts. - Download **CoreRules-Community-Addons-x86_64.AppImage** (always the newest; the file with a version in its name is the same build), then: + Download **CoreRules-Community-Addons.zip** (always the newest; the file with a version in its name is the same build), then, on Linux, Windows or macOS: - ```sh - chmod +x CoreRules-Community-Addons-x86_64.AppImage - ./CoreRules-Community-Addons-x86_64.AppImage - ``` + 1. Put the zip in a folder of its own. There is no need to extract it. + 2. In Core Rules, choose **Import Add-ons…** (the main menu on Linux, the More menu on Windows, the File menu on the Mac) and pick that folder. + 3. Check the list of what comes in and press **Import**. The app backs up `UserDbas` and `Chars` first. - On Windows, macOS or any Linux, download **CoreRules-Community-Addons.zip**, the same add-ons with their pictures and texts. In Core Rules, choose **Import Add-ons…** and pick the folder that holds the zip; there is no need to extract it. The original Expansion program can import its `Comunidade.xpx` too. + The original Expansion program can import its `Comunidade.xpx` too. - Direct link: https://github.com/${{ github.repository }}/releases/download/addons/CoreRules-Community-Addons-x86_64.AppImage + Direct link: https://github.com/${{ github.repository }}/releases/download/addons/CoreRules-Community-Addons.zip - The same file is on GitHub Packages twice: as a file, `corerules-community-addons-${{ steps.v.outputs.version }}-x86_64.AppImage`, in the Maven package `io.github.brahm.corerules-community-addons` ([the project's packages](https://github.com/${{ github.repository_owner }}?tab=packages&repo_name=${{ github.event.repository.name }})), and in the OCI package [`corerules-community-addons`](https://github.com/${{ github.repository }}/pkgs/container/corerules-community-addons): `oras pull ghcr.io/${{ github.repository_owner }}/corerules-community-addons:latest`. The app itself is on the [Core Rules releases](https://github.com/${{ github.repository }}/releases). - files: | - dist/CoreRules-Community-Addons-x86_64.AppImage - dist/CoreRules-Community-Addons-${{ steps.v.outputs.version }}-x86_64.AppImage - - # The same add-ons as one .zip for Import Add-ons… in the app, on Linux, - # Windows and macOS: Comunidade.xpx with the pictures, pictures.tsv and - # the texts (addons/tools/addons_zip.py). On the addons release, - # CoreRules-Community-Addons.zip is always the newest. - zip: - needs: package - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - id: v - run: echo "version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)" >> "$GITHUB_OUTPUT" - - run: python3 -I addons/tools/addons_zip.py ${{ steps.v.outputs.version }} dist - - name: Check the zip - run: | - zip=dist/CoreRules-Community-Addons-${{ steps.v.outputs.version }}.zip - unzip -tq "$zip" - unzip -l "$zip" | grep -q 'Comunidade.xpx$' - test "$(unzip -l "$zip" | grep -ci '\.bmp$')" -ge 600 - cp "$zip" dist/CoreRules-Community-Addons.zip - (cd dist && sha256sum *.zip) - - uses: actions/upload-artifact@v4 - with: - name: addons-zip - path: dist/CoreRules-Community-Addons-${{ steps.v.outputs.version }}.zip - - if: github.event_name != 'pull_request' - name: Publish on the addons release - uses: softprops/action-gh-release@v2 - with: - tag_name: addons - make_latest: false + The app itself is on the [Core Rules releases](https://github.com/${{ github.repository }}/releases). files: | dist/CoreRules-Community-Addons.zip dist/CoreRules-Community-Addons-${{ steps.v.outputs.version }}.zip - - # GitHub Packages has no registry for plain files, and its container - # registry shows the AppImage as an OCI artifact. Its Maven registry keeps - # any file as it is, with its name and extension, and the package page - # lists it under Assets for download, so the AppImage goes there too, as - # io.github.brahm:corerules-community-addons:VERSION:x86_64@AppImage. A - # version is published once, since Maven versions cannot be replaced; a - # later build of the same version only replaces the other two copies. - maven: - needs: package - if: github.event_name != 'pull_request' - runs-on: ubuntu-24.04 - permissions: - contents: read - packages: write - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REGISTRY: https://maven.pkg.github.com/${{ github.repository }} - ARTIFACT: io/github/brahm/corerules-community-addons - steps: - - uses: actions/checkout@v4 - - id: v - run: echo "version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)" >> "$GITHUB_OUTPUT" - - uses: actions/download-artifact@v4 - with: - name: addons-appimage - path: dist - # Writes ~/.m2/settings.xml with the server "github", which logs in - # as GITHUB_ACTOR with GITHUB_TOKEN. - - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: '21' - server-id: github - - id: exists - name: Look for this version on GitHub Packages - run: | - version=${{ steps.v.outputs.version }} - code=$(curl -s -o /dev/null -w '%{http_code}' -u "$GITHUB_ACTOR:$GITHUB_TOKEN" \ - "$REGISTRY/$ARTIFACT/$version/corerules-community-addons-$version.pom") - echo "HTTP $code" - if [ "$code" = 200 ]; then - echo "::notice::corerules-community-addons $version is already in the Maven registry; it keeps its first build" - echo "found=true" >> "$GITHUB_OUTPUT" - fi - - if: steps.exists.outputs.found != 'true' - name: Publish the AppImage on GitHub Packages (Maven) - run: | - version=${{ steps.v.outputs.version }} - mvn -B --no-transfer-progress deploy:deploy-file \ - -Durl="$REGISTRY" -DrepositoryId=github \ - -Dfile="dist/CoreRules-Community-Addons-$version-x86_64.AppImage" \ - -DgroupId=io.github.brahm -DartifactId=corerules-community-addons \ - -Dversion="$version" -Dclassifier=x86_64 -Dpackaging=AppImage \ - -DgeneratePom=true \ - -DgeneratePom.description="Core Rules Community Add-ons Collection: 672 community add-ons for AD&D Core Rules 2.0 Expansion, in one self-installing AppImage" - - name: Check the published AppImage - run: | - version=${{ steps.v.outputs.version }} - curl -sSfL -u "$GITHUB_ACTOR:$GITHUB_TOKEN" -o published.AppImage \ - "$REGISTRY/$ARTIFACT/$version/corerules-community-addons-$version-x86_64.AppImage" - sha256sum published.AppImage "dist/CoreRules-Community-Addons-$version-x86_64.AppImage" - if [ "${{ steps.exists.outputs.found }}" != true ]; then - cmp published.AppImage "dist/CoreRules-Community-Addons-$version-x86_64.AppImage" - fi diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 76c802c..296fb5b 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -7,6 +7,7 @@ on: - "site/**" - "docs/screenshots/**" - "addons/screenshots/**" + - "addons/icon.png" - "packaging/flatpak/repo.sh" - ".github/workflows/pages.yml" pull_request: diff --git a/Cargo.lock b/Cargo.lock index 0ee4ec9..e8f1b82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,12 +115,6 @@ version = "1.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - [[package]] name = "byteorder-lite" version = "0.1.0" @@ -250,18 +244,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" -[[package]] -name = "cr-addons" -version = "1.1.0" -dependencies = [ - "cr-formats", - "cr-i18n", - "cr-store", - "gtk4", - "libadwaita", - "lzma-rs", -] - [[package]] name = "cr-app" version = "1.1.0" @@ -351,21 +333,6 @@ dependencies = [ "windows-reactor", ] -[[package]] -name = "crc" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" - [[package]] name = "crc32fast" version = "1.5.2" @@ -906,16 +873,6 @@ version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" -[[package]] -name = "lzma-rs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e" -dependencies = [ - "byteorder", - "crc", -] - [[package]] name = "memchr" version = "2.8.3" diff --git a/Cargo.toml b/Cargo.toml index d889af9..b8e5277 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,8 @@ [workspace] resolver = "3" -members = ["crates/cr-i18n", "crates/cr-formats", "crates/cr-store", "crates/cr-app", "crates/cr-cli", "crates/cr-gtk", "crates/cr-addons", "crates/cr-win", "crates/cr-mac-ffi"] -# The add-ons installer carries 9 MB of add-ons; only its own AppImage -# builds it (cargo build -p cr-addons). The Windows app is built on Windows -# (cargo build -p cr-win), and the Mac app's bridge on macOS -# (macos/scripts/make-bindings.sh). +members = ["crates/cr-i18n", "crates/cr-formats", "crates/cr-store", "crates/cr-app", "crates/cr-cli", "crates/cr-gtk", "crates/cr-win", "crates/cr-mac-ffi"] +# The Windows app is built on Windows (cargo build -p cr-win), and the Mac +# app's bridge on macOS (macos/scripts/make-bindings.sh). default-members = ["crates/cr-i18n", "crates/cr-formats", "crates/cr-store", "crates/cr-app", "crates/cr-cli", "crates/cr-gtk"] [workspace.package] diff --git a/README.md b/README.md index ddbc0b7..1d40ab2 100644 --- a/README.md +++ b/README.md @@ -426,9 +426,12 @@ when and why each was decided. (many community add-ons were); the app reads both. - **Large packages import in the background**, and the Import dialog folds a category of more than 200 items into one row. +- **Import Add-ons…** brings in every add-on in a folder, its subfolders + and its ZIP archives at once, with their pictures; the original imports + one package at a time. - **The Core Rules Community Add-ons Collection** (see [Community add-ons](#community-add-ons)), 672 community add-ons converted - to the Expansion's format, with their own installer. + to the Expansion's format, as one `.zip` for Import Add-ons…. ### Behavior that differs @@ -510,7 +513,7 @@ the latest release; Windows 11 comes from the | Arch Linux, CachyOS, Omarchy | [`corerules-1.1.0-1-x86_64.pkg.tar.zst`](https://github.com/brahm/corerules/releases/download/v1.1.0/corerules-1.1.0-1-x86_64.pkg.tar.zst) | `sudo pacman -U ./corerules-1.1.0-1-x86_64.pkg.tar.zst` | | Any distribution with Flatpak, such as Bazzite | [`io.github.brahm.CoreRules.flatpakref`](https://brahm.github.io/corerules/io.github.brahm.CoreRules.flatpakref), from the [Flatpak repository](#the-flatpak-repository) | `flatpak install --user https://brahm.github.io/corerules/io.github.brahm.CoreRules.flatpakref` | | Any distribution (glibc 2.43+) | [`CoreRules-1.1.0-x86_64.AppImage`](https://github.com/brahm/corerules/releases/download/v1.1.0/CoreRules-1.1.0-x86_64.AppImage) | `chmod +x CoreRules-1.1.0-x86_64.AppImage`, then run it | -| Community add-ons (installer) | [`CoreRules-Community-Addons-x86_64.AppImage`](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons-x86_64.AppImage) | `chmod +x CoreRules-Community-Addons-x86_64.AppImage`, then run it | +| Community add-ons, for every system above | [`CoreRules-Community-Addons.zip`](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons.zip) | In Core Rules, Import Add-ons…, then pick the folder that holds the zip ([how](#community-add-ons)) | The release also has the [`CoreRules-1.1.0.flatpak`](https://github.com/brahm/corerules/releases/download/v1.1.0/CoreRules-1.1.0.flatpak) @@ -663,25 +666,24 @@ add-ons the community made for Core Rules 2.0 and the Expansion (races, classes, kits, spells, monsters, modules and the AD&D Core Rules User Database), converted to the Expansion's format and consolidated into 36,525 items, with the 668 pictures that came with them. Monster types, -monsters, races and characters show those pictures in the app. It ships as its own self-installing AppImage -(`crates/cr-addons`, GTK 4 and libadwaita), version 1.0.0 with the app: +monsters, races and characters show those pictures in the app. It comes as +one `.zip`, on every system the app runs on: -**[Download CoreRules-Community-Addons-x86_64.AppImage](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons-x86_64.AppImage)** +**[Download CoreRules-Community-Addons.zip](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons.zip)** This link always gives the newest build; the [addons release](https://github.com/brahm/corerules/releases/tag/addons) -also keeps each version, such as -[`CoreRules-Community-Addons-1.0.0-x86_64.AppImage`](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons-1.0.0-x86_64.AppImage). -The same AppImage is on [GitHub Packages](https://github.com/brahm/corerules/packages) -twice: as the file itself in the Maven package -[`io.github.brahm.corerules-community-addons`](https://github.com/brahm/corerules/packages/3339900), whose page lists -`corerules-community-addons-1.0.0-x86_64.AppImage` for download, and as the -OCI artifact -[`corerules-community-addons`](https://github.com/brahm/corerules/pkgs/container/corerules-community-addons) -(`oras pull ghcr.io/brahm/corerules-community-addons:latest`). It needs the app 0.7.2 or newer. The installer finds the app on its own, -whether it came as the Flatpak, the .deb, .rpm or pacman package or an AppImage, -and speaks the app's six languages. Its [README](addons/README.md) says -what is inside, how it was built and how to install it. +also keeps each version. To import it: + +1. Put the zip in a folder of its own. There is no need to extract it. +2. In Core Rules, choose **Import Add-ons…** (the main menu on Linux, the + More menu on Windows, the File menu on the Mac) and pick that folder. +3. Check the list of what comes in and press **Import**. The whole + collection takes about a minute. + +The collection's [README](addons/README.md) says what is inside, how it was +built and how to undo an import. A Linux installer (an AppImage) carried the +add-ons until 1.1.0; Import Add-ons… replaces it. **Import Add-ons…**, in the main menu on Linux, the More menu on Windows and the File menu on the Mac, brings in every add-on in a folder at once. @@ -725,7 +727,6 @@ CORERULES_DIR="$HOME/.wine/drive_c/Program Files/AD&D Core Rules 2.0" cargo test | `cr-i18n` | Translations of the interface (`po/*.po`, built into the program) | | `cr-app` | What both apps share above the backend, with no GTK and no Windows: the names of their actions, the library's search, filters and commands, the pictures, the help and About, the book reader's zoom, Find and reading positions, the sheet's options and exports, the sheet laid out on printed pages and the sheet as a PDF | | `cr-gtk` | The GNOME app | -| `cr-addons` | Core Rules Community Add-ons Collection, the add-ons and their installer | | `cr-win` | The Windows 11 app (WinUI 3 with windows-reactor), with every screen of the GNOME app | The backend crates and `cr-app` have no GTK dependency, and CI builds and diff --git a/addons/GUIA.md b/addons/GUIA.md index 5cd8f6a..36b25ab 100644 --- a/addons/GUIA.md +++ b/addons/GUIA.md @@ -1,50 +1,17 @@ -# Core Rules Community Add-ons Collection: guia de instalação +# Core Rules Community Add-ons Collection: guia de importação -Este pacote junta 672 addons feitos pela comunidade para o AD&D Core Rules 2.0 e a Expansion: raças, classes, kits, magias, monstros, equipamentos, encontros, módulos com personagens e a AD&D Core Rules User Database. Todos foram testados, convertidos para o formato da Expansion e consolidados num único arquivo, `Comunidade.xpx`, com 36.525 itens. As 668 imagens que vieram com eles também são instaladas. Os goodies mensais da Evermore Entertainment ficaram de fora. O [README](README.md) apresenta a coleção, em inglês, e o [relatorio.md](relatorio.md) conta o que foi convertido, reparado ou deixado de fora. +Este pacote junta 672 addons feitos pela comunidade para o AD&D Core Rules 2.0 e a Expansion: raças, classes, kits, magias, monstros, equipamentos, encontros, módulos com personagens e a AD&D Core Rules User Database. Todos foram testados, convertidos para o formato da Expansion e consolidados num único arquivo, `Comunidade.xpx`, com 36.525 itens. As 668 imagens que vieram com eles também vêm junto. Os goodies mensais da Evermore Entertainment ficaram de fora. O [README](README.md) apresenta a coleção, em inglês, e o [relatorio.md](relatorio.md) conta o que foi convertido, reparado ou deixado de fora. Mapas do Map Maker II e desenhos do Campaign Mapper não fazem parte do pacote, porque o app não trata desses programas. -## O instalador - -Os addons são distribuídos num único arquivo, `CoreRules-Community-Addons-VERSÃO-x86_64.AppImage`. Ele é um programa com janela que leva os addons dentro dele e os instala no Core Rules, sem script nem outros arquivos. - O que é preciso: -* Linux x86-64 com glibc 2.43 ou mais nova (Fedora 44, Ubuntu 26.04 ou mais novos). -* O app Core Rules 0.7.2 ou mais novo, da [página de releases](https://github.com/brahm/corerules/releases). Até a versão 0.7.1 o app não lia parte destes addons: classes com habilidades por nível (`CClassFreeSpellsOb`) e o que a Expansion com patch grava. +* O app Core Rules 1.2.0 ou mais novo, no Linux, no Windows 11 ou no macOS, da [página de releases](https://github.com/brahm/corerules/releases) ou da Microsoft Store. * Os dados da sua Expansion no app. Se ainda não tiver, abra o Core Rules e use **Extrair dados do CD…** no menu. ## Onde baixar -**[Baixe o instalador aqui](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons-x86_64.AppImage).** O link sempre traz a versão mais nova. A [release addons](https://github.com/brahm/corerules/releases/tag/addons) também guarda cada versão. - -O mesmo arquivo é publicado no [GitHub Packages](https://github.com/brahm?tab=packages&repo_name=corerules) do projeto, de duas formas, porque o GitHub Packages não tem um registro para arquivos soltos: - -* **Como o arquivo AppImage**, no pacote Maven `io.github.brahm.corerules-community-addons`. A página dele lista `corerules-community-addons-VERSÃO-x86_64.AppImage` em Assets, para baixar pelo navegador. Baixar desse registro pela linha de comando pede um token do GitHub, mesmo com o pacote público. -* **Como artefato OCI**, [`corerules-community-addons`](https://github.com/brahm/corerules/pkgs/container/corerules-community-addons), que baixa sem conta nenhuma. Ele guarda a AppImage como seu único arquivo, e não uma imagem de contêiner: o `docker pull` que a página do GitHub mostra não serve. Para baixar de lá, use o [ORAS](https://oras.land): - -```sh -oras pull ghcr.io/brahm/corerules-community-addons:latest -``` - -Ou só com `curl`: - -```sh -repo=brahm/corerules-community-addons -token=$(curl -s "https://ghcr.io/token?scope=repository:$repo:pull" | sed 's/.*"token":"\([^"]*\)".*/\1/') -layer=$(curl -s -H "Authorization: Bearer $token" \ - -H "Accept: application/vnd.oci.image.manifest.v1+json" \ - "https://ghcr.io/v2/$repo/manifests/latest" | - grep -o '"digest":"sha256:[0-9a-f]*"' | tail -n 1 | cut -d'"' -f4) -curl -L -H "Authorization: Bearer $token" -o CoreRules-Community-Addons-x86_64.AppImage \ - "https://ghcr.io/v2/$repo/blobs/$layer" -``` - -Além de `latest`, cada versão do app tem a sua tag, como `1.0.0`. - -## O pacote .zip, para Windows, macOS e qualquer Linux - -Os mesmos addons validados também saem num zip, **[CoreRules-Community-Addons.zip](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons.zip)**, na mesma [release addons](https://github.com/brahm/corerules/releases/tag/addons), com uma cópia de nome `CoreRules-Community-Addons-VERSÃO.zip` para cada versão. Ele serve para o comando **Importar add-ons…** do app, no Linux, no Windows e no macOS: escolha no menu a pasta onde está o zip, sem precisar extraí-lo, e o app lê todos os arquivos de uma vez, valida, importa os itens e copia as imagens para onde os registros as procuram, sem sobrescrever nenhum arquivo. +Os addons saem num zip, **[CoreRules-Community-Addons.zip](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons.zip)**, na [release addons](https://github.com/brahm/corerules/releases/tag/addons), com uma cópia de nome `CoreRules-Community-Addons-VERSÃO.zip` para cada versão. Ele serve para o comando **Importar add-ons…** do app, no Linux, no Windows e no macOS: escolha no menu a pasta onde está o zip, sem precisar extraí-lo, e o app lê todos os arquivos de uma vez, valida, importa os itens e copia as imagens para onde os registros as procuram, sem sobrescrever nenhum arquivo. Dentro dele há uma pasta, `CoreRules-Community-Addons-VERSÃO`, com: @@ -57,52 +24,32 @@ Dentro dele há uma pasta, `CoreRules-Community-Addons-VERSÃO`, com: | `addons.tsv` | O que cada pasta de addon trouxe para a coleção | | `README.txt`, `LEIA-ME.txt` | Como instalar, em inglês e em português | -O zip é gerado a partir dos mesmos `Comunidade.xpx.xz` e `Comunidade-extras.xz` que vão dentro do instalador, por `tools/addons_zip.py VERSÃO PASTA`, no job `zip` do workflow `Addons package`. - -## Instalação - -1. Torne o arquivo executável e abra-o: - - ```sh - chmod +x CoreRules-Community-Addons*x86_64.AppImage - ./CoreRules-Community-Addons*x86_64.AppImage - ``` - - Sem FUSE, rode com `APPIMAGE_EXTRACT_AND_RUN=1`. - -2. A janela procura o Core Rules sozinha e mostra cada cópia que achou, com a pasta de dados que ela lê: - - | Como o app foi instalado | Pasta de dados | - | --- | --- | - | Flatpak | `~/.var/app/io.github.brahm.CoreRules/data/corerules/data` | - | Pacote .deb ou .rpm | `~/.local/share/corerules/data` | - | AppImage (em Downloads, Aplicativos, Área de Trabalho, `~/.local/bin`, `/opt` ou a pasta pessoal) | `~/.local/share/corerules/data` | - - O botão **Detalhes dos addons…** mostra, quando você quiser, cada pasta de addons com o que ela trouxe para a coleção e os textos que os autores escreveram. - - Sem essa pasta, cada cópia usa a instalação do programa original no Wine, em `~/.wine/drive_c/Program Files/AD&D Core Rules 2.0`, como o próprio app faz. Se a cópia ainda não tem os dados do jogo, o botão **Abrir o Core Rules** a abre para você usar **Extrair dados do CD…**; depois clique em ↻ para procurar de novo. Para instalar numa pasta que o instalador não achou, use **Outra pasta…** e indique a pasta que tem `Database`. - -3. Clique em **Instalar**. A importação leva menos de um minuto. +## Como importar -4. Abra o Core Rules, pelo botão **Abrir o Core Rules** ou como de costume. Os addons aparecem nos bancos de dados do usuário (Raças, Classes, Magias, Monstros e o resto) e os personagens dos módulos na lista de personagens. Tipos de monstro, monstros, raças e personagens mostram a imagem que veio com o addon. Se o app já estava aberto, feche e abra de novo. +1. Baixe o `CoreRules-Community-Addons.zip` e ponha numa pasta só dele, por exemplo `Downloads/addons`. Não precisa extrair. +2. No Core Rules, escolha **Importar addons…**: no menu principal no Linux, no menu **Mais** no Windows e no menu **Arquivo** no Mac. +3. Escolha a pasta onde está o zip. O app procura nela, nas subpastas e dentro dos zips (até zips dentro de zips) todos os pacotes `.xpx` e `.xpt`, as imagens `.bmp` e o `pictures.tsv`. +4. Confira a lista: o que vai entrar, por categoria, o que foi achado duas vezes e o que não pode ser importado, com o motivo. Nada é gravado antes de você confirmar. +5. Clique em **Importar**. O `Comunidade.xpx` inteiro leva cerca de um minuto, com uma barra de progresso. +6. No fim, o relatório diz quantos itens, personagens e imagens entraram, e onde ficaram a cópia de segurança e o registro. -A janela fala os mesmos idiomas do app (português, inglês, espanhol, italiano, francês e alemão) e segue o que foi escolhido nas Preferências do Core Rules; sem escolha, segue o idioma do sistema. Os addons em si e os textos dos autores estão em inglês. +Os addons aparecem nos bancos de dados do usuário (Raças, Classes, Magias, Monstros e o resto) e os personagens dos módulos na lista de personagens. Tipos de monstro, monstros, raças e personagens mostram a imagem que veio com o addon. Os addons em si e os textos dos autores estão em inglês. -## O que o instalador faz +O mesmo comando serve para qualquer outra pasta de addons, soltos ou em zips, como a comunidade os compartilhou. -1. Confere se cada pasta é uma instalação da Expansion. Quando duas cópias do app leem a mesma pasta, ela recebe os addons uma vez só. -2. Copia `UserDbas/` e `Chars/` para uma pasta ao lado, por exemplo `data-before-addons-20261019-010700/`. -3. Importa o `Comunidade.xpx`. Um registro do usuário com o mesmo nome de um addon é substituído pelo do addon, como no Import do programa original. -4. Importa de novo só as classes. Uma combinação raça/classe que cita duas classes novas só entra quando as duas já existem. -5. Copia as imagens para onde os registros as procuram (`Bitmaps/Monsters`, `Bitmaps/Portrait` e `UserBMP`, e no Wine também as pastas do drive C: que os registros citam). Um arquivo que já existe não é substituído. +## O que a importação faz -O registro da importação fica ao lado da pasta, como `data-addons-20261019-010700.log`, e o botão **Abrir o registro** o mostra no fim. +1. Copia `UserDbas/` e `Chars/` para uma pasta ao lado da pasta de dados, por exemplo `data-before-addons-2026-10-29-232615/`. +2. Importa os pacotes do arquivo mais antigo para o mais novo, de modo que, num nome repetido, o mais novo vence, como no Import do programa original. Um registro do usuário com o mesmo nome de um addon é substituído pelo do addon. As classes passam uma segunda vez, para que uma combinação raça/classe que cita duas classes novas entre. +3. Deixa de fora os personagens que já estão na lista, então importar de novo não os duplica. +4. Copia as imagens para onde os registros as procuram, ou para o lugar que o `pictures.tsv` indica. Um arquivo que já existe não é substituído. +5. Grava um registro de tudo ao lado da pasta de dados, como `data-addons-2026-10-29-232615.log`. -Instalar de novo não duplica os personagens. Se a pasta estiver dentro de um prefixo do Wine, o instalador pede confirmação antes de mexer. O programa original do CD também lê os addons, mas o Import dele leva cerca de 35 minutos. +Pacotes da Expansion não entram numa instalação do Core Rules 2.0, e arquivos danificados ou vazios são recusados; a lista antes da importação já mostra isso. O programa original do CD também importa o `Comunidade.xpx`, mas leva cerca de 35 minutos. ## Como desfazer -Troque `UserDbas/` e `Chars/` pela cópia de segurança, pondo no lugar de `DATA` a data da cópia que quer usar. As imagens gravadas estão listadas no registro da instalação e podem ficar, já que nada as usa sem os addons: +Troque `UserDbas/` e `Chars/` pela cópia de segurança, pondo no lugar de `DATA` a data da cópia que quer usar. As imagens gravadas estão listadas no registro da importação e podem ficar, já que nada as usa sem os addons: ```sh cd ~/.local/share/corerules @@ -112,6 +59,6 @@ cp -r data-before-addons-DATA/UserDbas data-before-addons-DATA/Chars data/ No Flatpak, a pasta é `~/.var/app/io.github.brahm.CoreRules/data/corerules`. -## Como o instalador é gerado +## Como o zip é gerado -O instalador é o crate `crates/cr-addons`, em Rust com GTK 4 e libadwaita. Ele embute `addons/Comunidade.xpx.xz` e `addons/Comunidade-extras.xz` (imagens e textos) e importa pelo mesmo código do app (`cr-store`). `packaging/appimage/build-in-sdk.sh VERSÃO addons` gera a AppImage no SDK do GNOME 51, e o workflow `Addons package` (`.github/workflows/addons.yml`) a publica no GitHub Packages a cada mudança na main. +O zip sai dos arquivos `addons/Comunidade.xpx.xz` e `addons/Comunidade-extras.xz` (imagens e textos) por `tools/addons_zip.py VERSÃO PASTA`, no workflow `Addons package` (`.github/workflows/addons.yml`), que o publica na release addons a cada mudança na main. O resultado é sempre o mesmo para a mesma entrada. diff --git a/addons/README.md b/addons/README.md index b44281e..feab832 100644 --- a/addons/README.md +++ b/addons/README.md @@ -1,17 +1,16 @@

- Core Rules Community Add-ons Collection icon + Core Rules Community Add-ons Collection icon

# Core Rules Community Add-ons Collection The add-ons that the AD&D Core Rules community made for **AD&D Core Rules 2.0** and its **Expansion**, gathered into one -package and installed with one click into [Core Rules](../README.md), the -Linux replica of the original program. 672 add-on packages became 36,525 +package that [Core Rules](../README.md), the replica of the original +program for Linux, Windows 11 and macOS, imports in one go. 672 add-on packages became 36,525 items: new races and classes, kits, thousands of spells and monsters, equipment, encounters, the characters of the published modules and the -AD&D Core Rules User Database. The 668 pictures that came with them are -installed too, and the texts their authors wrote can be read in the -installer. +AD&D Core Rules User Database. The 668 pictures that came with them come +along, and so do the texts their authors wrote. > The collection holds what the community wrote and shared as add-ons. It > leaves out the monthly goodies that Evermore Entertainment, the company @@ -19,8 +18,6 @@ installer. > in the User Database. The rules data still comes from a Core Rules > installation you already own. -![The installer finds three copies of Core Rules and the two data folders they read](screenshots/installer.png) - ## What's inside Every item is in the Expansion's own format, so it opens in the app and in @@ -51,7 +48,7 @@ the original program alike. | Characters from the modules | 48 | | Other parts | 157 | -Once installed, the add-ons sit in the user databases next to your own +Once imported, the add-ons sit in the user databases next to your own records, and the module characters join the character list. Monster types, races and characters show the picture their author drew or scanned, in the app and in the original program. @@ -68,90 +65,50 @@ app and in the original program. ![A character from the modules, the Avatar of Bahgtru](screenshots/character.png) -## Installing - -On Windows, macOS or any Linux, download -[`CoreRules-Community-Addons.zip`](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons.zip) -from the [addons release](https://github.com/brahm/corerules/releases/tag/addons). -It holds the same validated add-ons, as `Comunidade.xpx`, with the pictures, -`pictures.tsv` (where each picture goes) and the texts. In Core Rules, -choose **Import Add-ons…** and pick the folder that holds the zip; there is -no need to extract it. The original Expansion program imports -`Comunidade.xpx` too. `tools/addons_zip.py VERSION DIR` builds the zip from -the files below. - -On Linux there is also the installer. - -The collection is a single AppImage, `CoreRules-Community-Addons-VERSION-x86_64.AppImage`, -that carries the add-ons inside and installs them itself. It needs: - -* Linux x86-64 with glibc 2.43 or newer (Fedora 44, Ubuntu 26.04 or newer) -* [Core Rules](https://github.com/brahm/corerules/releases) 0.7.2 or newer, - as the Flatpak, the .deb or .rpm package or the AppImage -* Your Expansion data in the app; if it is not there yet, open Core Rules - and use **Extract Data from CD…** - -**[Download the installer](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons-x86_64.AppImage)** -(the link always gives the newest build; the -[addons release](https://github.com/brahm/corerules/releases/tag/addons) -also keeps each version), then: - -```sh -chmod +x CoreRules-Community-Addons-x86_64.AppImage -./CoreRules-Community-Addons-x86_64.AppImage -``` - -The same file is published on -[GitHub Packages](https://github.com/brahm?tab=packages&repo_name=corerules) -in two forms. GitHub Packages has no registry for plain files, so: - -* **As the AppImage file**, in the Maven package - `io.github.brahm.corerules-community-addons`. Its page lists - `corerules-community-addons-VERSION-x86_64.AppImage` under Assets, to - download from the browser. Command-line downloads from that registry - need a GitHub token, even for a public package. -* **As an OCI artifact**, - [`corerules-community-addons`](https://github.com/brahm/corerules/pkgs/container/corerules-community-addons), - tagged with each version and `latest`, which downloads with no account. - It holds the AppImage as its one file rather than a container image, so - the `docker pull` that page shows does not apply. Download it with - [ORAS](https://oras.land): - - ```sh - oras pull ghcr.io/brahm/corerules-community-addons:latest - ``` - -The [Portuguese guide](GUIA.md) also shows how to download it with -`curl` alone, and how to undo an install. - -The window looks for Core Rules on its own and lists every copy it finds -with the data folder that copy reads: - -| How the app was installed | Data folder | -| --- | --- | -| Flatpak | `~/.var/app/io.github.brahm.CoreRules/data/corerules/data` | -| .deb or .rpm package | `~/.local/share/corerules/data` | -| AppImage in Downloads, Applications, Desktop, `~/.local/bin`, `/opt` or the home folder | `~/.local/share/corerules/data` | - -Without that folder, a copy falls back to the original program in the Wine -prefix, as the app does. **Install** copies `UserDbas` and `Chars` to a -backup beside each folder, then imports the add-ons, in under a minute per -folder. It also copies the pictures to where the records look for them -(`Bitmaps/Monsters`, `Bitmaps/Portrait` and `UserBMP` in the data folder, -and the folders on drive C: that the records name, inside Wine), never over -a file that is already there. **Other Folder…** is there for an -installation it does not find, and **Add-on Details…** lists every add-on -folder with what it brought into the collection and its authors' texts. - -Add-on Details, the add-on folders with their items and texts +## Importing + +You need [Core Rules](https://github.com/brahm/corerules/releases) 1.2.0 +or newer, on Linux, Windows 11 or macOS, with your Expansion data in it; +if it is not there yet, open Core Rules and use **Extract Data from CD…**. + +1. Download + [`CoreRules-Community-Addons.zip`](https://github.com/brahm/corerules/releases/download/addons/CoreRules-Community-Addons.zip) + (the link always gives the newest build; the + [addons release](https://github.com/brahm/corerules/releases/tag/addons) + also keeps each version) and put it in a folder of its own. There is no + need to extract it. +2. In Core Rules, choose **Import Add-ons…**: in the main menu on Linux, + the More menu on Windows and the File menu on the Mac. +3. Pick the folder that holds the zip. The app reads the folder, its + subfolders and the ZIP archives in it (also ZIPs inside ZIPs), and tells + each `.xpx` and `.xpt` package apart by what it holds. +4. Check the list: what comes in, by category, what was found twice and + what cannot be imported, with why. Nothing is written before you + confirm. +5. Press **Import**. The whole collection takes about a minute. + +Import first copies `UserDbas` and `Chars` to a backup beside the data +folder (`data-before-addons-TIME`). It imports the packages from the +oldest file to the newest, so the newer one wins on a name clash, leaves +out the characters already in the list, so a second run does not duplicate +them, and copies the pictures to the places `pictures.tsv` gives (in +`Bitmaps/Monsters`, `Bitmaps/Portrait` and `UserBMP`), never over a file +that is already there. A log of everything it did is written beside the +data folder (`data-addons-TIME.log`). The same command imports any other +folder of add-ons, loose or zipped, as the community shared them. + +The zip holds one folder, `CoreRules-Community-Addons-VERSION`, with: -![The add-ons installed in both folders](screenshots/installed.png) - -The installer speaks the app's six languages (English, Português (Brasil), -Español, Italiano, Français and Deutsch) and follows the one chosen in -Core Rules' Preferences, or the system's. +| File | Contents | +| --- | --- | +| `Comunidade.xpx` | The consolidated add-ons, in the Expansion's export format; the original program's Import reads it too | +| `pictures/` | The 668 pictures (8-bit BMP), in their add-on folders | +| `pictures.tsv` | Where each picture goes in the data folder: picture, a tab, place | +| `texts/` | The authors' 309 texts, as plain text | +| `addons.tsv` | What each add-on folder brought into the collection | +| `README.txt`, `LEIA-ME.txt` | How to import it, in English and Portuguese | -The installer in Brazilian Portuguese +The [Portuguese guide](GUIA.md) also shows how to undo an import. ## How it was built @@ -178,39 +135,37 @@ as one file, `Comunidade.xpx`. Where a name appears in more than one add-on, the newest version wins, as in the original Import; the [report](relatorio.md) lists every conflict and every package's status. -**Checking in the app.** After an install, every add-on record was opened, +**Checking in the app.** After an import, every add-on record was opened, edited and saved with the app's own editors and read back, and none failed. -**Packaging.** The consolidated file is compressed with xz and built into -the installer, `crates/cr-addons`, a Rust program with GTK 4 and -libadwaita that imports it through the same code as the app's Import -(`cr-store`), so installing and importing `Comunidade.xpx` in the app leave -the same databases. +**Packaging.** The consolidated file is kept compressed with xz, and +`tools/addons_zip.py VERSION DIR` builds the zip from it and from the +extras below. The `Addons package` workflow (`.github/workflows/addons.yml`) +builds the zip and publishes it on the addons release on every change to +`main`. A Linux installer (an AppImage) carried the add-ons until the app's +1.1.0; Import Add-ons… replaced it in 1.2.0. **Pictures and texts.** The 668 pictures (8-bit BMP files) and 309 texts -that came with the add-ons, again without Evermore's, are built into the -installer as `Comunidade-extras.xz`. Each picture goes to the place the +that came with the add-ons, again without Evermore's, are kept in +`Comunidade-extras.xz`. Each picture goes to the place the records name: a record stores the Windows path the picture had on its author's computer (`C:\Program Files\AD&D Core Rules 2.0\Bitmaps\Monsters\ Achaierai.BMP`, `C:\AD&D Pics\troll.bmp`), and the app maps that path into the data folder the same way (`cr-store`'s `pictures` module). The texts, readme files in plain text, HTML, RTF, Word and PDF, were converted to plain -text. `packaging/appimage/build-in-sdk.sh VERSION addons` builds the -AppImage in the GNOME 51 SDK, and the `Addons package` workflow -(`.github/workflows/addons.yml`) publishes it on GitHub Packages on every -change to `main`. +text. ## Files | File | Contents | | --- | --- | -| `Comunidade.xpx.xz` | The consolidated add-ons, as built into the installer | +| `Comunidade.xpx.xz` | The consolidated add-ons, as they go into the zip | | `Comunidade-extras.xz` | The add-ons' pictures and texts, and where each picture goes | | `tools/` | The scripts that chose each picture's place, built `Comunidade-extras.xz` and build the add-ons' zip | | [`relatorio.md`](relatorio.md) | The report, in Portuguese: what was converted, repaired or left out | | [`compatibilidade.csv`](compatibilidade.csv) | One line per add-on package, with its status and item count | | [`conflitos.csv`](conflitos.csv) | The names found in more than one package, and which version stayed | -| [`GUIA.md`](GUIA.md) | The install guide, in Portuguese | +| [`GUIA.md`](GUIA.md) | The import guide, in Portuguese | The add-ons belong to their authors in the Core Rules community. diff --git a/data/addons/icons/hicolor/256x256/apps/io.github.brahm.CoreRules.Addons.png b/addons/icon.png similarity index 100% rename from data/addons/icons/hicolor/256x256/apps/io.github.brahm.CoreRules.Addons.png rename to addons/icon.png diff --git a/addons/relatorio.md b/addons/relatorio.md index c0b9023..0f29d9d 100644 --- a/addons/relatorio.md +++ b/addons/relatorio.md @@ -2,13 +2,13 @@ O `addons.zip` (50.842.950 bytes) traz 686 pacotes: 492 `.xpx` da Expansion e 194 `.xpt` do Core Rules 2.0, contando a User Database e os dois arquivos que precisaram de conserto. Todos foram consolidados num único pacote, `Comunidade.xpx`, no formato que o `TSRP3.EXE` do CD da Expansion lê. Os 14 goodies mensais da Evermore Entertainment ficaram de fora depois, como explica a seção [Goodies da Evermore](#goodies-da-evermore): o pacote tem 36.525 itens de 672 addons. -O instalador, que leva o `Comunidade.xpx` dentro dele, e como usá-lo estão no [GUIA.md](GUIA.md). Junto deste relatório: +O zip com o `Comunidade.xpx`, e como importá-lo no app com **Importar addons…**, estão no [GUIA.md](GUIA.md). O instalador AppImage para Linux, citado abaixo como foi testado, foi abandonado na versão 1.2.0 do app em favor do zip. Junto deste relatório: | arquivo | conteúdo | |---|---| | `compatibilidade.csv` | uma linha por addon, com a situação, o número de itens e as observações | | `conflitos.csv` | os nomes que aparecem em mais de um addon e qual versão ficou | -| `Comunidade-extras.xz` | as imagens e os textos dos addons, embutidos no instalador | +| `Comunidade-extras.xz` | as imagens e os textos dos addons, que vão no zip | ## Situação dos addons @@ -89,10 +89,10 @@ O pacote foi conferido de novo com o app 1.0.0-rc1, que corrigiu o travamento ao ## Imagens e textos -Os addons trouxeram 685 imagens BMP e 321 textos. Sem os da Evermore, ficam 668 imagens e 309 textos, embutidos no instalador em `Comunidade-extras.xz`. +Os addons trouxeram 685 imagens BMP e 321 textos. Sem os da Evermore, ficam 668 imagens e 309 textos, guardados em `Comunidade-extras.xz` e levados para o zip. * **Para onde vai cada imagem.** Os registros guardam o caminho do Windows que a imagem tinha no computador do autor, como `C:\Program Files\AD&D Core Rules 2.0\Bitmaps\Monsters\Achaierai.BMP` ou `C:\AD&D Pics\troll.bmp`. Um caminho dentro de uma instalação do Core Rules, em qualquer drive, vira o mesmo caminho dentro da pasta de dados (`Bitmaps/Monsters/Achaierai.BMP`). Um caminho para o `Bitmaps` do CD fica em `Bitmaps`. Os outros vão para `UserBMP`, sem o drive (`UserBMP/AD&D Pics/troll.bmp`). No Wine, estes últimos também vão para o drive C:, onde o original os procura. * **Escolha da imagem.** 528 imagens são citadas pelos registros e vão para 536 lugares. Quando dois addons trazem imagens com o mesmo nome, vale a do addon de onde veio o registro. Nenhum lugar recebe duas imagens diferentes. As 4 citações a imagens do próprio CD ficam com as do CD. Todas as 668 imagens também vão para `UserBMP/`, na pasta do seu addon, que é onde o diálogo de imagens do original abre. * **Nada é sobrescrito.** Um arquivo que já existe fica como está, e o registro da instalação lista cada imagem gravada. * **No app.** Tipos de monstro, monstros (pela imagem do seu tipo), raças e personagens mostram a imagem quando o arquivo está na pasta de dados. As imagens são lidas pelo próprio app, sem depender dos leitores de imagem do sistema. 3.800 citações apontam para imagens que nenhum addon trouxe, quase todas as do CD (`6.bmp`, `NA.bmp`), que **Extrair dados do CD…** copia do CD desde a versão 1.0.0-rc1. -* **Textos.** Os leia-me em texto, HTML, RTF, Word e PDF foram convertidos para texto simples. O botão **Detalhes dos addons…** do instalador mostra, para cada pasta de addons, os pacotes, o que cada um trouxe para a coleção e esses textos. +* **Textos.** Os leia-me em texto, HTML, RTF, Word e PDF foram convertidos para texto simples. O zip leva esses textos em `texts/` e, em `addons.tsv`, o que cada pasta de addons trouxe para a coleção. diff --git a/addons/screenshots/details.png b/addons/screenshots/details.png deleted file mode 100644 index 8b661a5..0000000 Binary files a/addons/screenshots/details.png and /dev/null differ diff --git a/addons/screenshots/installed.png b/addons/screenshots/installed.png deleted file mode 100644 index 4a22152..0000000 Binary files a/addons/screenshots/installed.png and /dev/null differ diff --git a/addons/screenshots/installer.png b/addons/screenshots/installer.png deleted file mode 100644 index d46fab8..0000000 Binary files a/addons/screenshots/installer.png and /dev/null differ diff --git a/addons/screenshots/portuguese.png b/addons/screenshots/portuguese.png deleted file mode 100644 index e523c4f..0000000 Binary files a/addons/screenshots/portuguese.png and /dev/null differ diff --git a/addons/tools/addons_zip.py b/addons/tools/addons_zip.py index 93d8500..5ae273c 100644 --- a/addons/tools/addons_zip.py +++ b/addons/tools/addons_zip.py @@ -1,17 +1,17 @@ """Builds the add-ons' zip, CoreRules-Community-Addons-VERSION.zip: the -same validated add-ons the installer carries, as files that Core Rules' -Import Add-ons reads from a folder. +validated add-ons as files that Core Rules' Import Add-ons reads from a +folder. usage: addons_zip.py VERSION OUT_DIR Reads addons/Comunidade.xpx.xz and addons/Comunidade-extras.xz (see -crates/cr-addons/src/extras.rs for the extras' format) and writes, under +extras_bundle.py for the extras' format) and writes, under one folder, CoreRules-Community-Addons-VERSION/: Comunidade.xpx the consolidated add-ons, in the Expansion's format pictures/... the pictures, in their add-on folders pictures.tsv pictureplace in the installation, one per line texts/... the authors' texts, as plain text - addons.tsv what each add-on folder brought (extras.rs) + addons.tsv what each add-on folder brought README.txt, LEIA-ME.txt """ import lzma, os, sys, zipfile diff --git a/addons/tools/extras_bundle.py b/addons/tools/extras_bundle.py index 0b963fa..fe05a7b 100644 --- a/addons/tools/extras_bundle.py +++ b/addons/tools/extras_bundle.py @@ -1,5 +1,5 @@ """Builds addons/Comunidade-extras.xz: the add-ons' pictures and texts, -and what the installer's details list shows. +and what each add-on folder brought. usage: extras_bundle.py EXTRAS_DIR MANIFEST_DIR ITEMS.tsv FINAL_ITEMS.tsv COMPAT.csv WORK_DIR OUT diff --git a/addons/tools/pictures_manifest.py b/addons/tools/pictures_manifest.py index 24b2206..a12758e 100644 --- a/addons/tools/pictures_manifest.py +++ b/addons/tools/pictures_manifest.py @@ -3,7 +3,9 @@ usage: pictures_manifest.py EXTRAS_DIR REFS.tsv ITEMS.tsv CD_BITMAPS_DIR OUT_DIR EXTRAS_DIR the unzipped Comunidade-extras.zip -REFS.tsv `cargo run -p cr-addons --example pictures -- Comunidade.xpx` +REFS.tsv the picture paths the records of Comunidade.xpx name (written by + the cr-addons `pictures` example, removed with the Linux + installer; see the git history) ITEMS.tsv order, package, category, name, hash of every add-on item CD_BITMAPS_DIR the CD's BITMAPS folder, whose pictures are never replaced """ diff --git a/crates/cr-addons/Cargo.toml b/crates/cr-addons/Cargo.toml deleted file mode 100644 index a869f45..0000000 --- a/crates/cr-addons/Cargo.toml +++ /dev/null @@ -1,20 +0,0 @@ -[package] -name = "cr-addons" -description = "Core Rules Community Add-ons Collection, the self-installing add-ons" -version.workspace = true -edition.workspace = true -license.workspace = true -repository.workspace = true -rust-version.workspace = true - -[[bin]] -name = "corerules-community-addons" -path = "src/main.rs" - -[dependencies] -cr-formats.workspace = true -cr-i18n.workspace = true -cr-store.workspace = true -gtk = { package = "gtk4", version = "0.9", features = ["v4_14"] } -adw = { package = "libadwaita", version = "0.7", features = ["v1_5"] } -lzma-rs = "0.3" diff --git a/crates/cr-addons/examples/pictures.rs b/crates/cr-addons/examples/pictures.rs deleted file mode 100644 index 5e294bb..0000000 --- a/crates/cr-addons/examples/pictures.rs +++ /dev/null @@ -1,49 +0,0 @@ -//! Lists the pictures the records of a package name, for building the -//! add-ons' pictures: one line per record and picture, -//! `CATEGORYNAMESTORED PATHPATH IN THE INSTALLATION`. - -use cr_formats::Object; -use cr_formats::export::ExportFile; -use cr_store::pictures::{Kind, joined, relative}; - -fn main() { - let path = std::env::args().nth(1).expect("usage: pictures FILE.xpx"); - let file = ExportFile::parse(&std::fs::read(path).unwrap()).unwrap(); - let print = |category: &str, name: &str, stored: &str, kind: Kind| { - if let Some(rel) = relative(stored, kind) { - println!("{category}\t{name}\t{stored}\t{rel}"); - } - }; - for o in &file.monster_types { - if let Object::MonsterType(t) = o { - print("Monster Types", &t.name, &t.picture, Kind::Monster); - } - } - for o in &file.races { - if let Object::Race(r) = o { - print( - "Races", - &r.name, - &joined(&r.portrait_folder, &r.portrait), - Kind::Portrait, - ); - for p in &r.portraits { - print( - "Races", - &r.name, - &joined(&r.portrait_folder, p), - Kind::Portrait, - ); - } - } - } - for c in &file.characters { - let [folder, name] = &c.data.unknown_0x1db8; - print( - "Characters", - &c.data.name, - &joined(folder, name), - Kind::Portrait, - ); - } -} diff --git a/crates/cr-addons/src/details.rs b/crates/cr-addons/src/details.rs deleted file mode 100644 index b004cef..0000000 --- a/crates/cr-addons/src/details.rs +++ /dev/null @@ -1,286 +0,0 @@ -//! The add-on details, shown on request: every add-on folder of the -//! community's archive, what its packages brought into the collection and -//! the texts that came with it. - -use adw::prelude::*; -use cr_i18n::{tr, trn}; -use gtk::glib; - -use crate::extras::{self, Addon, Extras}; - -/// Item names a category shows before the rest are only counted. -const SHOWN: usize = 300; - -/// Opens the details over `parent`, unpacking the texts first. -pub fn show(parent: &impl IsA) { - let nav = adw::NavigationView::new(); - let spinner = gtk::Spinner::builder() - .spinning(true) - .width_request(32) - .height_request(32) - .halign(gtk::Align::Center) - .valign(gtk::Align::Center) - .vexpand(true) - .build(); - nav.add(&page(tr("Add-on Details"), &spinner, None)); - let dialog = adw::Dialog::builder() - .title(tr("Add-on Details")) - .content_width(640) - .content_height(640) - .child(&nav) - .build(); - dialog.present(Some(parent)); - glib::spawn_future_local(async move { - let result = gtk::gio::spawn_blocking(extras::get) - .await - .unwrap_or_else(|_| Err(tr("The built-in pictures are damaged.").to_string())); - match result { - Ok(extras) => nav.replace(&[list(extras, &nav)]), - Err(message) => { - let status = adw::StatusPage::builder() - .icon_name("dialog-error-symbolic") - .title(tr("The Details Could Not Be Read")) - .description(glib::markup_escape_text(&message)) - .build(); - nav.replace(&[page(tr("Add-on Details"), &status, None)]); - } - } - }); -} - -/// A page with a header bar over `content`, and a search bar when given. -fn page( - title: &str, - content: &impl IsA, - search: Option<>k::SearchEntry>, -) -> adw::NavigationPage { - let view = adw::ToolbarView::new(); - view.add_top_bar(&adw::HeaderBar::new()); - if let Some(search) = search { - let bar = adw::Clamp::builder() - .maximum_size(560) - .child(search) - .margin_start(12) - .margin_end(12) - .margin_bottom(6) - .build(); - view.add_top_bar(&bar); - } - view.set_content(Some(content)); - adw::NavigationPage::builder() - .title(title) - .child(&view) - .build() -} - -fn scrolled(child: &impl IsA) -> gtk::ScrolledWindow { - gtk::ScrolledWindow::builder() - .hscrollbar_policy(gtk::PolicyType::Never) - .vexpand(true) - .child(child) - .build() -} - -/// The add-on folders, with a search on their names. -fn list(extras: &'static Extras, nav: &adw::NavigationView) -> adw::NavigationPage { - let addons: Vec = extras - .addons() - .into_iter() - .filter(|a| a.total() > 0 || !a.texts.is_empty()) - .collect(); - let rows = gtk::ListBox::builder() - .selection_mode(gtk::SelectionMode::None) - .css_classes(["boxed-list"]) - .valign(gtk::Align::Start) - .build(); - let addons = std::rc::Rc::new(addons); - for addon in addons.iter() { - let mut subtitle = vec![trn!( - "{count} item", - "{count} items", - addon.total() as u64, - count = crate::thousands(addon.total()) - )]; - if !addon.texts.is_empty() { - subtitle.push(trn!("{n} text", "{n} texts", addon.texts.len() as u64)); - } - let parent = addon.folder.rsplit_once('/').map_or("", |(p, _)| p); - let row = adw::ActionRow::builder() - .title(glib::markup_escape_text(addon.name())) - .subtitle(glib::markup_escape_text(&if parent.is_empty() { - subtitle.join(" · ") - } else { - format!("{parent} · {}", subtitle.join(" · ")) - })) - .activatable(true) - .build(); - row.add_suffix(>k::Image::from_icon_name("go-next-symbolic")); - rows.append(&row); - } - rows.connect_row_activated({ - let nav = nav.clone(); - let addons = addons.clone(); - move |_, row| { - if let Some(addon) = addons.get(row.index() as usize) { - nav.push(&addon_page(extras, addon, &nav)); - } - } - }); - let search = gtk::SearchEntry::builder() - .placeholder_text(tr("Search the add-ons")) - .hexpand(true) - .build(); - rows.set_filter_func({ - let search = search.clone(); - let addons = addons.clone(); - move |row| { - let text = search.text().to_lowercase(); - text.is_empty() - || addons - .get(row.index() as usize) - .is_some_and(|a| a.folder.to_lowercase().contains(&text)) - } - }); - search.connect_search_changed({ - let rows = rows.clone(); - move |_| rows.invalidate_filter() - }); - let intro = gtk::Label::builder() - .label(tr( - "Each add-on folder of the community's archive, what its packages brought into the \ - collection and the texts its authors wrote. Most texts are in English.", - )) - .wrap(true) - .xalign(0.0) - .css_classes(["dim-label"]) - .build(); - let column = gtk::Box::builder() - .orientation(gtk::Orientation::Vertical) - .spacing(12) - .margin_top(6) - .margin_bottom(18) - .build(); - column.append(&intro); - column.append(&rows); - let clamp = adw::Clamp::builder() - .maximum_size(560) - .margin_start(12) - .margin_end(12) - .child(&column) - .build(); - page(tr("Add-on Details"), &scrolled(&clamp), Some(&search)) -} - -/// One add-on: its packages and items, then its texts. -fn addon_page( - extras: &'static Extras, - addon: &Addon, - nav: &adw::NavigationView, -) -> adw::NavigationPage { - let prefs = adw::PreferencesPage::new(); - let heading = adw::PreferencesGroup::builder() - .title(glib::markup_escape_text(&addon.folder)) - .build(); - prefs.add(&heading); - if !addon.texts.is_empty() { - let group = adw::PreferencesGroup::builder().title(tr("Texts")).build(); - for (path, name) in &addon.texts { - let row = adw::ActionRow::builder() - .title(glib::markup_escape_text(name)) - .activatable(true) - .build(); - row.add_suffix(>k::Image::from_icon_name("go-next-symbolic")); - row.connect_activated({ - let nav = nav.clone(); - let (path, name) = (path.clone(), name.clone()); - move |_| nav.push(&text_page(&name, &extras.text(&path))) - }); - group.add(&row); - } - prefs.add(&group); - } - for package in &addon.packages { - let file = package.path.rsplit('/').next().unwrap_or(&package.path); - let group = adw::PreferencesGroup::builder() - .title(glib::markup_escape_text(file)) - .description(match (package.items.len(), package.total) { - (kept, total) if kept >= total => trn!( - "{count} item, all in the collection", - "{count} items, all in the collection", - kept as u64, - count = crate::thousands(kept) - ), - (0, total) => trn!( - "{n} item, which a newer add-on replaced", - "{n} items, which newer add-ons replaced", - total as u64 - ), - (kept, total) => trn!( - "{n} item; {kept} are in the collection as written here", - "{n} items; {kept} are in the collection as written here", - total as u64, - kept - ), - }) - .build(); - let mut categories: Vec<(&str, Vec<&str>)> = Vec::new(); - for (category, name) in &package.items { - match categories.iter_mut().find(|(c, _)| c == category) { - Some((_, names)) => names.push(name), - None => categories.push((category, vec![name])), - } - } - for (category, names) in categories { - let mut text = names - .iter() - .take(SHOWN) - .copied() - .collect::>() - .join(", "); - if names.len() > SHOWN { - text.push_str(", "); - text.push_str(&trn!( - "and {n} more", - "and {n} more", - (names.len() - SHOWN) as u64 - )); - } - let row = adw::ExpanderRow::builder() - .title(glib::markup_escape_text(tr(category))) - .subtitle(names.len().to_string()) - .build(); - row.add_row( - >k::Label::builder() - .label(&text) - .wrap(true) - .wrap_mode(gtk::pango::WrapMode::WordChar) - .xalign(0.0) - .selectable(true) - .margin_top(12) - .margin_bottom(12) - .margin_start(12) - .margin_end(12) - .build(), - ); - group.add(&row); - } - prefs.add(&group); - } - page(addon.name(), &prefs, None) -} - -/// A text of an add-on, as its author wrote it. -fn text_page(name: &str, text: &str) -> adw::NavigationPage { - let view = gtk::TextView::builder() - .editable(false) - .cursor_visible(false) - .monospace(true) - .wrap_mode(gtk::WrapMode::WordChar) - .top_margin(12) - .bottom_margin(12) - .left_margin(12) - .right_margin(12) - .build(); - view.buffer().set_text(text); - page(name, &scrolled(&view), None) -} diff --git a/crates/cr-addons/src/extras.rs b/crates/cr-addons/src/extras.rs deleted file mode 100644 index 9cc7112..0000000 --- a/crates/cr-addons/src/extras.rs +++ /dev/null @@ -1,299 +0,0 @@ -//! The add-ons' pictures and texts, built into the program beside the -//! package: the pictures go where the records look for them, and the -//! texts (the add-ons' readme files, as plain text) are shown on request. -//! -//! `addons/Comunidade-extras.xz` is, before xz, a text header and then the -//! files' bytes in the header's order: -//! -//! ```text -//! CRX1 -//! Fsizepath pictures/..., texts/....txt, addons.tsv -//! Ppictureplace a picture's place in the installation -//! (blank line) -//! ``` -//! -//! `addons.tsv` holds one block per add-on folder: `Afolder`, then -//! `Kpackageitems in it` for each package, `Icategoryname` -//! for the items it brought and `Ttextfile name` for its texts. - -use std::collections::HashMap; -use std::fs; -use std::io; -use std::path::{Path, PathBuf}; - -use cr_i18n::tr; -use cr_store::Installation; - -static EXTRAS: &[u8] = include_bytes!("../../../addons/Comunidade-extras.xz"); - -pub struct Extras { - data: Vec, - /// Each file's bytes in `data`, by its path. - files: HashMap, - /// Pictures in the order of the header. - pictures: Vec, - /// (picture, place in the installation). - placements: Vec<(String, String)>, -} - -/// One add-on folder of the community's archive. -#[derive(Debug, Default)] -pub struct Addon { - pub folder: String, - pub packages: Vec, - /// (path in the extras, file name). - pub texts: Vec<(String, String)>, -} - -#[derive(Debug, Default)] -pub struct Package { - pub path: String, - /// Items in the package, before newer add-ons replaced some. - pub total: usize, - /// (category, name) of the items it brought. - pub items: Vec<(String, String)>, -} - -impl Addon { - pub fn name(&self) -> &str { - self.folder.rsplit('/').next().unwrap_or(&self.folder) - } - - /// Items in its packages. - pub fn total(&self) -> usize { - self.packages.iter().map(|p| p.total).sum() - } -} - -/// The built-in pictures and texts, unpacked on first use. -pub fn get() -> Result<&'static Extras, String> { - static EXTRAS: std::sync::OnceLock> = std::sync::OnceLock::new(); - EXTRAS - .get_or_init(Extras::load) - .as_ref() - .map_err(Clone::clone) -} - -impl Extras { - /// The built-in pictures and texts, unpacked. - fn load() -> Result { - let mut data = Vec::new(); - lzma_rs::xz_decompress(&mut io::Cursor::new(EXTRAS), &mut data) - .map_err(|e| tr!("The built-in pictures are damaged: {e}", e))?; - Self::parse(data).ok_or_else(|| tr("The built-in pictures are damaged.").to_string()) - } - - fn parse(data: Vec) -> Option { - let end = data.windows(2).position(|w| w == b"\n\n")?; - let header = std::str::from_utf8(&data[..end]).ok()?; - let mut lines = header.lines(); - if lines.next()? != "CRX1" { - return None; - } - let mut at = end + 2; - let (mut files, mut pictures, mut placements) = (HashMap::new(), Vec::new(), Vec::new()); - for line in lines { - let mut fields = line.split('\t'); - match (fields.next(), fields.next(), fields.next()) { - (Some("F"), Some(size), Some(path)) => { - let size: usize = size.parse().ok()?; - files.insert(path.to_owned(), (at, size)); - if path.starts_with("pictures/") { - pictures.push(path.to_owned()); - } - at += size; - } - (Some("P"), Some(picture), Some(place)) => { - placements.push((picture.to_owned(), place.to_owned())); - } - _ => return None, - } - } - (at <= data.len()).then_some(Self { - data, - files, - pictures, - placements, - }) - } - - pub fn file(&self, path: &str) -> Option<&[u8]> { - let &(at, size) = self.files.get(path)?; - self.data.get(at..at + size) - } - - pub fn text(&self, path: &str) -> String { - self.file(path) - .map(|t| String::from_utf8_lossy(t).into_owned()) - .unwrap_or_default() - } - - /// The add-on folders, in the archive's order. - pub fn addons(&self) -> Vec { - let mut addons: Vec = Vec::new(); - for line in self.text("addons.tsv").lines() { - let fields: Vec<&str> = line.split('\t').collect(); - match fields[..] { - ["A", folder] => addons.push(Addon { - folder: folder.to_owned(), - ..Default::default() - }), - ["K", path, total] => { - if let Some(a) = addons.last_mut() { - a.packages.push(Package { - path: path.to_owned(), - total: total.parse().unwrap_or_default(), - items: Vec::new(), - }); - } - } - ["I", category, name] => { - if let Some(p) = addons.last_mut().and_then(|a| a.packages.last_mut()) { - p.items.push((category.to_owned(), name.to_owned())); - } - } - ["T", path, name] => { - if let Some(a) = addons.last_mut() { - a.texts.push((path.to_owned(), name.to_owned())); - } - } - _ => {} - } - } - addons - } - - /// Where each picture goes in `install`: the places the records name, - /// then every picture under `UserBMP/`, in its add-on's folder, where - /// the original's picture dialogs open. Inside Wine, a picture the - /// records look for elsewhere on drive C: (`C:\AD&D Pics`) goes there - /// too. - fn targets(&self, install: &Installation) -> Vec<(&str, PathBuf)> { - let root = install.root(); - let drive_c = root - .ancestors() - .find(|a| a.file_name().is_some_and(|n| n == "drive_c")); - let mut out = Vec::new(); - for (picture, place) in &self.placements { - out.push((picture.as_str(), join(root, place))); - if let (Some(c), Some(rest)) = (drive_c, place.strip_prefix("UserBMP/")) { - out.push((picture.as_str(), join(c, rest))); - } - } - for picture in &self.pictures { - let place = format!("UserBMP/{}", picture.trim_start_matches("pictures/")); - out.push((picture.as_str(), join(root, &place))); - } - out - } - - /// Writes the pictures into `install`, never over a file that is - /// already there; returns the files written, for the log. - pub fn install_pictures(&self, install: &Installation) -> Result, String> { - let mut written = Vec::new(); - for (picture, target) in self.targets(install) { - let Some(bytes) = self.file(picture) else { - continue; - }; - let target = existing_case(&target); - if target.exists() { - continue; - } - let write = || -> io::Result<()> { - if let Some(dir) = target.parent() { - fs::create_dir_all(dir)?; - } - fs::write(&target, bytes) - }; - write().map_err(|e| tr!("Could not write {file}: {e}", file = target.display(), e))?; - written.push(target); - } - Ok(written) - } -} - -fn join(root: &Path, relative: &str) -> PathBuf { - relative.split('/').fold(root.to_owned(), |p, c| p.join(c)) -} - -/// `path`, with each part that is already there in another case spelled -/// as it is on disk: the original's folders are `BITMAPS` on one -/// computer and `Bitmaps` on the next, and its file names ignore case. -fn existing_case(path: &Path) -> PathBuf { - let mut out = PathBuf::new(); - for part in path.components() { - let next = out.join(part); - if next.exists() || out.as_os_str().is_empty() { - out = next; - continue; - } - let name = part.as_os_str().to_string_lossy(); - let found = fs::read_dir(&out).ok().and_then(|entries| { - entries - .filter_map(|e| e.ok()) - .find(|e| e.file_name().to_string_lossy().eq_ignore_ascii_case(&name)) - .map(|e| e.path()) - }); - out = found.unwrap_or(next); - } - out -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn the_built_in_extras_read() { - let extras = get().unwrap(); - let addons = extras.addons(); - assert!(addons.len() > 250); - assert!( - addons - .iter() - .all(|a| !a.folder.starts_with("Official Addons")) - ); - let udb = addons - .iter() - .find(|a| a.folder == "AD&D Core Rules User Database") - .unwrap(); - assert!(udb.packages[0].items.len() > 30_000); - assert!(udb.total() >= udb.packages[0].items.len()); - assert!(extras.pictures.len() > 600); - assert!( - extras - .pictures - .iter() - .all(|p| extras.file(p).is_some_and(|b| b.starts_with(b"BM"))) - ); - for (path, _) in addons.iter().flat_map(|a| &a.texts) { - assert!(extras.file(path).is_some(), "{path}"); - } - } - - #[test] - fn pictures_go_where_the_records_look() { - let data = b"CRX1\nF\t2\tpictures/M/a.bmp\nP\tpictures/M/a.bmp\tBitmaps/Monsters/A.bmp\n\ - P\tpictures/M/a.bmp\tUserBMP/AD&D Pics/a.bmp\n\nBM" - .to_vec(); - let extras = Extras::parse(data).unwrap(); - let base = std::env::temp_dir().join(format!("cr-addons-pictures-{}", std::process::id())); - let root = base.join("drive_c/Program Files/AD&D Core Rules 2.0"); - fs::create_dir_all(root.join("Database")).unwrap(); - fs::create_dir_all(root.join("BITMAPS/MONSTERS")).unwrap(); - let install = Installation::open(&root).unwrap(); - let written = extras.install_pictures(&install).unwrap(); - assert_eq!( - written, - [ - root.join("BITMAPS/MONSTERS/A.bmp"), - root.join("UserBMP/AD&D Pics/a.bmp"), - base.join("drive_c/AD&D Pics/a.bmp"), - root.join("UserBMP/M/a.bmp"), - ] - ); - // A second install leaves them as they are. - assert!(extras.install_pictures(&install).unwrap().is_empty()); - fs::remove_dir_all(base).unwrap(); - } -} diff --git a/crates/cr-addons/src/install.rs b/crates/cr-addons/src/install.rs deleted file mode 100644 index 67f36fc..0000000 --- a/crates/cr-addons/src/install.rs +++ /dev/null @@ -1,246 +0,0 @@ -//! Installing the add-ons into a data folder, without the interface: the -//! same steps as the old `instalar-addons.sh`. - -use std::fmt::Write as _; -use std::fs; -use std::io; -use std::path::{Path, PathBuf}; - -use cr_formats::export::ExportFile; -use cr_i18n::tr; -use cr_store::Installation; -use cr_store::export::{Category, ImportReport, contents}; - -/// The consolidated add-ons, compressed with xz. -static PACKAGE: &[u8] = include_bytes!("../../../addons/Comunidade.xpx.xz"); - -/// Written into `UserDbas/` once the add-ons are in; a second install then -/// leaves the characters out, which would otherwise come in twice. -const MARKER: &str = ".addons-comunidade"; - -/// What a folder offers for the install. -pub enum Folder { - Ready { - install: Installation, - /// The add-ons were installed there before. - again: bool, - /// The folder is the original program's, inside a Wine prefix. - wine: bool, - }, - /// A Core Rules 2.0 installation; the add-ons are the Expansion's. - Core20, - NotAnInstallation, -} - -pub fn check(dir: &Path) -> Folder { - let Ok(install) = Installation::open(dir) else { - return Folder::NotAnInstallation; - }; - if install.is_core20() { - return Folder::Core20; - } - let again = install - .path("UserDbas") - .is_some_and(|d| d.join(MARKER).exists()); - let wine = install.root().to_string_lossy().contains("/drive_c/"); - Folder::Ready { - install, - again, - wine, - } -} - -/// The built-in package, unpacked and read. -pub fn package() -> Result { - let mut data = Vec::new(); - lzma_rs::xz_decompress(&mut io::Cursor::new(PACKAGE), &mut data) - .map_err(|e| tr!("The built-in add-ons are damaged: {e}", e))?; - ExportFile::parse(&data).map_err(|e| tr!("Could not read the built-in add-ons: {e}", e)) -} - -/// Copies `UserDbas/` and `Chars/` into a folder beside the data folder; -/// returns that folder. -pub fn backup(install: &Installation, stamp: &str) -> Result { - let to = beside(install.root(), &format!("before-addons-{stamp}")); - for name in ["UserDbas", "Chars"] { - if let Some(from) = install.path(name) { - let target = to.join(from.file_name().unwrap_or(name.as_ref())); - copy_dir(&from, &target) - .map_err(|e| tr!("Could not copy {folder}: {e}", folder = from.display(), e))?; - } - } - Ok(to) -} - -/// What the install did. -pub struct Outcome { - pub imported: usize, - pub characters: usize, - /// Pictures written by [`pictures`]. - pub pictures: usize, - pub log: PathBuf, -} - -/// Imports `file` into `install`; a second install leaves the characters -/// out. -pub fn import(install: &Installation, file: &ExportFile, stamp: &str) -> Result { - let items = contents(file); - let again = matches!(check(install.root()), Folder::Ready { again: true, .. }); - let first: Option> = again.then(|| { - (0..items.len()) - .filter(|&n| items[n].category != Category::Character) - .collect() - }); - let failed = |e: cr_store::Error| tr!("The import failed: {e}", e); - let report = install.import(file, first.as_deref()).map_err(failed)?; - - let mut log = String::new(); - write_report(&mut log, &report); - let path = beside(install.root(), &format!("addons-{stamp}.log")); - fs::write(&path, log) - .map_err(|e| tr!("Could not write {file}: {e}", file = path.display(), e))?; - if let Some(userdbas) = install.path("UserDbas") { - let _ = fs::write(userdbas.join(MARKER), stamp); - } - Ok(Outcome { - imported: report.imported.len(), - characters: report.characters.len(), - pictures: 0, - log: path, - }) -} - -/// Writes the add-ons' pictures into `install`, beside nothing that is -/// there already, and adds the files to the log. -pub fn pictures(install: &Installation, outcome: &mut Outcome) -> Result<(), String> { - let written = crate::extras::get()?.install_pictures(install)?; - let mut log = String::from("=== pictures\n"); - for file in &written { - let _ = writeln!(log, "wrote {}", file.display()); - } - let mut file = fs::OpenOptions::new() - .append(true) - .open(&outcome.log) - .map_err(|e| { - tr!( - "Could not write {file}: {e}", - file = outcome.log.display(), - e - ) - })?; - io::Write::write_all(&mut file, log.as_bytes()).map_err(|e| { - tr!( - "Could not write {file}: {e}", - file = outcome.log.display(), - e - ) - })?; - outcome.pictures = written.len(); - Ok(()) -} - -/// The report in the words `cr import` prints. -fn write_report(out: &mut String, report: &ImportReport) { - for c in &report.imported { - let _ = writeln!(out, "imported {}: {}", c.category.label(), c.name); - } - for (category, name) in &report.replaced { - let _ = writeln!(out, "replaced {}: {name}", category.label()); - } - for c in &report.skipped { - let _ = writeln!(out, "skipped {}: {}", c.category.label(), c.name); - } - for (c, name) in &report.renamed { - let _ = writeln!(out, "renamed {}: {} to {name}", c.category.label(), c.name); - } - for file in &report.characters { - let _ = writeln!(out, "wrote Chars/{file}"); - } - for warning in &report.warnings { - let _ = writeln!(out, "warning: {warning}"); - } -} - -/// `data` → `data-SUFFIX`, in the same parent folder. -fn beside(root: &Path, suffix: &str) -> PathBuf { - let name = root - .file_name() - .map_or("data".into(), |n| n.to_string_lossy()); - root.with_file_name(format!("{name}-{suffix}")) -} - -fn copy_dir(from: &Path, to: &Path) -> io::Result<()> { - fs::create_dir_all(to)?; - for entry in fs::read_dir(from)? { - let entry = entry?; - let target = to.join(entry.file_name()); - if entry.file_type()?.is_dir() { - copy_dir(&entry.path(), &target)?; - } else { - fs::copy(entry.path(), target)?; - } - } - Ok(()) -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn the_built_in_package_reads() { - let file = package().unwrap(); - assert!(file.is_expansion()); - let items = contents(&file); - assert_eq!(items.len(), 36_525); - let characters = items.iter().filter(|c| c.category == Category::Character); - assert_eq!(characters.count(), 48); - } - - /// With `CORERULES_DIR` pointing at an Expansion installation without - /// records of its own, the add-ons go into a copy of its user - /// databases. - #[test] - fn one_import_brings_every_combination() { - let Some(dir) = std::env::var_os("CORERULES_DIR") else { - return; - }; - let original = Installation::open(Path::new(&dir)).unwrap(); - if original.is_core20() { - return; - } - let root = std::env::temp_dir().join(format!("cr-addons-once-{}", std::process::id())); - let _ = fs::remove_dir_all(&root); - copy_dir(&original.path("UserDbas").unwrap(), &root.join("UserDbas")).unwrap(); - std::os::unix::fs::symlink(original.path("Database").unwrap(), root.join("Database")) - .unwrap(); - let install = Installation::open(&root).unwrap(); - let file = package().unwrap(); - let report = install.import(&file, None).unwrap(); - let unresolved: Vec<_> = report - .warnings - .iter() - .filter(|w| w.starts_with("No race/class combinations could be added")) - .collect(); - assert!(unresolved.is_empty(), "{unresolved:?}"); - - // Importing the classes again, as the original needed, adds nothing. - let allowed = fs::read(root.join("UserDbas/AllowedU.dat")).unwrap(); - let items = contents(&file); - let classes: Vec = (0..items.len()) - .filter(|&n| items[n].category == Category::Class) - .collect(); - install.import(&file, Some(&classes)).unwrap(); - assert!(fs::read(root.join("UserDbas/AllowedU.dat")).unwrap() == allowed); - let _ = fs::remove_dir_all(&root); - } - - #[test] - fn backups_and_logs_sit_beside_the_folder() { - let root = Path::new("/home/u/.local/share/corerules/data"); - assert_eq!( - beside(root, "addons-1.log"), - Path::new("/home/u/.local/share/corerules/data-addons-1.log") - ); - } -} diff --git a/crates/cr-addons/src/locate.rs b/crates/cr-addons/src/locate.rs deleted file mode 100644 index d8f056c..0000000 --- a/crates/cr-addons/src/locate.rs +++ /dev/null @@ -1,477 +0,0 @@ -//! Finding the Core Rules app on this computer, however it was installed, -//! and the data folder each copy reads: the .deb, .rpm and AppImage use -//! `~/.local/share/corerules/data`, the Flatpak its own copy under -//! `~/.var/app`, and each falls back to the original program in the Wine -//! prefix, as `Installation::discover` does. - -use std::fs; -use std::path::{Path, PathBuf}; -use std::process::Command; - -use cr_i18n::tr; -use cr_store::{DEFAULT_WINE_PATH, Installation}; - -const APP_ID: &str = "io.github.brahm.CoreRules"; - -/// How a copy of the app was installed. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum Kind { - Flatpak, - Deb, - Rpm, - /// A program in the system path that no package manager owns. - Other(PathBuf), - AppImage(PathBuf), -} - -/// One copy of the app. -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct App { - pub kind: Kind, - pub version: Option, - /// The folder this copy opens: its data folder, else the Wine prefix - /// when the original program is installed there. - pub data: PathBuf, - /// Whether `data` is the original program in the Wine prefix. - pub wine: bool, - /// Whether `data` holds Core Rules data yet. - pub ready: bool, -} - -impl App { - pub fn label(&self) -> String { - let how = match &self.kind { - Kind::Flatpak => "Flatpak".to_string(), - Kind::Deb => tr(".deb package").to_string(), - Kind::Rpm => tr(".rpm package").to_string(), - Kind::Other(path) => path.display().to_string(), - Kind::AppImage(path) => match path.parent() { - Some(dir) => tr!("AppImage in {folder}", folder = crate::home_relative(dir)), - None => "AppImage".to_string(), - }, - }; - match &self.version { - Some(v) => format!("Core Rules {v} ({how})"), - None => format!("Core Rules ({how})"), - } - } - - /// Whether this version reads every add-on: 0.7.2 learned the classes - /// the patched Expansion writes. - pub fn reads_addons(&self) -> bool { - self.version - .as_deref() - .is_none_or(|v| version_at_least(v, (0, 7, 2))) - } - - /// Starts this copy of the app, outside the installer's own AppImage. - pub fn launch(&self) -> std::io::Result<()> { - let mut command = match &self.kind { - Kind::Flatpak => { - let mut c = Command::new("flatpak"); - c.args(["run", APP_ID]); - c - } - Kind::Deb | Kind::Rpm => Command::new("corerules"), - Kind::Other(path) | Kind::AppImage(path) => Command::new(path), - }; - clean_env(&mut command); - command.spawn().map(|_| ()) - } -} - -/// Where to look; the real values come from [`Places::here`], tests build -/// their own. -pub struct Places { - pub home: PathBuf, - /// `$XDG_DATA_HOME`, when set. - pub data_home: Option, - /// `$WINEPREFIX`, when set. - pub wine_prefix: Option, - /// The folders of `$PATH`, without the installer's own. - pub path: Vec, - /// The system root, `/`. - pub root: PathBuf, - /// Folders where people keep AppImages. - pub appimage_dirs: Vec, -} - -impl Places { - pub fn here() -> Self { - let home = std::env::var_os("HOME").map_or_else(|| PathBuf::from("/"), PathBuf::from); - let own = std::env::var_os("APPDIR").map(PathBuf::from); - let path = std::env::var_os("PATH") - .map(|p| std::env::split_paths(&p).collect::>()) - .unwrap_or_default() - .into_iter() - .filter(|d| own.as_ref().is_none_or(|o| !d.starts_with(o))) - .collect(); - let mut appimage_dirs = vec![ - home.join("Applications"), - home.join("AppImages"), - home.join(".local/bin"), - home.join("bin"), - home.join("Downloads"), - home.join("Desktop"), - home.clone(), - PathBuf::from("/opt"), - ]; - for dir in [ - gtk::glib::UserDirectory::Downloads, - gtk::glib::UserDirectory::Desktop, - ] { - if let Some(d) = gtk::glib::user_special_dir(dir) { - appimage_dirs.push(d); - } - } - // The installer's own folder: it is often downloaded beside the app. - if let Some(own) = std::env::var_os("APPIMAGE").map(PathBuf::from) - && let Some(dir) = own.parent() - { - appimage_dirs.push(dir.to_path_buf()); - } - Self { - home, - data_home: std::env::var_os("XDG_DATA_HOME") - .filter(|d| !d.is_empty()) - .map(PathBuf::from), - wine_prefix: std::env::var_os("WINEPREFIX") - .filter(|d| !d.is_empty()) - .map(PathBuf::from), - path, - root: PathBuf::from("/"), - appimage_dirs, - } - } - - /// The data folder of the .deb, .rpm and AppImage. - fn native_data(&self) -> PathBuf { - self.data_home - .clone() - .unwrap_or_else(|| self.home.join(".local/share")) - .join("corerules/data") - } - - /// The data folder of the Flatpak, whose `$XDG_DATA_HOME` is its own. - fn flatpak_data(&self) -> PathBuf { - self.home - .join(".var/app") - .join(APP_ID) - .join("data/corerules/data") - } - - fn wine(&self, prefix: Option<&Path>) -> PathBuf { - prefix - .map(Path::to_path_buf) - .unwrap_or_else(|| self.home.join(".wine")) - .join(DEFAULT_WINE_PATH) - } -} - -/// Every copy of the app found, the Flatpak first. -pub fn apps(places: &Places) -> Vec { - let mut found = Vec::new(); - let native = places.native_data(); - // The Flatpak does not see $WINEPREFIX; it looks in ~/.wine. - for base in [ - places.home.join(".local/share/flatpak"), - places.root.join("var/lib/flatpak"), - ] { - let active = base.join("app").join(APP_ID).join("current/active"); - if active.join("files").is_dir() { - let version = metainfo_version(&active.join("files/share/metainfo")); - found.push(app( - Kind::Flatpak, - version, - &places.flatpak_data(), - &places.wine(None), - )); - break; - } - } - let wine = places.wine(places.wine_prefix.as_deref()); - if let Some(bin) = places - .path - .iter() - .map(|d| d.join("corerules")) - .find(|b| b.is_file()) - { - let prefix = bin.parent().and_then(Path::parent).unwrap_or(&places.root); - let version = metainfo_version(&prefix.join("share/metainfo")); - let kind = if places - .root - .join("var/lib/dpkg/info/corerules.list") - .exists() - { - Kind::Deb - } else if prefix == places.root.join("usr") && rpm_owns(&bin) { - Kind::Rpm - } else { - Kind::Other(bin.clone()) - }; - found.push(app(kind, version, &native, &wine)); - } - for image in appimages(places) { - let version = appimage_version(&image); - found.push(app(Kind::AppImage(image), version, &native, &wine)); - } - found -} - -fn app(kind: Kind, version: Option, data: &Path, wine: &Path) -> App { - let has = |dir: &Path| Installation::open(dir).is_ok(); - let (data, wine, ready) = if has(data) { - (data.to_path_buf(), false, true) - } else if has(wine) { - (wine.to_path_buf(), true, true) - } else { - (data.to_path_buf(), false, false) - }; - App { - kind, - version, - data, - wine, - ready, - } -} - -/// `CoreRules-0.8.0-x86_64.AppImage` files, newest version first; the -/// add-ons' own (`CoreRules-Community-Addons-…`, or `CoreRules-Addons-…` -/// before) are not. -fn appimages(places: &Places) -> Vec { - let mut found: Vec = Vec::new(); - for dir in &places.appimage_dirs { - let Ok(entries) = fs::read_dir(dir) else { - continue; - }; - for entry in entries.flatten() { - let name = entry.file_name().to_string_lossy().to_string(); - let lower = name.to_lowercase(); - if lower.starts_with("corerules") - && !lower.contains("addons") - && lower.ends_with(".appimage") - && entry.path().is_file() - { - let path = entry.path(); - let real = fs::canonicalize(&path).unwrap_or_else(|_| path.clone()); - if !found - .iter() - .any(|f| fs::canonicalize(f).unwrap_or_else(|_| f.clone()) == real) - { - found.push(path); - } - } - } - } - found.sort_by_key(|p| { - std::cmp::Reverse( - appimage_version(p) - .map(|v| version_key(&v)) - .unwrap_or_default(), - ) - }); - found -} - -/// `CoreRules-0.8.0-x86_64.AppImage` → `0.8.0`. -fn appimage_version(path: &Path) -> Option { - let name = path.file_name()?.to_string_lossy(); - name.split('-') - .find(|part| part.starts_with(|c: char| c.is_ascii_digit()) && part.contains('.')) - .map(str::to_string) -} - -/// The newest `` of the app's metainfo. -fn metainfo_version(dir: &Path) -> Option { - let text = fs::read_to_string(dir.join(format!("{APP_ID}.metainfo.xml"))).ok()?; - let start = text.find(" bool { - let mut command = Command::new("rpm"); - command.arg("-qf").arg(bin); - clean_env(&mut command); - command.output().is_ok_and(|o| o.status.success()) -} - -fn version_key(version: &str) -> (u32, u32, u32) { - let mut parts = version - .split(|c: char| !c.is_ascii_digit()) - .filter(|p| !p.is_empty()) - .map(|p| p.parse().unwrap_or(0)); - ( - parts.next().unwrap_or(0), - parts.next().unwrap_or(0), - parts.next().unwrap_or(0), - ) -} - -fn version_at_least(version: &str, wanted: (u32, u32, u32)) -> bool { - version_key(version) >= wanted -} - -/// Takes out of a child's environment what the installer's AppImage set -/// up for itself (its libraries, schemas and data folders), so the app it -/// starts uses its own. -fn clean_env(command: &mut Command) { - let Some(own) = std::env::var_os("APPDIR").map(PathBuf::from) else { - return; - }; - for (key, value) in std::env::vars_os() { - let parts: Vec = std::env::split_paths(&value).collect(); - if !parts.iter().any(|p| p.starts_with(&own)) { - continue; - } - let kept: Vec = parts.into_iter().filter(|p| !p.starts_with(&own)).collect(); - match std::env::join_paths(&kept) { - Ok(joined) if !kept.is_empty() => command.env(&key, joined), - _ => command.env_remove(&key), - }; - } - for key in ["APPDIR", "APPIMAGE", "ARGV0", "OWD"] { - command.env_remove(key); - } -} - -#[cfg(test)] -mod tests { - use super::*; - - struct Fake { - dir: PathBuf, - } - - impl Fake { - fn new(name: &str) -> Self { - let dir = std::env::temp_dir().join(format!("cr-addons-{name}-{}", std::process::id())); - let _ = fs::remove_dir_all(&dir); - fs::create_dir_all(dir.join("home")).unwrap(); - Self { dir } - } - - fn places(&self) -> Places { - let home = self.dir.join("home"); - Places { - appimage_dirs: vec![home.join("Applications"), home.join("Downloads")], - home, - data_home: None, - wine_prefix: None, - path: vec![self.dir.join("usr/bin")], - root: self.dir.clone(), - } - } - - fn file(&self, relative: &str, text: &str) { - let path = self.dir.join(relative); - fs::create_dir_all(path.parent().unwrap()).unwrap(); - fs::write(path, text).unwrap(); - } - - /// A data folder `Installation::open` accepts, of the Expansion. - fn data(&self, relative: &str) { - self.file(&format!("{relative}/Database/Spells.dat"), ""); - self.file(&format!("{relative}/UserDbas/AllowedU.dat"), ""); - } - } - - impl Drop for Fake { - fn drop(&mut self) { - let _ = fs::remove_dir_all(&self.dir); - } - } - - fn metainfo(version: &str) -> String { - format!( - "" - ) - } - - #[test] - fn the_flatpak_reads_its_own_data_folder() { - let fake = Fake::new("flatpak"); - let active = "home/.local/share/flatpak/app/io.github.brahm.CoreRules/current/active"; - fake.file( - &format!("{active}/files/share/metainfo/io.github.brahm.CoreRules.metainfo.xml"), - &metainfo("0.8.0"), - ); - fake.data("home/.var/app/io.github.brahm.CoreRules/data/corerules/data"); - let found = apps(&fake.places()); - assert_eq!(found.len(), 1); - assert_eq!(found[0].kind, Kind::Flatpak); - assert_eq!(found[0].version.as_deref(), Some("0.8.0")); - assert!(found[0].ready && !found[0].wine); - assert!( - found[0] - .data - .ends_with(".var/app/io.github.brahm.CoreRules/data/corerules/data") - ); - assert_eq!(found[0].label(), "Core Rules 0.8.0 (Flatpak)"); - } - - #[test] - fn a_deb_reads_the_shared_data_folder_or_the_wine_prefix() { - let fake = Fake::new("deb"); - fake.file("usr/bin/corerules", ""); - fake.file( - "usr/share/metainfo/io.github.brahm.CoreRules.metainfo.xml", - &metainfo("0.7.1"), - ); - fake.file("var/lib/dpkg/info/corerules.list", ""); - fake.data("home/.wine/drive_c/Program Files/AD&D Core Rules 2.0"); - let found = apps(&fake.places()); - assert_eq!(found[0].kind, Kind::Deb); - assert!(found[0].ready && found[0].wine); - assert!(!found[0].reads_addons()); - - fake.data("home/.local/share/corerules/data"); - let found = apps(&fake.places()); - assert!(found[0].ready && !found[0].wine); - assert!(found[0].data.ends_with(".local/share/corerules/data")); - } - - #[test] - fn appimages_are_found_by_name_and_share_one_folder() { - let fake = Fake::new("appimage"); - fake.file("home/Downloads/CoreRules-0.7.2-x86_64.AppImage", ""); - fake.file("home/Applications/CoreRules-0.8.0-x86_64.AppImage", ""); - fake.file("home/Downloads/CoreRules-Addons-0.8.0-x86_64.AppImage", ""); - fake.file( - "home/Downloads/CoreRules-Community-Addons-0.8.1-x86_64.AppImage", - "", - ); - fake.data("home/.local/share/corerules/data"); - let found = apps(&fake.places()); - let versions: Vec<_> = found.iter().map(|a| a.version.clone().unwrap()).collect(); - assert_eq!(versions, ["0.8.0", "0.7.2"]); - assert_eq!(found[0].data, found[1].data); - } - - #[test] - fn nothing_installed_finds_nothing() { - let fake = Fake::new("none"); - assert!(apps(&fake.places()).is_empty()); - } - - #[test] - fn a_copy_without_data_is_not_a_target() { - let fake = Fake::new("nodata"); - fake.file("usr/bin/corerules", ""); - let found = apps(&fake.places()); - assert_eq!(found.len(), 1); - assert!(!found[0].ready); - } - - #[test] - fn versions_compare_by_number() { - assert!(version_at_least("0.10.0", (0, 7, 2))); - assert!(version_at_least("0.7.2", (0, 7, 2))); - assert!(!version_at_least("0.7.1", (0, 7, 2))); - assert_eq!( - appimage_version(Path::new("CoreRules-0.8.0-x86_64.AppImage")).as_deref(), - Some("0.8.0") - ); - } -} diff --git a/crates/cr-addons/src/main.rs b/crates/cr-addons/src/main.rs deleted file mode 100644 index 814aac8..0000000 --- a/crates/cr-addons/src/main.rs +++ /dev/null @@ -1,621 +0,0 @@ -//! Core Rules Community Add-ons Collection: one window that imports the -//! consolidated add-ons, built into the program, into the Core Rules data -//! folder. The window speaks the app's languages and follows the one chosen -//! in its Preferences; the add-ons themselves are in Portuguese. - -mod details; -mod extras; -mod install; -mod locate; - -use std::cell::RefCell; -use std::path::{Path, PathBuf}; -use std::rc::Rc; - -use adw::prelude::*; -use cr_i18n::{Language, tr, trn}; -use cr_store::Installation; -use gtk::{gdk, gio, glib}; -use install::Folder; -use locate::{App, Places}; - -const APP_ID: &str = "io.github.brahm.CoreRules.Addons"; - -static ICON: &[u8] = include_bytes!( - "../../../data/addons/icons/hicolor/256x256/apps/io.github.brahm.CoreRules.Addons.png" -); - -fn main() -> glib::ExitCode { - apply_language(); - let app = adw::Application::builder().application_id(APP_ID).build(); - app.connect_activate(|app| { - gtk::Window::set_default_icon_name(APP_ID); - Window::new(app).window.present(); - }); - app.run() -} - -#[derive(Clone)] -struct Window { - window: adw::ApplicationWindow, - stack: gtk::Stack, - group: adw::PreferencesGroup, - rows: Rc>>, - notice: gtk::Label, - install_button: gtk::Button, - start_app: gtk::Button, - progress: adw::StatusPage, - done: adw::StatusPage, - done_app: gtk::Button, - log: Rc>>, - /// The copies of the app found on this computer. - apps: Rc>>, - /// A folder picked with "Outra pasta…", which replaces the ones found. - chosen: Rc>>, - /// The data folders the add-ons go into. - targets: Rc>>, -} - -impl Window { - fn new(app: &adw::Application) -> Self { - let window = adw::ApplicationWindow::builder() - .application(app) - .title(tr("Core Rules Community Add-ons Collection")) - .default_width(560) - .default_height(680) - .width_request(360) - .height_request(294) - .build(); - - let group = adw::PreferencesGroup::builder() - .title(tr("Core Rules on This Computer")) - .build(); - let rescan = gtk::Button::builder() - .icon_name("view-refresh-symbolic") - .tooltip_text(tr("Search Again")) - .css_classes(["flat"]) - .valign(gtk::Align::Center) - .build(); - group.set_header_suffix(Some(&rescan)); - let notice = gtk::Label::builder() - .wrap(true) - .xalign(0.0) - .css_classes(["dim-label"]) - .build(); - let install_button = gtk::Button::builder() - .label(tr("Install")) - .css_classes(["pill", "suggested-action"]) - .build(); - let start_app = gtk::Button::builder() - .label(tr("Open Core Rules")) - .css_classes(["pill"]) - .build(); - let actions = gtk::Box::builder() - .spacing(12) - .halign(gtk::Align::Center) - .build(); - actions.append(&start_app); - actions.append(&install_button); - let other = gtk::Button::builder() - .label(tr("Other Folder…")) - .css_classes(["flat"]) - .build(); - let details = gtk::Button::builder() - .label(tr("Add-on Details…")) - .css_classes(["flat"]) - .build(); - details.connect_clicked(details::show); - let more = gtk::Box::builder() - .spacing(6) - .halign(gtk::Align::Center) - .build(); - more.append(&other); - more.append(&details); - let form = gtk::Box::builder() - .orientation(gtk::Orientation::Vertical) - .spacing(18) - .build(); - form.append(&group); - form.append(¬ice); - form.append(&actions); - form.append(&more); - let clamp = adw::Clamp::builder().maximum_size(480).child(&form).build(); - - let start = adw::StatusPage::builder() - .title(tr("Core Rules Community Add-ons Collection")) - .description(tr!( - "The {addons} add-ons the community made for AD&D Core Rules 2.0 and the \ - Expansion, in one package: races, classes, kits, spells, monsters, \ - equipment, encounters, the characters of the modules and the User \ - Database. {items} items in all, with the pictures that came with them.", - addons = 672, - items = thousands(36_525) - )) - .child(&clamp) - .build(); - start.set_paintable( - gdk::Texture::from_bytes(&glib::Bytes::from_static(ICON)) - .ok() - .as_ref(), - ); - start.add_css_class("compact"); - - let spinner = gtk::Spinner::builder() - .spinning(true) - .width_request(32) - .height_request(32) - .halign(gtk::Align::Center) - .build(); - let progress = adw::StatusPage::builder() - .title(tr("Installing the Add-ons")) - .child(&spinner) - .build(); - - let open_log = gtk::Button::builder().label(tr("Open the Log")).build(); - let done_app = gtk::Button::builder() - .label(tr("Open Core Rules")) - .css_classes(["suggested-action"]) - .build(); - let buttons = gtk::Box::builder() - .spacing(12) - .halign(gtk::Align::Center) - .css_classes(["pill"]) - .build(); - buttons.append(&open_log); - buttons.append(&done_app); - let done = adw::StatusPage::builder() - .icon_name("emblem-ok-symbolic") - .title(tr("Add-ons Installed")) - .child(&buttons) - .build(); - - let stack = gtk::Stack::builder() - .transition_type(gtk::StackTransitionType::Crossfade) - .build(); - stack.add_named(&start, Some("start")); - stack.add_named(&progress, Some("progress")); - stack.add_named(&done, Some("done")); - let view = adw::ToolbarView::new(); - view.add_top_bar(&adw::HeaderBar::builder().show_title(false).build()); - view.set_content(Some(&stack)); - window.set_content(Some(&view)); - - let this = Self { - window, - stack, - group, - rows: Rc::default(), - notice, - install_button, - start_app, - progress, - done, - done_app, - log: Rc::default(), - apps: Rc::default(), - chosen: Rc::default(), - targets: Rc::default(), - }; - rescan.connect_clicked({ - let this = this.clone(); - move |_| { - this.chosen.replace(None); - this.scan(); - } - }); - other.connect_clicked({ - let this = this.clone(); - move |_| this.choose_folder() - }); - this.install_button.connect_clicked({ - let this = this.clone(); - move |_| this.confirm_and_install() - }); - for button in [&this.start_app, &this.done_app] { - button.connect_clicked({ - let this = this.clone(); - move |_| this.launch_app() - }); - } - open_log.connect_clicked({ - let this = this.clone(); - move |_| { - if let Some(log) = this.log.borrow().as_ref() { - gtk::FileLauncher::new(Some(&gio::File::for_path(log))).launch( - Some(&this.window), - gio::Cancellable::NONE, - |_| {}, - ); - } - } - }); - this.scan(); - this - } - - /// Looks for the app again and shows what it found. - fn scan(&self) { - self.apps.replace(locate::apps(&Places::here())); - self.show(); - } - - fn show(&self) { - for row in self.rows.borrow_mut().drain(..) { - self.group.remove(&row); - } - let apps = self.apps.borrow(); - let mut rows = Vec::new(); - let mut targets: Vec = Vec::new(); - let add_row = |rows: &mut Vec, title: &str, subtitle: &str| { - let row = adw::ActionRow::builder() - .title(glib::markup_escape_text(title)) - .subtitle(glib::markup_escape_text(subtitle)) - .subtitle_selectable(true) - .build(); - self.group.add(&row); - rows.push(row); - }; - // A folder the app reads, as the add-ons see it. - let describe = |dir: &Path, wine: bool| -> (bool, String) { - let place = home_relative(dir); - match install::check(dir) { - Folder::Ready { again, .. } => { - let text = match (wine, again) { - (false, false) => tr!("Data in {place}", place), - (false, true) => tr!( - "Data in {place}. The add-ons were installed here before.", - place - ), - (true, false) => { - tr!("Data of the original program in Wine: {place}", place) - } - (true, true) => tr!( - "Data of the original program in Wine: {place}. The add-ons were \ - installed here before.", - place - ), - }; - (true, text) - } - Folder::Core20 => ( - false, - tr!( - "{place} has Core Rules 2.0; the add-ons are for the Expansion.", - place - ), - ), - Folder::NotAnInstallation => ( - false, - tr("No game data yet: open it and use Extract Data from CD… in the menu.") - .to_string(), - ), - } - }; - if let Some(dir) = self.chosen.borrow().as_ref() { - let (ready, text) = describe(dir, dir.to_string_lossy().contains("/drive_c/")); - add_row(&mut rows, tr("Chosen Folder"), &text); - if ready { - targets.push(dir.clone()); - } - } else { - for app in apps.iter() { - let (ready, mut text) = describe(&app.data, app.wine); - if !app.reads_addons() { - text.push(' '); - text.push_str(tr( - "Update the app to version 0.7.2 or newer to see all the add-ons.", - )); - } - add_row(&mut rows, &app.label(), &text); - if ready && !targets.contains(&app.data) { - targets.push(app.data.clone()); - } - } - // Data the app would open even when no copy of it was found - // (built from source, say). - if apps.is_empty() - && let Some(install) = Installation::discover() - { - let dir = install.root().to_path_buf(); - let (ready, text) = describe(&dir, dir.to_string_lossy().contains("/drive_c/")); - add_row(&mut rows, tr("Core Rules Data"), &text); - if ready { - targets.push(dir); - } - } - } - if rows.is_empty() { - add_row( - &mut rows, - tr("No Core Rules Found"), - tr( - "I looked for the Flatpak, the .deb and .rpm packages and AppImages in the \ - usual folders (Downloads, Applications, Desktop and the home folder).", - ), - ); - } - self.rows.replace(rows); - - let text = if !targets.is_empty() { - trn!( - "The add-ons will be installed in the data folder above. First the installer \ - keeps a copy of UserDbas and Chars beside it. A record of yours with the same \ - name as an add-on is replaced by the add-on.", - "The add-ons will be installed in the {n} data folders above. First the \ - installer keeps a copy of UserDbas and Chars beside each one. A record of \ - yours with the same name as an add-on is replaced by the add-on.", - targets.len() as u64 - ) - } else if apps.is_empty() && self.chosen.borrow().is_none() { - tr( - "Install Core Rules 0.7.2 or newer from the project's releases page, open it \ - and use Extract Data from CD… in the menu; then search again here.", - ) - .to_string() - } else { - tr( - "Open Core Rules and use Extract Data from CD… in the menu to create the data \ - folder; then search again here.", - ) - .to_string() - }; - self.notice.set_label(&text); - self.install_button.set_sensitive(!targets.is_empty()); - self.start_app - .set_visible(targets.is_empty() && !apps.is_empty()); - self.done_app.set_visible(!apps.is_empty()); - self.targets.replace(targets); - } - - fn choose_folder(&self) { - let dialog = gtk::FileDialog::builder() - .title(tr("Core Rules Data Folder")) - .modal(true) - .build(); - if let Some(dir) = self.targets.borrow().first() { - dialog.set_initial_folder(Some(&gio::File::for_path(dir))); - } - let this = self.clone(); - glib::spawn_future_local(async move { - if let Ok(file) = dialog.select_folder_future(Some(&this.window)).await - && let Some(path) = file.path() - { - this.chosen.replace(Some(path)); - this.show(); - } - }); - } - - /// Starts the copy of the app that reads the first folder installed - /// into, else the first one found. - fn launch_app(&self) { - let apps = self.apps.borrow(); - let targets = self.targets.borrow(); - let app = apps - .iter() - .find(|a| targets.first() == Some(&a.data)) - .or_else(|| apps.first()); - if let Some(app) = app - && let Err(e) = app.launch() - { - let dialog = - adw::AlertDialog::new(Some(tr("Could not open Core Rules")), Some(&e.to_string())); - dialog.add_response("close", tr("Close")); - dialog.present(Some(&self.window)); - } - } - - fn confirm_and_install(&self) { - let mut installs = Vec::new(); - let mut wine = false; - for dir in self.targets.borrow().iter() { - if let Folder::Ready { - install, wine: w, .. - } = install::check(dir) - { - wine |= w; - installs.push(install); - } - } - if installs.is_empty() { - return; - } - let this = self.clone(); - glib::spawn_future_local(async move { - if wine { - let dialog = adw::AlertDialog::new( - Some(tr("Install into the Original Program?")), - Some(tr( - "One of the folders is the original program's installation \ - inside Wine. The add-ons work there too, but the original's Import \ - takes about 35 minutes to read the same package.", - )), - ); - dialog.add_responses(&[("cancel", tr("Cancel")), ("install", tr("Install"))]); - dialog.set_response_appearance("install", adw::ResponseAppearance::Suggested); - if dialog.choose_future(&this.window).await != "install" { - return; - } - } - this.run(installs).await; - }); - } - - async fn run(&self, installs: Vec) { - self.stack.set_visible_child_name("progress"); - self.window.set_deletable(false); - let stamp = glib::DateTime::now_local() - .and_then(|t| t.format("%Y%m%d-%H%M%S")) - .map_or_else(|_| "addons".into(), |s| s.to_string()); - - let mut done = Vec::new(); - let mut failure = None; - for install in installs { - let place = home_relative(install.root()); - self.progress - .set_description(Some(&glib::markup_escape_text(&tr!( - "Keeping a copy of UserDbas and Chars from {place}…", - place - )))); - let result = async { - let (install, backup) = { - let stamp = stamp.clone(); - gio::spawn_blocking(move || { - let backup = install::backup(&install, &stamp); - (install, backup) - }) - .await - .map_err(|_| tr("The backup failed.").to_string())? - }; - let backup = backup?; - self.progress - .set_description(Some(&glib::markup_escape_text(&tr!( - "Importing the add-ons into {place}. This takes less than a minute.", - place - )))); - let stamp = stamp.clone(); - let outcome = gio::spawn_blocking(move || { - let file = install::package()?; - let mut outcome = install::import(&install, &file, &stamp)?; - install::pictures(&install, &mut outcome)?; - Ok::<_, String>(outcome) - }) - .await - .map_err(|_| tr("The import stopped with an unexpected error.").to_string())??; - Ok::<_, String>((place.clone(), backup, outcome)) - } - .await; - match result { - Ok(d) => done.push(d), - Err(message) => { - failure = Some(format!("{place}: {message}")); - break; - } - } - } - self.window.set_deletable(true); - - if let Some(message) = failure { - self.stack.set_visible_child_name("start"); - let dialog = - adw::AlertDialog::new(Some(tr("The Add-ons Were Not Installed")), Some(&message)); - dialog.add_response("close", tr("Close")); - dialog.present(Some(&self.window)); - self.scan(); - return; - } - let mut text = String::new(); - for (place, backup, outcome) in &done { - let items = thousands(outcome.imported); - let backup = home_relative(backup); - text.push_str(&match outcome.characters { - 0 => tr!( - "{items} items imported into {place}. The backup is in {backup}.", - items, - place, - backup - ), - n => trn!( - "{items} items imported into {place}, {n} of them a character. The backup \ - is in {backup}.", - "{items} items imported into {place}, {n} of them characters. The backup \ - is in {backup}.", - n as u64, - items, - place, - backup - ), - }); - if outcome.pictures > 0 { - text.push(' '); - text.push_str(&trn!( - "{n} picture of the add-ons was copied there.", - "{n} pictures of the add-ons were copied there.", - outcome.pictures as u64 - )); - } - text.push_str("\n\n"); - } - text.push_str(tr( - "If Core Rules is open, close it and open it again to see the add-ons.", - )); - self.done - .set_description(Some(&glib::markup_escape_text(&text))); - self.log - .replace(done.last().map(|(_, _, outcome)| outcome.log.clone())); - self.stack.set_visible_child_name("done"); - } -} - -/// `/home/ana/.local/share/corerules/data` → `~/.local/share/corerules/data`. -fn home_relative(path: &Path) -> String { - match std::env::var_os("HOME").map(PathBuf::from) { - Some(home) if path.starts_with(&home) && home != Path::new("/") => { - format!("~/{}", path.strip_prefix(&home).unwrap_or(path).display()) - } - _ => path.display().to_string(), - } -} - -/// Picks the language before any text is shown: the one chosen in the -/// app's Preferences (of the native app, else of the Flatpak), else the -/// system's. A chosen language is passed to GTK too, for its own dialogs. -fn apply_language() { - let home = std::env::var_os("HOME").map(PathBuf::from); - let files = [ - Some(glib::user_config_dir()), - home.map(|h| h.join(".var/app/io.github.brahm.CoreRules/config")), - ]; - let chosen = files.into_iter().flatten().find_map(|dir| { - let file = glib::KeyFile::new(); - file.load_from_file(dir.join("corerules/settings.ini"), glib::KeyFileFlags::NONE) - .ok()?; - Language::from_code(&file.string("interface", "language").ok()?) - }); - let language = match chosen { - Some(language) => { - // SAFETY: called first thing in main, before any thread starts. - unsafe { std::env::set_var("LANGUAGE", language.code()) }; - language - } - None => cr_i18n::system_language(), - }; - cr_i18n::set_language(language); -} - -/// 36716 → "36,716" in English, "36.716" in Portuguese. -fn thousands(n: usize) -> String { - group_digits(n, cr_i18n::language()) -} - -fn group_digits(n: usize, language: Language) -> String { - let separator = match language { - Language::English => ',', - Language::French => '\u{202f}', - _ => '.', - }; - let digits = n.to_string(); - let mut out = String::new(); - for (i, c) in digits.chars().enumerate() { - if i > 0 && (digits.len() - i).is_multiple_of(3) { - out.push(separator); - } - out.push(c); - } - out -} - -#[cfg(test)] -mod tests { - use super::group_digits; - use cr_i18n::Language; - - #[test] - fn thousands_are_grouped_as_each_language_writes_them() { - assert_eq!(group_digits(36_716, Language::PortugueseBrazil), "36.716"); - assert_eq!(group_digits(36_716, Language::English), "36,716"); - assert_eq!(group_digits(36_716, Language::French), "36\u{202f}716"); - assert_eq!(group_digits(105, Language::German), "105"); - assert_eq!(group_digits(1_000_000, Language::Spanish), "1.000.000"); - } -} diff --git a/crates/cr-i18n/po/corerules.pot b/crates/cr-i18n/po/corerules.pot index 5134ab4..2387b1e 100644 --- a/crates/cr-i18n/po/corerules.pot +++ b/crates/cr-i18n/po/corerules.pot @@ -9,281 +9,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: crates/cr-addons/src/details.rs:25 -#: crates/cr-addons/src/details.rs:27 -#: crates/cr-addons/src/details.rs:45 -#: crates/cr-addons/src/details.rs:171 -msgid "Add-on Details" -msgstr "" - -#: crates/cr-addons/src/details.rs:36 -#: crates/cr-addons/src/extras.rs:83 -msgid "The built-in pictures are damaged." -msgstr "" - -#: crates/cr-addons/src/details.rs:42 -msgid "The Details Could Not Be Read" -msgstr "" - -#: crates/cr-addons/src/details.rs:98 -msgid "{count} item" -msgid_plural "{count} items" -msgstr[0] "" -msgstr[1] "" - -#: crates/cr-addons/src/details.rs:105 -msgid "{n} text" -msgid_plural "{n} texts" -msgstr[0] "" -msgstr[1] "" - -#: crates/cr-addons/src/details.rs:130 -msgid "Search the add-ons" -msgstr "" - -#: crates/cr-addons/src/details.rs:149 -msgid "Each add-on folder of the community's archive, what its packages brought into the collection and the texts its authors wrote. Most texts are in English." -msgstr "" - -#: crates/cr-addons/src/details.rs:186 -msgid "Texts" -msgstr "" - -#: crates/cr-addons/src/details.rs:207 -msgid "{count} item, all in the collection" -msgid_plural "{count} items, all in the collection" -msgstr[0] "" -msgstr[1] "" - -#: crates/cr-addons/src/details.rs:213 -msgid "{n} item, which a newer add-on replaced" -msgid_plural "{n} items, which newer add-ons replaced" -msgstr[0] "" -msgstr[1] "" - -#: crates/cr-addons/src/details.rs:218 -msgid "{n} item; {kept} are in the collection as written here" -msgid_plural "{n} items; {kept} are in the collection as written here" -msgstr[0] "" -msgstr[1] "" - -#: crates/cr-addons/src/details.rs:242 -msgid "and {n} more" -msgid_plural "and {n} more" -msgstr[0] "" -msgstr[1] "" - -#: crates/cr-addons/src/extras.rs:82 -msgid "The built-in pictures are damaged: {e}" -msgstr "" - -#: crates/cr-addons/src/extras.rs:208 -#: crates/cr-addons/src/install.rs:101 -#: crates/cr-addons/src/install.rs:125 -#: crates/cr-addons/src/install.rs:132 -#: crates/cr-app/src/addons.rs:626 -msgid "Could not write {file}: {e}" -msgstr "" - -#: crates/cr-addons/src/install.rs:57 -msgid "The built-in add-ons are damaged: {e}" -msgstr "" - -#: crates/cr-addons/src/install.rs:58 -msgid "Could not read the built-in add-ons: {e}" -msgstr "" - -#: crates/cr-addons/src/install.rs:69 -#: crates/cr-app/src/addons.rs:815 -msgid "Could not copy {folder}: {e}" -msgstr "" - -#: crates/cr-addons/src/install.rs:94 -msgid "The import failed: {e}" -msgstr "" - -#: crates/cr-addons/src/locate.rs:45 -msgid ".deb package" -msgstr "" - -#: crates/cr-addons/src/locate.rs:46 -msgid ".rpm package" -msgstr "" - -#: crates/cr-addons/src/locate.rs:49 -msgid "AppImage in {folder}" -msgstr "" - -#: crates/cr-addons/src/main.rs:63 -#: crates/cr-addons/src/main.rs:125 -msgid "Core Rules Community Add-ons Collection" -msgstr "" - -#: crates/cr-addons/src/main.rs:71 -msgid "Core Rules on This Computer" -msgstr "" - -#: crates/cr-addons/src/main.rs:75 -msgid "Search Again" -msgstr "" - -#: crates/cr-addons/src/main.rs:86 -#: crates/cr-addons/src/main.rs:434 -msgid "Install" -msgstr "" - -#: crates/cr-addons/src/main.rs:90 -#: crates/cr-addons/src/main.rs:156 -msgid "Open Core Rules" -msgstr "" - -#: crates/cr-addons/src/main.rs:100 -msgid "Other Folder…" -msgstr "" - -#: crates/cr-addons/src/main.rs:104 -msgid "Add-on Details…" -msgstr "" - -#: crates/cr-addons/src/main.rs:126 -msgid "The {addons} add-ons the community made for AD&D Core Rules 2.0 and the Expansion, in one package: races, classes, kits, spells, monsters, equipment, encounters, the characters of the modules and the User Database. {items} items in all, with the pictures that came with them." -msgstr "" - -#: crates/cr-addons/src/main.rs:150 -msgid "Installing the Add-ons" -msgstr "" - -#: crates/cr-addons/src/main.rs:154 -msgid "Open the Log" -msgstr "" - -#: crates/cr-addons/src/main.rs:168 -msgid "Add-ons Installed" -msgstr "" - -#: crates/cr-addons/src/main.rs:264 -msgid "Data in {place}" -msgstr "" - -#: crates/cr-addons/src/main.rs:265 -msgid "Data in {place}. The add-ons were installed here before." -msgstr "" - -#: crates/cr-addons/src/main.rs:270 -msgid "Data of the original program in Wine: {place}" -msgstr "" - -#: crates/cr-addons/src/main.rs:272 -msgid "Data of the original program in Wine: {place}. The add-ons were installed here before." -msgstr "" - -#: crates/cr-addons/src/main.rs:282 -msgid "{place} has Core Rules 2.0; the add-ons are for the Expansion." -msgstr "" - -#: crates/cr-addons/src/main.rs:289 -msgid "No game data yet: open it and use Extract Data from CD… in the menu." -msgstr "" - -#: crates/cr-addons/src/main.rs:296 -msgid "Chosen Folder" -msgstr "" - -#: crates/cr-addons/src/main.rs:305 -msgid "Update the app to version 0.7.2 or newer to see all the add-ons." -msgstr "" - -#: crates/cr-addons/src/main.rs:321 -msgid "Core Rules Data" -msgstr "" - -#: crates/cr-addons/src/main.rs:330 -msgid "No Core Rules Found" -msgstr "" - -#: crates/cr-addons/src/main.rs:331 -msgid "I looked for the Flatpak, the .deb and .rpm packages and AppImages in the usual folders (Downloads, Applications, Desktop and the home folder)." -msgstr "" - -#: crates/cr-addons/src/main.rs:340 -msgid "The add-ons will be installed in the data folder above. First the installer keeps a copy of UserDbas and Chars beside it. A record of yours with the same name as an add-on is replaced by the add-on." -msgid_plural "The add-ons will be installed in the {n} data folders above. First the installer keeps a copy of UserDbas and Chars beside each one. A record of yours with the same name as an add-on is replaced by the add-on." -msgstr[0] "" -msgstr[1] "" - -#: crates/cr-addons/src/main.rs:350 -msgid "Install Core Rules 0.7.2 or newer from the project's releases page, open it and use Extract Data from CD… in the menu; then search again here." -msgstr "" - -#: crates/cr-addons/src/main.rs:356 -msgid "Open Core Rules and use Extract Data from CD… in the menu to create the data folder; then search again here." -msgstr "" - -#: crates/cr-addons/src/main.rs:372 -msgid "Core Rules Data Folder" -msgstr "" - -#: crates/cr-addons/src/main.rs:402 -msgid "Could not open Core Rules" -msgstr "" - -#: crates/cr-addons/src/main.rs:403 -#: crates/cr-addons/src/main.rs:502 -msgid "Close" -msgstr "" - -#: crates/cr-addons/src/main.rs:427 -msgid "Install into the Original Program?" -msgstr "" - -#: crates/cr-addons/src/main.rs:428 -msgid "One of the folders is the original program's installation inside Wine. The add-ons work there too, but the original's Import takes about 35 minutes to read the same package." -msgstr "" - -#: crates/cr-addons/src/main.rs:434 -msgid "Cancel" -msgstr "" - -#: crates/cr-addons/src/main.rs:456 -msgid "Keeping a copy of UserDbas and Chars from {place}…" -msgstr "" - -#: crates/cr-addons/src/main.rs:468 -msgid "The backup failed." -msgstr "" - -#: crates/cr-addons/src/main.rs:472 -msgid "Importing the add-ons into {place}. This takes less than a minute." -msgstr "" - -#: crates/cr-addons/src/main.rs:484 -msgid "The import stopped with an unexpected error." -msgstr "" - -#: crates/cr-addons/src/main.rs:501 -msgid "The Add-ons Were Not Installed" -msgstr "" - -#: crates/cr-addons/src/main.rs:512 -msgid "{items} items imported into {place}. The backup is in {backup}." -msgstr "" - -#: crates/cr-addons/src/main.rs:518 -msgid "{items} items imported into {place}, {n} of them a character. The backup is in {backup}." -msgid_plural "{items} items imported into {place}, {n} of them characters. The backup is in {backup}." -msgstr[0] "" -msgstr[1] "" - -#: crates/cr-addons/src/main.rs:531 -msgid "{n} picture of the add-ons was copied there." -msgid_plural "{n} pictures of the add-ons were copied there." -msgstr[0] "" -msgstr[1] "" - -#: crates/cr-addons/src/main.rs:539 -msgid "If Core Rules is open, close it and open it again to see the add-ons." -msgstr "" - #: crates/cr-app/src/about.rs:31 msgid "Core Rules is a complete Linux version of AD&D Core Rules 2.0 and its Expansion (TSR/Evermore, 1998-1999), the character manager and Dungeon Master's toolkit for Advanced Dungeons & Dragons 2nd Edition. It is written in Rust with GTK 4 and libadwaita and runs natively, with no Wine and no Windows." msgstr "" @@ -390,6 +115,10 @@ msgstr[1] "" msgid "The user databases and the characters are copied to a backup first. The add-ons come in from the oldest file to the newest, and characters already in the list are left out." msgstr "" +#: crates/cr-app/src/addons.rs:626 +msgid "Could not write {file}: {e}" +msgstr "" + #: crates/cr-app/src/addons.rs:685 msgid "{n} item came in." msgid_plural "{n} items came in." @@ -456,6 +185,10 @@ msgid_plural "Imported {n} Add-ons" msgstr[0] "" msgstr[1] "" +#: crates/cr-app/src/addons.rs:815 +msgid "Could not copy {folder}: {e}" +msgstr "" + #: crates/cr-app/src/bundle.rs:60 msgid "{used} of {capacity} pages used" msgstr "" diff --git a/crates/cr-i18n/po/de.po b/crates/cr-i18n/po/de.po index ec49261..6beb56f 100644 --- a/crates/cr-i18n/po/de.po +++ b/crates/cr-i18n/po/de.po @@ -9,281 +9,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: crates/cr-addons/src/details.rs:25 -#: crates/cr-addons/src/details.rs:27 -#: crates/cr-addons/src/details.rs:45 -#: crates/cr-addons/src/details.rs:171 -msgid "Add-on Details" -msgstr "Add-on-Details" - -#: crates/cr-addons/src/details.rs:36 -#: crates/cr-addons/src/extras.rs:83 -msgid "The built-in pictures are damaged." -msgstr "Die eingebauten Bilder sind beschädigt." - -#: crates/cr-addons/src/details.rs:42 -msgid "The Details Could Not Be Read" -msgstr "Die Details konnten nicht gelesen werden" - -#: crates/cr-addons/src/details.rs:98 -msgid "{count} item" -msgid_plural "{count} items" -msgstr[0] "{count} Eintrag" -msgstr[1] "{count} Einträge" - -#: crates/cr-addons/src/details.rs:105 -msgid "{n} text" -msgid_plural "{n} texts" -msgstr[0] "{n} Text" -msgstr[1] "{n} Texte" - -#: crates/cr-addons/src/details.rs:130 -msgid "Search the add-ons" -msgstr "Add-ons durchsuchen" - -#: crates/cr-addons/src/details.rs:149 -msgid "Each add-on folder of the community's archive, what its packages brought into the collection and the texts its authors wrote. Most texts are in English." -msgstr "Jeder Add-on-Ordner aus dem Archiv der Community, was seine Pakete zur Sammlung beigetragen haben und die Texte ihrer Autoren. Die meisten Texte sind auf Englisch." - -#: crates/cr-addons/src/details.rs:186 -msgid "Texts" -msgstr "Texte" - -#: crates/cr-addons/src/details.rs:207 -msgid "{count} item, all in the collection" -msgid_plural "{count} items, all in the collection" -msgstr[0] "{count} Eintrag, in der Sammlung enthalten" -msgstr[1] "{count} Einträge, alle in der Sammlung" - -#: crates/cr-addons/src/details.rs:213 -msgid "{n} item, which a newer add-on replaced" -msgid_plural "{n} items, which newer add-ons replaced" -msgstr[0] "{n} Eintrag, den ein neueres Add-on ersetzt hat" -msgstr[1] "{n} Einträge, die neuere Add-ons ersetzt haben" - -#: crates/cr-addons/src/details.rs:218 -msgid "{n} item; {kept} are in the collection as written here" -msgid_plural "{n} items; {kept} are in the collection as written here" -msgstr[0] "{n} Eintrag; {kept} sind so in der Sammlung, wie sie hier geschrieben wurden" -msgstr[1] "{n} Einträge; {kept} sind so in der Sammlung, wie sie hier geschrieben wurden" - -#: crates/cr-addons/src/details.rs:242 -msgid "and {n} more" -msgid_plural "and {n} more" -msgstr[0] "und {n} weitere" -msgstr[1] "und {n} weitere" - -#: crates/cr-addons/src/extras.rs:82 -msgid "The built-in pictures are damaged: {e}" -msgstr "Die eingebauten Bilder sind beschädigt: {e}" - -#: crates/cr-addons/src/extras.rs:208 -#: crates/cr-addons/src/install.rs:101 -#: crates/cr-addons/src/install.rs:125 -#: crates/cr-addons/src/install.rs:132 -#: crates/cr-app/src/addons.rs:626 -msgid "Could not write {file}: {e}" -msgstr "{file} konnte nicht geschrieben werden: {e}" - -#: crates/cr-addons/src/install.rs:57 -msgid "The built-in add-ons are damaged: {e}" -msgstr "Die eingebauten Add-ons sind beschädigt: {e}" - -#: crates/cr-addons/src/install.rs:58 -msgid "Could not read the built-in add-ons: {e}" -msgstr "Die eingebauten Add-ons konnten nicht gelesen werden: {e}" - -#: crates/cr-addons/src/install.rs:69 -#: crates/cr-app/src/addons.rs:815 -msgid "Could not copy {folder}: {e}" -msgstr "{folder} konnte nicht kopiert werden: {e}" - -#: crates/cr-addons/src/install.rs:94 -msgid "The import failed: {e}" -msgstr "Der Import ist fehlgeschlagen: {e}" - -#: crates/cr-addons/src/locate.rs:45 -msgid ".deb package" -msgstr ".deb-Paket" - -#: crates/cr-addons/src/locate.rs:46 -msgid ".rpm package" -msgstr ".rpm-Paket" - -#: crates/cr-addons/src/locate.rs:49 -msgid "AppImage in {folder}" -msgstr "AppImage in {folder}" - -#: crates/cr-addons/src/main.rs:63 -#: crates/cr-addons/src/main.rs:125 -msgid "Core Rules Community Add-ons Collection" -msgstr "Community-Add-on-Sammlung für Core Rules" - -#: crates/cr-addons/src/main.rs:71 -msgid "Core Rules on This Computer" -msgstr "Core Rules auf diesem Computer" - -#: crates/cr-addons/src/main.rs:75 -msgid "Search Again" -msgstr "Erneut suchen" - -#: crates/cr-addons/src/main.rs:86 -#: crates/cr-addons/src/main.rs:434 -msgid "Install" -msgstr "Installieren" - -#: crates/cr-addons/src/main.rs:90 -#: crates/cr-addons/src/main.rs:156 -msgid "Open Core Rules" -msgstr "Core Rules öffnen" - -#: crates/cr-addons/src/main.rs:100 -msgid "Other Folder…" -msgstr "Anderer Ordner…" - -#: crates/cr-addons/src/main.rs:104 -msgid "Add-on Details…" -msgstr "Add-on-Details…" - -#: crates/cr-addons/src/main.rs:126 -msgid "The {addons} add-ons the community made for AD&D Core Rules 2.0 and the Expansion, in one package: races, classes, kits, spells, monsters, equipment, encounters, the characters of the modules and the User Database. {items} items in all, with the pictures that came with them." -msgstr "Die {addons} Add-ons, die die Community für AD&D Core Rules 2.0 und die Expansion erstellt hat, in einem Paket: Völker, Klassen, Kits, Zauber, Monster, Ausrüstung, Begegnungen, die Charaktere der Module und die User Database. Insgesamt {items} Einträge, mit den Bildern, die dazugehörten." - -#: crates/cr-addons/src/main.rs:150 -msgid "Installing the Add-ons" -msgstr "Add-ons werden installiert" - -#: crates/cr-addons/src/main.rs:154 -msgid "Open the Log" -msgstr "Protokoll öffnen" - -#: crates/cr-addons/src/main.rs:168 -msgid "Add-ons Installed" -msgstr "Add-ons installiert" - -#: crates/cr-addons/src/main.rs:264 -msgid "Data in {place}" -msgstr "Daten in {place}" - -#: crates/cr-addons/src/main.rs:265 -msgid "Data in {place}. The add-ons were installed here before." -msgstr "Daten in {place}. Die Add-ons wurden hier schon installiert." - -#: crates/cr-addons/src/main.rs:270 -msgid "Data of the original program in Wine: {place}" -msgstr "Daten des Originalprogramms in Wine: {place}" - -#: crates/cr-addons/src/main.rs:272 -msgid "Data of the original program in Wine: {place}. The add-ons were installed here before." -msgstr "Daten des Originalprogramms in Wine: {place}. Die Add-ons wurden hier schon installiert." - -#: crates/cr-addons/src/main.rs:282 -msgid "{place} has Core Rules 2.0; the add-ons are for the Expansion." -msgstr "{place} enthält Core Rules 2.0; die Add-ons sind für die Expansion." - -#: crates/cr-addons/src/main.rs:289 -msgid "No game data yet: open it and use Extract Data from CD… in the menu." -msgstr "Noch keine Spieldaten: Öffnen Sie es und wählen Sie Daten von der CD extrahieren… im Menü." - -#: crates/cr-addons/src/main.rs:296 -msgid "Chosen Folder" -msgstr "Gewählter Ordner" - -#: crates/cr-addons/src/main.rs:305 -msgid "Update the app to version 0.7.2 or newer to see all the add-ons." -msgstr "Aktualisieren Sie die App auf Version 0.7.2 oder neuer, um alle Add-ons zu sehen." - -#: crates/cr-addons/src/main.rs:321 -msgid "Core Rules Data" -msgstr "Core-Rules-Daten" - -#: crates/cr-addons/src/main.rs:330 -msgid "No Core Rules Found" -msgstr "Kein Core Rules gefunden" - -#: crates/cr-addons/src/main.rs:331 -msgid "I looked for the Flatpak, the .deb and .rpm packages and AppImages in the usual folders (Downloads, Applications, Desktop and the home folder)." -msgstr "Gesucht wurden das Flatpak, die .deb- und .rpm-Pakete und AppImages in den üblichen Ordnern (Downloads, Anwendungen, Schreibtisch und der persönliche Ordner)." - -#: crates/cr-addons/src/main.rs:340 -msgid "The add-ons will be installed in the data folder above. First the installer keeps a copy of UserDbas and Chars beside it. A record of yours with the same name as an add-on is replaced by the add-on." -msgid_plural "The add-ons will be installed in the {n} data folders above. First the installer keeps a copy of UserDbas and Chars beside each one. A record of yours with the same name as an add-on is replaced by the add-on." -msgstr[0] "Die Add-ons werden in den Datenordner oben installiert. Vorher legt das Installationsprogramm daneben eine Kopie von UserDbas und Chars an. Ein eigener Eintrag mit demselben Namen wie ein Add-on wird durch das Add-on ersetzt." -msgstr[1] "Die Add-ons werden in die {n} Datenordner oben installiert. Vorher legt das Installationsprogramm neben jedem eine Kopie von UserDbas und Chars an. Ein eigener Eintrag mit demselben Namen wie ein Add-on wird durch das Add-on ersetzt." - -#: crates/cr-addons/src/main.rs:350 -msgid "Install Core Rules 0.7.2 or newer from the project's releases page, open it and use Extract Data from CD… in the menu; then search again here." -msgstr "Installieren Sie Core Rules 0.7.2 oder neuer von der Release-Seite des Projekts, öffnen Sie es und wählen Sie Daten von der CD extrahieren… im Menü; suchen Sie dann hier erneut." - -#: crates/cr-addons/src/main.rs:356 -msgid "Open Core Rules and use Extract Data from CD… in the menu to create the data folder; then search again here." -msgstr "Öffnen Sie Core Rules und wählen Sie Daten von der CD extrahieren… im Menü, um den Datenordner anzulegen; suchen Sie dann hier erneut." - -#: crates/cr-addons/src/main.rs:372 -msgid "Core Rules Data Folder" -msgstr "Datenordner von Core Rules" - -#: crates/cr-addons/src/main.rs:402 -msgid "Could not open Core Rules" -msgstr "Core Rules konnte nicht geöffnet werden" - -#: crates/cr-addons/src/main.rs:403 -#: crates/cr-addons/src/main.rs:502 -msgid "Close" -msgstr "Schließen" - -#: crates/cr-addons/src/main.rs:427 -msgid "Install into the Original Program?" -msgstr "In das Originalprogramm installieren?" - -#: crates/cr-addons/src/main.rs:428 -msgid "One of the folders is the original program's installation inside Wine. The add-ons work there too, but the original's Import takes about 35 minutes to read the same package." -msgstr "Einer der Ordner ist die Installation des Originalprogramms in Wine. Die Add-ons funktionieren auch dort, aber der Import des Originals braucht etwa 35 Minuten für dasselbe Paket." - -#: crates/cr-addons/src/main.rs:434 -msgid "Cancel" -msgstr "Abbrechen" - -#: crates/cr-addons/src/main.rs:456 -msgid "Keeping a copy of UserDbas and Chars from {place}…" -msgstr "Eine Kopie von UserDbas und Chars aus {place} wird angelegt…" - -#: crates/cr-addons/src/main.rs:468 -msgid "The backup failed." -msgstr "Die Sicherung ist fehlgeschlagen." - -#: crates/cr-addons/src/main.rs:472 -msgid "Importing the add-ons into {place}. This takes less than a minute." -msgstr "Die Add-ons werden in {place} importiert. Das dauert weniger als eine Minute." - -#: crates/cr-addons/src/main.rs:484 -msgid "The import stopped with an unexpected error." -msgstr "Der Import wurde durch einen unerwarteten Fehler abgebrochen." - -#: crates/cr-addons/src/main.rs:501 -msgid "The Add-ons Were Not Installed" -msgstr "Die Add-ons wurden nicht installiert" - -#: crates/cr-addons/src/main.rs:512 -msgid "{items} items imported into {place}. The backup is in {backup}." -msgstr "{items} Einträge in {place} importiert. Die Sicherung liegt in {backup}." - -#: crates/cr-addons/src/main.rs:518 -msgid "{items} items imported into {place}, {n} of them a character. The backup is in {backup}." -msgid_plural "{items} items imported into {place}, {n} of them characters. The backup is in {backup}." -msgstr[0] "{items} Einträge in {place} importiert, davon {n} Charakter. Die Sicherung liegt in {backup}." -msgstr[1] "{items} Einträge in {place} importiert, davon {n} Charaktere. Die Sicherung liegt in {backup}." - -#: crates/cr-addons/src/main.rs:531 -msgid "{n} picture of the add-ons was copied there." -msgid_plural "{n} pictures of the add-ons were copied there." -msgstr[0] "{n} Bild der Add-ons wurde dorthin kopiert." -msgstr[1] "{n} Bilder der Add-ons wurden dorthin kopiert." - -#: crates/cr-addons/src/main.rs:539 -msgid "If Core Rules is open, close it and open it again to see the add-ons." -msgstr "Wenn Core Rules geöffnet ist, schließen Sie es und öffnen Sie es erneut, um die Add-ons zu sehen." - #: crates/cr-app/src/about.rs:31 msgid "Core Rules is a complete Linux version of AD&D Core Rules 2.0 and its Expansion (TSR/Evermore, 1998-1999), the character manager and Dungeon Master's toolkit for Advanced Dungeons & Dragons 2nd Edition. It is written in Rust with GTK 4 and libadwaita and runs natively, with no Wine and no Windows." msgstr "Core Rules ist eine vollständige Linux-Version von AD&D Core Rules 2.0 und seiner Expansion (TSR/Evermore, 1998–1999), dem Charakterverwalter und Werkzeugkasten für Spielleiter von Advanced Dungeons & Dragons 2. Edition. Es ist in Rust mit GTK 4 und libadwaita geschrieben und läuft nativ, ohne Wine und ohne Windows." @@ -390,6 +115,10 @@ msgstr[1] "{n} weitere Dateien (Texte, Dokumente) bleiben unverändert." msgid "The user databases and the characters are copied to a backup first. The add-ons come in from the oldest file to the newest, and characters already in the list are left out." msgstr "Zuerst werden die Benutzerdatenbanken und die Charaktere in eine Sicherung kopiert. Die Add-ons kommen von der ältesten zur neuesten Datei hinzu, und Charaktere, die schon in der Liste sind, werden ausgelassen." +#: crates/cr-app/src/addons.rs:626 +msgid "Could not write {file}: {e}" +msgstr "{file} konnte nicht geschrieben werden: {e}" + #: crates/cr-app/src/addons.rs:685 msgid "{n} item came in." msgid_plural "{n} items came in." @@ -456,6 +185,10 @@ msgid_plural "Imported {n} Add-ons" msgstr[0] "{n} Add-on importiert" msgstr[1] "{n} Add-ons importiert" +#: crates/cr-app/src/addons.rs:815 +msgid "Could not copy {folder}: {e}" +msgstr "{folder} konnte nicht kopiert werden: {e}" + #: crates/cr-app/src/bundle.rs:60 msgid "{used} of {capacity} pages used" msgstr "{used} von {capacity} Seiten belegt" diff --git a/crates/cr-i18n/po/es.po b/crates/cr-i18n/po/es.po index 2ed5fe0..55c10b4 100644 --- a/crates/cr-i18n/po/es.po +++ b/crates/cr-i18n/po/es.po @@ -9,281 +9,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: crates/cr-addons/src/details.rs:25 -#: crates/cr-addons/src/details.rs:27 -#: crates/cr-addons/src/details.rs:45 -#: crates/cr-addons/src/details.rs:171 -msgid "Add-on Details" -msgstr "Detalles de los add-ons" - -#: crates/cr-addons/src/details.rs:36 -#: crates/cr-addons/src/extras.rs:83 -msgid "The built-in pictures are damaged." -msgstr "Las imágenes incluidas están dañadas." - -#: crates/cr-addons/src/details.rs:42 -msgid "The Details Could Not Be Read" -msgstr "No se pudieron leer los detalles" - -#: crates/cr-addons/src/details.rs:98 -msgid "{count} item" -msgid_plural "{count} items" -msgstr[0] "{count} elemento" -msgstr[1] "{count} elementos" - -#: crates/cr-addons/src/details.rs:105 -msgid "{n} text" -msgid_plural "{n} texts" -msgstr[0] "{n} texto" -msgstr[1] "{n} textos" - -#: crates/cr-addons/src/details.rs:130 -msgid "Search the add-ons" -msgstr "Buscar en los add-ons" - -#: crates/cr-addons/src/details.rs:149 -msgid "Each add-on folder of the community's archive, what its packages brought into the collection and the texts its authors wrote. Most texts are in English." -msgstr "Cada carpeta de add-ons del archivo de la comunidad, lo que sus paquetes aportaron a la colección y los textos que escribieron sus autores. La mayoría de los textos están en inglés." - -#: crates/cr-addons/src/details.rs:186 -msgid "Texts" -msgstr "Textos" - -#: crates/cr-addons/src/details.rs:207 -msgid "{count} item, all in the collection" -msgid_plural "{count} items, all in the collection" -msgstr[0] "{count} elemento, que está en la colección" -msgstr[1] "{count} elementos, todos en la colección" - -#: crates/cr-addons/src/details.rs:213 -msgid "{n} item, which a newer add-on replaced" -msgid_plural "{n} items, which newer add-ons replaced" -msgstr[0] "{n} elemento, que un add-on más reciente reemplazó" -msgstr[1] "{n} elementos, que add-ons más recientes reemplazaron" - -#: crates/cr-addons/src/details.rs:218 -msgid "{n} item; {kept} are in the collection as written here" -msgid_plural "{n} items; {kept} are in the collection as written here" -msgstr[0] "{n} elemento; {kept} están en la colección tal como se escribieron aquí" -msgstr[1] "{n} elementos; {kept} están en la colección tal como se escribieron aquí" - -#: crates/cr-addons/src/details.rs:242 -msgid "and {n} more" -msgid_plural "and {n} more" -msgstr[0] "y {n} más" -msgstr[1] "y {n} más" - -#: crates/cr-addons/src/extras.rs:82 -msgid "The built-in pictures are damaged: {e}" -msgstr "Las imágenes incluidas están dañadas: {e}" - -#: crates/cr-addons/src/extras.rs:208 -#: crates/cr-addons/src/install.rs:101 -#: crates/cr-addons/src/install.rs:125 -#: crates/cr-addons/src/install.rs:132 -#: crates/cr-app/src/addons.rs:626 -msgid "Could not write {file}: {e}" -msgstr "No se pudo escribir {file}: {e}" - -#: crates/cr-addons/src/install.rs:57 -msgid "The built-in add-ons are damaged: {e}" -msgstr "Los add-ons incluidos están dañados: {e}" - -#: crates/cr-addons/src/install.rs:58 -msgid "Could not read the built-in add-ons: {e}" -msgstr "No se pudieron leer los add-ons incluidos: {e}" - -#: crates/cr-addons/src/install.rs:69 -#: crates/cr-app/src/addons.rs:815 -msgid "Could not copy {folder}: {e}" -msgstr "No se pudo copiar {folder}: {e}" - -#: crates/cr-addons/src/install.rs:94 -msgid "The import failed: {e}" -msgstr "La importación falló: {e}" - -#: crates/cr-addons/src/locate.rs:45 -msgid ".deb package" -msgstr "paquete .deb" - -#: crates/cr-addons/src/locate.rs:46 -msgid ".rpm package" -msgstr "paquete .rpm" - -#: crates/cr-addons/src/locate.rs:49 -msgid "AppImage in {folder}" -msgstr "AppImage en {folder}" - -#: crates/cr-addons/src/main.rs:63 -#: crates/cr-addons/src/main.rs:125 -msgid "Core Rules Community Add-ons Collection" -msgstr "Colección de add-ons de la comunidad de Core Rules" - -#: crates/cr-addons/src/main.rs:71 -msgid "Core Rules on This Computer" -msgstr "Core Rules en este equipo" - -#: crates/cr-addons/src/main.rs:75 -msgid "Search Again" -msgstr "Buscar de nuevo" - -#: crates/cr-addons/src/main.rs:86 -#: crates/cr-addons/src/main.rs:434 -msgid "Install" -msgstr "Instalar" - -#: crates/cr-addons/src/main.rs:90 -#: crates/cr-addons/src/main.rs:156 -msgid "Open Core Rules" -msgstr "Abrir Core Rules" - -#: crates/cr-addons/src/main.rs:100 -msgid "Other Folder…" -msgstr "Otra carpeta…" - -#: crates/cr-addons/src/main.rs:104 -msgid "Add-on Details…" -msgstr "Detalles de los add-ons…" - -#: crates/cr-addons/src/main.rs:126 -msgid "The {addons} add-ons the community made for AD&D Core Rules 2.0 and the Expansion, in one package: races, classes, kits, spells, monsters, equipment, encounters, the characters of the modules and the User Database. {items} items in all, with the pictures that came with them." -msgstr "Los {addons} add-ons que la comunidad hizo para AD&D Core Rules 2.0 y la Expansion, en un solo paquete: razas, clases, kits, conjuros, monstruos, equipo, encuentros, los personajes de los módulos y la User Database. {items} elementos en total, con las imágenes que los acompañaban." - -#: crates/cr-addons/src/main.rs:150 -msgid "Installing the Add-ons" -msgstr "Instalando los add-ons" - -#: crates/cr-addons/src/main.rs:154 -msgid "Open the Log" -msgstr "Abrir el registro" - -#: crates/cr-addons/src/main.rs:168 -msgid "Add-ons Installed" -msgstr "Add-ons instalados" - -#: crates/cr-addons/src/main.rs:264 -msgid "Data in {place}" -msgstr "Datos en {place}" - -#: crates/cr-addons/src/main.rs:265 -msgid "Data in {place}. The add-ons were installed here before." -msgstr "Datos en {place}. Los add-ons ya se instalaron aquí." - -#: crates/cr-addons/src/main.rs:270 -msgid "Data of the original program in Wine: {place}" -msgstr "Datos del programa original en Wine: {place}" - -#: crates/cr-addons/src/main.rs:272 -msgid "Data of the original program in Wine: {place}. The add-ons were installed here before." -msgstr "Datos del programa original en Wine: {place}. Los add-ons ya se instalaron aquí." - -#: crates/cr-addons/src/main.rs:282 -msgid "{place} has Core Rules 2.0; the add-ons are for the Expansion." -msgstr "{place} tiene Core Rules 2.0; los add-ons son para la Expansion." - -#: crates/cr-addons/src/main.rs:289 -msgid "No game data yet: open it and use Extract Data from CD… in the menu." -msgstr "Todavía sin los datos del juego: ábralo y use Extraer datos del CD… en el menú." - -#: crates/cr-addons/src/main.rs:296 -msgid "Chosen Folder" -msgstr "Carpeta elegida" - -#: crates/cr-addons/src/main.rs:305 -msgid "Update the app to version 0.7.2 or newer to see all the add-ons." -msgstr "Actualice la aplicación a la versión 0.7.2 o posterior para ver todos los add-ons." - -#: crates/cr-addons/src/main.rs:321 -msgid "Core Rules Data" -msgstr "Datos de Core Rules" - -#: crates/cr-addons/src/main.rs:330 -msgid "No Core Rules Found" -msgstr "No se encontró Core Rules" - -#: crates/cr-addons/src/main.rs:331 -msgid "I looked for the Flatpak, the .deb and .rpm packages and AppImages in the usual folders (Downloads, Applications, Desktop and the home folder)." -msgstr "Busqué el Flatpak, los paquetes .deb y .rpm y las AppImages en las carpetas habituales (Descargas, Aplicaciones, Escritorio y la carpeta personal)." - -#: crates/cr-addons/src/main.rs:340 -msgid "The add-ons will be installed in the data folder above. First the installer keeps a copy of UserDbas and Chars beside it. A record of yours with the same name as an add-on is replaced by the add-on." -msgid_plural "The add-ons will be installed in the {n} data folders above. First the installer keeps a copy of UserDbas and Chars beside each one. A record of yours with the same name as an add-on is replaced by the add-on." -msgstr[0] "Los add-ons se instalarán en la carpeta de datos de arriba. Antes, el instalador guarda una copia de UserDbas y Chars junto a ella. Un registro suyo con el mismo nombre que un add-on se sustituye por el del add-on." -msgstr[1] "Los add-ons se instalarán en las {n} carpetas de datos de arriba. Antes, el instalador guarda una copia de UserDbas y Chars junto a cada una. Un registro suyo con el mismo nombre que un add-on se sustituye por el del add-on." - -#: crates/cr-addons/src/main.rs:350 -msgid "Install Core Rules 0.7.2 or newer from the project's releases page, open it and use Extract Data from CD… in the menu; then search again here." -msgstr "Instale Core Rules 0.7.2 o posterior desde la página de versiones del proyecto, ábralo y use Extraer datos del CD… en el menú; luego busque de nuevo aquí." - -#: crates/cr-addons/src/main.rs:356 -msgid "Open Core Rules and use Extract Data from CD… in the menu to create the data folder; then search again here." -msgstr "Abra Core Rules y use Extraer datos del CD… en el menú para crear la carpeta de datos; luego busque de nuevo aquí." - -#: crates/cr-addons/src/main.rs:372 -msgid "Core Rules Data Folder" -msgstr "Carpeta de datos de Core Rules" - -#: crates/cr-addons/src/main.rs:402 -msgid "Could not open Core Rules" -msgstr "No se pudo abrir Core Rules" - -#: crates/cr-addons/src/main.rs:403 -#: crates/cr-addons/src/main.rs:502 -msgid "Close" -msgstr "Cerrar" - -#: crates/cr-addons/src/main.rs:427 -msgid "Install into the Original Program?" -msgstr "¿Instalar en el programa original?" - -#: crates/cr-addons/src/main.rs:428 -msgid "One of the folders is the original program's installation inside Wine. The add-ons work there too, but the original's Import takes about 35 minutes to read the same package." -msgstr "Una de las carpetas es la instalación del programa original dentro de Wine. Los add-ons también funcionan allí, pero el Import del original tarda unos 35 minutos en leer el mismo paquete." - -#: crates/cr-addons/src/main.rs:434 -msgid "Cancel" -msgstr "Cancelar" - -#: crates/cr-addons/src/main.rs:456 -msgid "Keeping a copy of UserDbas and Chars from {place}…" -msgstr "Guardando una copia de UserDbas y Chars de {place}…" - -#: crates/cr-addons/src/main.rs:468 -msgid "The backup failed." -msgstr "La copia de seguridad falló." - -#: crates/cr-addons/src/main.rs:472 -msgid "Importing the add-ons into {place}. This takes less than a minute." -msgstr "Importando los add-ons en {place}. Tarda menos de un minuto." - -#: crates/cr-addons/src/main.rs:484 -msgid "The import stopped with an unexpected error." -msgstr "La importación se detuvo por un error inesperado." - -#: crates/cr-addons/src/main.rs:501 -msgid "The Add-ons Were Not Installed" -msgstr "Los add-ons no se instalaron" - -#: crates/cr-addons/src/main.rs:512 -msgid "{items} items imported into {place}. The backup is in {backup}." -msgstr "{items} elementos importados en {place}. La copia de seguridad está en {backup}." - -#: crates/cr-addons/src/main.rs:518 -msgid "{items} items imported into {place}, {n} of them a character. The backup is in {backup}." -msgid_plural "{items} items imported into {place}, {n} of them characters. The backup is in {backup}." -msgstr[0] "{items} elementos importados en {place}, {n} de ellos un personaje. La copia de seguridad está en {backup}." -msgstr[1] "{items} elementos importados en {place}, {n} de ellos personajes. La copia de seguridad está en {backup}." - -#: crates/cr-addons/src/main.rs:531 -msgid "{n} picture of the add-ons was copied there." -msgid_plural "{n} pictures of the add-ons were copied there." -msgstr[0] "Se copió allí {n} imagen de los add-ons." -msgstr[1] "Se copiaron allí {n} imágenes de los add-ons." - -#: crates/cr-addons/src/main.rs:539 -msgid "If Core Rules is open, close it and open it again to see the add-ons." -msgstr "Si Core Rules está abierto, ciérrelo y vuelva a abrirlo para ver los add-ons." - #: crates/cr-app/src/about.rs:31 msgid "Core Rules is a complete Linux version of AD&D Core Rules 2.0 and its Expansion (TSR/Evermore, 1998-1999), the character manager and Dungeon Master's toolkit for Advanced Dungeons & Dragons 2nd Edition. It is written in Rust with GTK 4 and libadwaita and runs natively, with no Wine and no Windows." msgstr "Core Rules es una versión completa para Linux de AD&D Core Rules 2.0 y su Expansion (TSR/Evermore, 1998-1999), el gestor de personajes y la caja de herramientas del Dungeon Master para Advanced Dungeons & Dragons 2.ª edición. Está escrito en Rust con GTK 4 y libadwaita y funciona de forma nativa, sin Wine y sin Windows." @@ -390,6 +115,10 @@ msgstr[1] "{n} archivos más (textos, documentos) se dejan como están." msgid "The user databases and the characters are copied to a backup first. The add-ons come in from the oldest file to the newest, and characters already in the list are left out." msgstr "Primero se copian las bases de datos del usuario y los personajes a una copia de seguridad. Los add-ons entran del archivo más antiguo al más reciente, y los personajes que ya están en la lista se omiten." +#: crates/cr-app/src/addons.rs:626 +msgid "Could not write {file}: {e}" +msgstr "No se pudo escribir {file}: {e}" + #: crates/cr-app/src/addons.rs:685 msgid "{n} item came in." msgid_plural "{n} items came in." @@ -456,6 +185,10 @@ msgid_plural "Imported {n} Add-ons" msgstr[0] "{n} add-on importado" msgstr[1] "{n} add-ons importados" +#: crates/cr-app/src/addons.rs:815 +msgid "Could not copy {folder}: {e}" +msgstr "No se pudo copiar {folder}: {e}" + #: crates/cr-app/src/bundle.rs:60 msgid "{used} of {capacity} pages used" msgstr "{used} de {capacity} páginas usadas" diff --git a/crates/cr-i18n/po/fr.po b/crates/cr-i18n/po/fr.po index 70a6e71..d37730e 100644 --- a/crates/cr-i18n/po/fr.po +++ b/crates/cr-i18n/po/fr.po @@ -9,281 +9,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: crates/cr-addons/src/details.rs:25 -#: crates/cr-addons/src/details.rs:27 -#: crates/cr-addons/src/details.rs:45 -#: crates/cr-addons/src/details.rs:171 -msgid "Add-on Details" -msgstr "Détails des add-ons" - -#: crates/cr-addons/src/details.rs:36 -#: crates/cr-addons/src/extras.rs:83 -msgid "The built-in pictures are damaged." -msgstr "Les images intégrées sont endommagées." - -#: crates/cr-addons/src/details.rs:42 -msgid "The Details Could Not Be Read" -msgstr "Impossible de lire les détails" - -#: crates/cr-addons/src/details.rs:98 -msgid "{count} item" -msgid_plural "{count} items" -msgstr[0] "{count} élément" -msgstr[1] "{count} éléments" - -#: crates/cr-addons/src/details.rs:105 -msgid "{n} text" -msgid_plural "{n} texts" -msgstr[0] "{n} texte" -msgstr[1] "{n} textes" - -#: crates/cr-addons/src/details.rs:130 -msgid "Search the add-ons" -msgstr "Rechercher dans les add-ons" - -#: crates/cr-addons/src/details.rs:149 -msgid "Each add-on folder of the community's archive, what its packages brought into the collection and the texts its authors wrote. Most texts are in English." -msgstr "Chaque dossier d’add-ons des archives de la communauté, ce que ses paquets ont apporté à la collection et les textes écrits par leurs auteurs. La plupart des textes sont en anglais." - -#: crates/cr-addons/src/details.rs:186 -msgid "Texts" -msgstr "Textes" - -#: crates/cr-addons/src/details.rs:207 -msgid "{count} item, all in the collection" -msgid_plural "{count} items, all in the collection" -msgstr[0] "{count} élément, présent dans la collection" -msgstr[1] "{count} éléments, tous dans la collection" - -#: crates/cr-addons/src/details.rs:213 -msgid "{n} item, which a newer add-on replaced" -msgid_plural "{n} items, which newer add-ons replaced" -msgstr[0] "{n} élément, remplacé par un add-on plus récent" -msgstr[1] "{n} éléments, remplacés par des add-ons plus récents" - -#: crates/cr-addons/src/details.rs:218 -msgid "{n} item; {kept} are in the collection as written here" -msgid_plural "{n} items; {kept} are in the collection as written here" -msgstr[0] "{n} élément ; {kept} sont dans la collection tels qu’écrits ici" -msgstr[1] "{n} éléments ; {kept} sont dans la collection tels qu’écrits ici" - -#: crates/cr-addons/src/details.rs:242 -msgid "and {n} more" -msgid_plural "and {n} more" -msgstr[0] "et {n} de plus" -msgstr[1] "et {n} de plus" - -#: crates/cr-addons/src/extras.rs:82 -msgid "The built-in pictures are damaged: {e}" -msgstr "Les images intégrées sont endommagées : {e}" - -#: crates/cr-addons/src/extras.rs:208 -#: crates/cr-addons/src/install.rs:101 -#: crates/cr-addons/src/install.rs:125 -#: crates/cr-addons/src/install.rs:132 -#: crates/cr-app/src/addons.rs:626 -msgid "Could not write {file}: {e}" -msgstr "Impossible d’écrire {file} : {e}" - -#: crates/cr-addons/src/install.rs:57 -msgid "The built-in add-ons are damaged: {e}" -msgstr "Les add-ons intégrés sont endommagés : {e}" - -#: crates/cr-addons/src/install.rs:58 -msgid "Could not read the built-in add-ons: {e}" -msgstr "Impossible de lire les add-ons intégrés : {e}" - -#: crates/cr-addons/src/install.rs:69 -#: crates/cr-app/src/addons.rs:815 -msgid "Could not copy {folder}: {e}" -msgstr "Impossible de copier {folder} : {e}" - -#: crates/cr-addons/src/install.rs:94 -msgid "The import failed: {e}" -msgstr "L’importation a échoué : {e}" - -#: crates/cr-addons/src/locate.rs:45 -msgid ".deb package" -msgstr "paquet .deb" - -#: crates/cr-addons/src/locate.rs:46 -msgid ".rpm package" -msgstr "paquet .rpm" - -#: crates/cr-addons/src/locate.rs:49 -msgid "AppImage in {folder}" -msgstr "AppImage dans {folder}" - -#: crates/cr-addons/src/main.rs:63 -#: crates/cr-addons/src/main.rs:125 -msgid "Core Rules Community Add-ons Collection" -msgstr "Collection d’add-ons de la communauté Core Rules" - -#: crates/cr-addons/src/main.rs:71 -msgid "Core Rules on This Computer" -msgstr "Core Rules sur cet ordinateur" - -#: crates/cr-addons/src/main.rs:75 -msgid "Search Again" -msgstr "Chercher à nouveau" - -#: crates/cr-addons/src/main.rs:86 -#: crates/cr-addons/src/main.rs:434 -msgid "Install" -msgstr "Installer" - -#: crates/cr-addons/src/main.rs:90 -#: crates/cr-addons/src/main.rs:156 -msgid "Open Core Rules" -msgstr "Ouvrir Core Rules" - -#: crates/cr-addons/src/main.rs:100 -msgid "Other Folder…" -msgstr "Autre dossier…" - -#: crates/cr-addons/src/main.rs:104 -msgid "Add-on Details…" -msgstr "Détails des add-ons…" - -#: crates/cr-addons/src/main.rs:126 -msgid "The {addons} add-ons the community made for AD&D Core Rules 2.0 and the Expansion, in one package: races, classes, kits, spells, monsters, equipment, encounters, the characters of the modules and the User Database. {items} items in all, with the pictures that came with them." -msgstr "Les {addons} add-ons créés par la communauté pour AD&D Core Rules 2.0 et l’Expansion, en un seul paquet : races, classes, kits, sorts, monstres, équipement, rencontres, les personnages des modules et la User Database. {items} éléments en tout, avec les images qui les accompagnaient." - -#: crates/cr-addons/src/main.rs:150 -msgid "Installing the Add-ons" -msgstr "Installation des add-ons" - -#: crates/cr-addons/src/main.rs:154 -msgid "Open the Log" -msgstr "Ouvrir le journal" - -#: crates/cr-addons/src/main.rs:168 -msgid "Add-ons Installed" -msgstr "Add-ons installés" - -#: crates/cr-addons/src/main.rs:264 -msgid "Data in {place}" -msgstr "Données dans {place}" - -#: crates/cr-addons/src/main.rs:265 -msgid "Data in {place}. The add-ons were installed here before." -msgstr "Données dans {place}. Les add-ons ont déjà été installés ici." - -#: crates/cr-addons/src/main.rs:270 -msgid "Data of the original program in Wine: {place}" -msgstr "Données du programme original dans Wine : {place}" - -#: crates/cr-addons/src/main.rs:272 -msgid "Data of the original program in Wine: {place}. The add-ons were installed here before." -msgstr "Données du programme original dans Wine : {place}. Les add-ons ont déjà été installés ici." - -#: crates/cr-addons/src/main.rs:282 -msgid "{place} has Core Rules 2.0; the add-ons are for the Expansion." -msgstr "{place} contient Core Rules 2.0 ; les add-ons sont pour l’Expansion." - -#: crates/cr-addons/src/main.rs:289 -msgid "No game data yet: open it and use Extract Data from CD… in the menu." -msgstr "Pas encore de données du jeu : ouvrez-le et utilisez Extraire les données du CD… dans le menu." - -#: crates/cr-addons/src/main.rs:296 -msgid "Chosen Folder" -msgstr "Dossier choisi" - -#: crates/cr-addons/src/main.rs:305 -msgid "Update the app to version 0.7.2 or newer to see all the add-ons." -msgstr "Mettez l’application à jour en version 0.7.2 ou plus récente pour voir tous les add-ons." - -#: crates/cr-addons/src/main.rs:321 -msgid "Core Rules Data" -msgstr "Données de Core Rules" - -#: crates/cr-addons/src/main.rs:330 -msgid "No Core Rules Found" -msgstr "Aucun Core Rules trouvé" - -#: crates/cr-addons/src/main.rs:331 -msgid "I looked for the Flatpak, the .deb and .rpm packages and AppImages in the usual folders (Downloads, Applications, Desktop and the home folder)." -msgstr "J’ai cherché le Flatpak, les paquets .deb et .rpm et les AppImages dans les dossiers habituels (Téléchargements, Applications, Bureau et le dossier personnel)." - -#: crates/cr-addons/src/main.rs:340 -msgid "The add-ons will be installed in the data folder above. First the installer keeps a copy of UserDbas and Chars beside it. A record of yours with the same name as an add-on is replaced by the add-on." -msgid_plural "The add-ons will be installed in the {n} data folders above. First the installer keeps a copy of UserDbas and Chars beside each one. A record of yours with the same name as an add-on is replaced by the add-on." -msgstr[0] "Les add-ons seront installés dans le dossier de données ci-dessus. Avant, l’installateur garde une copie de UserDbas et Chars à côté. Un enregistrement à vous portant le même nom qu’un add-on est remplacé par celui de l’add-on." -msgstr[1] "Les add-ons seront installés dans les {n} dossiers de données ci-dessus. Avant, l’installateur garde une copie de UserDbas et Chars à côté de chacun. Un enregistrement à vous portant le même nom qu’un add-on est remplacé par celui de l’add-on." - -#: crates/cr-addons/src/main.rs:350 -msgid "Install Core Rules 0.7.2 or newer from the project's releases page, open it and use Extract Data from CD… in the menu; then search again here." -msgstr "Installez Core Rules 0.7.2 ou plus récent depuis la page des versions du projet, ouvrez-le et utilisez Extraire les données du CD… dans le menu ; puis cherchez à nouveau ici." - -#: crates/cr-addons/src/main.rs:356 -msgid "Open Core Rules and use Extract Data from CD… in the menu to create the data folder; then search again here." -msgstr "Ouvrez Core Rules et utilisez Extraire les données du CD… dans le menu pour créer le dossier de données ; puis cherchez à nouveau ici." - -#: crates/cr-addons/src/main.rs:372 -msgid "Core Rules Data Folder" -msgstr "Dossier de données de Core Rules" - -#: crates/cr-addons/src/main.rs:402 -msgid "Could not open Core Rules" -msgstr "Impossible d’ouvrir Core Rules" - -#: crates/cr-addons/src/main.rs:403 -#: crates/cr-addons/src/main.rs:502 -msgid "Close" -msgstr "Fermer" - -#: crates/cr-addons/src/main.rs:427 -msgid "Install into the Original Program?" -msgstr "Installer dans le programme original ?" - -#: crates/cr-addons/src/main.rs:428 -msgid "One of the folders is the original program's installation inside Wine. The add-ons work there too, but the original's Import takes about 35 minutes to read the same package." -msgstr "L’un des dossiers est l’installation du programme original dans Wine. Les add-ons y fonctionnent aussi, mais l’Import de l’original met environ 35 minutes à lire le même paquet." - -#: crates/cr-addons/src/main.rs:434 -msgid "Cancel" -msgstr "Annuler" - -#: crates/cr-addons/src/main.rs:456 -msgid "Keeping a copy of UserDbas and Chars from {place}…" -msgstr "Copie de sauvegarde de UserDbas et Chars de {place}…" - -#: crates/cr-addons/src/main.rs:468 -msgid "The backup failed." -msgstr "La sauvegarde a échoué." - -#: crates/cr-addons/src/main.rs:472 -msgid "Importing the add-ons into {place}. This takes less than a minute." -msgstr "Importation des add-ons dans {place}. Cela prend moins d’une minute." - -#: crates/cr-addons/src/main.rs:484 -msgid "The import stopped with an unexpected error." -msgstr "L’importation s’est arrêtée sur une erreur inattendue." - -#: crates/cr-addons/src/main.rs:501 -msgid "The Add-ons Were Not Installed" -msgstr "Les add-ons n’ont pas été installés" - -#: crates/cr-addons/src/main.rs:512 -msgid "{items} items imported into {place}. The backup is in {backup}." -msgstr "{items} éléments importés dans {place}. La sauvegarde est dans {backup}." - -#: crates/cr-addons/src/main.rs:518 -msgid "{items} items imported into {place}, {n} of them a character. The backup is in {backup}." -msgid_plural "{items} items imported into {place}, {n} of them characters. The backup is in {backup}." -msgstr[0] "{items} éléments importés dans {place}, dont {n} personnage. La sauvegarde est dans {backup}." -msgstr[1] "{items} éléments importés dans {place}, dont {n} personnages. La sauvegarde est dans {backup}." - -#: crates/cr-addons/src/main.rs:531 -msgid "{n} picture of the add-ons was copied there." -msgid_plural "{n} pictures of the add-ons were copied there." -msgstr[0] "{n} image des add-ons y a été copiée." -msgstr[1] "{n} images des add-ons y ont été copiées." - -#: crates/cr-addons/src/main.rs:539 -msgid "If Core Rules is open, close it and open it again to see the add-ons." -msgstr "Si Core Rules est ouvert, fermez-le et rouvrez-le pour voir les add-ons." - #: crates/cr-app/src/about.rs:31 msgid "Core Rules is a complete Linux version of AD&D Core Rules 2.0 and its Expansion (TSR/Evermore, 1998-1999), the character manager and Dungeon Master's toolkit for Advanced Dungeons & Dragons 2nd Edition. It is written in Rust with GTK 4 and libadwaita and runs natively, with no Wine and no Windows." msgstr "Core Rules est une version complète pour Linux d’AD&D Core Rules 2.0 et de son Expansion (TSR/Evermore, 1998-1999), le gestionnaire de personnages et la boîte à outils du maître du donjon pour Advanced Dungeons & Dragons 2e édition. Il est écrit en Rust avec GTK 4 et libadwaita et fonctionne nativement, sans Wine et sans Windows." @@ -390,6 +115,10 @@ msgstr[1] "{n} autres fichiers (textes, documents) sont laissés tels quels." msgid "The user databases and the characters are copied to a backup first. The add-ons come in from the oldest file to the newest, and characters already in the list are left out." msgstr "Les bases de données utilisateur et les personnages sont d’abord copiés dans une sauvegarde. Les add-ons sont importés du fichier le plus ancien au plus récent, et les personnages déjà dans la liste sont laissés de côté." +#: crates/cr-app/src/addons.rs:626 +msgid "Could not write {file}: {e}" +msgstr "Impossible d’écrire {file} : {e}" + #: crates/cr-app/src/addons.rs:685 msgid "{n} item came in." msgid_plural "{n} items came in." @@ -456,6 +185,10 @@ msgid_plural "Imported {n} Add-ons" msgstr[0] "{n} add-on importé" msgstr[1] "{n} add-ons importés" +#: crates/cr-app/src/addons.rs:815 +msgid "Could not copy {folder}: {e}" +msgstr "Impossible de copier {folder} : {e}" + #: crates/cr-app/src/bundle.rs:60 msgid "{used} of {capacity} pages used" msgstr "{used} pages utilisées sur {capacity}" diff --git a/crates/cr-i18n/po/it.po b/crates/cr-i18n/po/it.po index 699ecdb..9b95039 100644 --- a/crates/cr-i18n/po/it.po +++ b/crates/cr-i18n/po/it.po @@ -9,281 +9,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: crates/cr-addons/src/details.rs:25 -#: crates/cr-addons/src/details.rs:27 -#: crates/cr-addons/src/details.rs:45 -#: crates/cr-addons/src/details.rs:171 -msgid "Add-on Details" -msgstr "Dettagli degli add-on" - -#: crates/cr-addons/src/details.rs:36 -#: crates/cr-addons/src/extras.rs:83 -msgid "The built-in pictures are damaged." -msgstr "Le immagini incluse sono danneggiate." - -#: crates/cr-addons/src/details.rs:42 -msgid "The Details Could Not Be Read" -msgstr "Impossibile leggere i dettagli" - -#: crates/cr-addons/src/details.rs:98 -msgid "{count} item" -msgid_plural "{count} items" -msgstr[0] "{count} elemento" -msgstr[1] "{count} elementi" - -#: crates/cr-addons/src/details.rs:105 -msgid "{n} text" -msgid_plural "{n} texts" -msgstr[0] "{n} testo" -msgstr[1] "{n} testi" - -#: crates/cr-addons/src/details.rs:130 -msgid "Search the add-ons" -msgstr "Cerca negli add-on" - -#: crates/cr-addons/src/details.rs:149 -msgid "Each add-on folder of the community's archive, what its packages brought into the collection and the texts its authors wrote. Most texts are in English." -msgstr "Ogni cartella di add-on dell'archivio della comunità, ciò che i suoi pacchetti hanno portato nella raccolta e i testi scritti dagli autori. La maggior parte dei testi è in inglese." - -#: crates/cr-addons/src/details.rs:186 -msgid "Texts" -msgstr "Testi" - -#: crates/cr-addons/src/details.rs:207 -msgid "{count} item, all in the collection" -msgid_plural "{count} items, all in the collection" -msgstr[0] "{count} elemento, presente nella raccolta" -msgstr[1] "{count} elementi, tutti nella raccolta" - -#: crates/cr-addons/src/details.rs:213 -msgid "{n} item, which a newer add-on replaced" -msgid_plural "{n} items, which newer add-ons replaced" -msgstr[0] "{n} elemento, sostituito da un add-on più recente" -msgstr[1] "{n} elementi, sostituiti da add-on più recenti" - -#: crates/cr-addons/src/details.rs:218 -msgid "{n} item; {kept} are in the collection as written here" -msgid_plural "{n} items; {kept} are in the collection as written here" -msgstr[0] "{n} elemento; {kept} sono nella raccolta come scritti qui" -msgstr[1] "{n} elementi; {kept} sono nella raccolta come scritti qui" - -#: crates/cr-addons/src/details.rs:242 -msgid "and {n} more" -msgid_plural "and {n} more" -msgstr[0] "e altri {n}" -msgstr[1] "e altri {n}" - -#: crates/cr-addons/src/extras.rs:82 -msgid "The built-in pictures are damaged: {e}" -msgstr "Le immagini incluse sono danneggiate: {e}" - -#: crates/cr-addons/src/extras.rs:208 -#: crates/cr-addons/src/install.rs:101 -#: crates/cr-addons/src/install.rs:125 -#: crates/cr-addons/src/install.rs:132 -#: crates/cr-app/src/addons.rs:626 -msgid "Could not write {file}: {e}" -msgstr "Impossibile scrivere {file}: {e}" - -#: crates/cr-addons/src/install.rs:57 -msgid "The built-in add-ons are damaged: {e}" -msgstr "Gli add-on inclusi sono danneggiati: {e}" - -#: crates/cr-addons/src/install.rs:58 -msgid "Could not read the built-in add-ons: {e}" -msgstr "Impossibile leggere gli add-on inclusi: {e}" - -#: crates/cr-addons/src/install.rs:69 -#: crates/cr-app/src/addons.rs:815 -msgid "Could not copy {folder}: {e}" -msgstr "Impossibile copiare {folder}: {e}" - -#: crates/cr-addons/src/install.rs:94 -msgid "The import failed: {e}" -msgstr "L'importazione non è riuscita: {e}" - -#: crates/cr-addons/src/locate.rs:45 -msgid ".deb package" -msgstr "pacchetto .deb" - -#: crates/cr-addons/src/locate.rs:46 -msgid ".rpm package" -msgstr "pacchetto .rpm" - -#: crates/cr-addons/src/locate.rs:49 -msgid "AppImage in {folder}" -msgstr "AppImage in {folder}" - -#: crates/cr-addons/src/main.rs:63 -#: crates/cr-addons/src/main.rs:125 -msgid "Core Rules Community Add-ons Collection" -msgstr "Raccolta di add-on della comunità di Core Rules" - -#: crates/cr-addons/src/main.rs:71 -msgid "Core Rules on This Computer" -msgstr "Core Rules su questo computer" - -#: crates/cr-addons/src/main.rs:75 -msgid "Search Again" -msgstr "Cerca di nuovo" - -#: crates/cr-addons/src/main.rs:86 -#: crates/cr-addons/src/main.rs:434 -msgid "Install" -msgstr "Installa" - -#: crates/cr-addons/src/main.rs:90 -#: crates/cr-addons/src/main.rs:156 -msgid "Open Core Rules" -msgstr "Apri Core Rules" - -#: crates/cr-addons/src/main.rs:100 -msgid "Other Folder…" -msgstr "Altra cartella…" - -#: crates/cr-addons/src/main.rs:104 -msgid "Add-on Details…" -msgstr "Dettagli degli add-on…" - -#: crates/cr-addons/src/main.rs:126 -msgid "The {addons} add-ons the community made for AD&D Core Rules 2.0 and the Expansion, in one package: races, classes, kits, spells, monsters, equipment, encounters, the characters of the modules and the User Database. {items} items in all, with the pictures that came with them." -msgstr "I {addons} add-on creati dalla comunità per AD&D Core Rules 2.0 e l'Expansion, in un unico pacchetto: razze, classi, kit, incantesimi, mostri, equipaggiamento, incontri, i personaggi dei moduli e la User Database. {items} elementi in tutto, con le immagini che li accompagnavano." - -#: crates/cr-addons/src/main.rs:150 -msgid "Installing the Add-ons" -msgstr "Installazione degli add-on" - -#: crates/cr-addons/src/main.rs:154 -msgid "Open the Log" -msgstr "Apri il registro" - -#: crates/cr-addons/src/main.rs:168 -msgid "Add-ons Installed" -msgstr "Add-on installati" - -#: crates/cr-addons/src/main.rs:264 -msgid "Data in {place}" -msgstr "Dati in {place}" - -#: crates/cr-addons/src/main.rs:265 -msgid "Data in {place}. The add-ons were installed here before." -msgstr "Dati in {place}. Gli add-on sono già stati installati qui." - -#: crates/cr-addons/src/main.rs:270 -msgid "Data of the original program in Wine: {place}" -msgstr "Dati del programma originale in Wine: {place}" - -#: crates/cr-addons/src/main.rs:272 -msgid "Data of the original program in Wine: {place}. The add-ons were installed here before." -msgstr "Dati del programma originale in Wine: {place}. Gli add-on sono già stati installati qui." - -#: crates/cr-addons/src/main.rs:282 -msgid "{place} has Core Rules 2.0; the add-ons are for the Expansion." -msgstr "{place} contiene Core Rules 2.0; gli add-on sono per l'Expansion." - -#: crates/cr-addons/src/main.rs:289 -msgid "No game data yet: open it and use Extract Data from CD… in the menu." -msgstr "Ancora senza i dati del gioco: aprilo e usa Estrai dati dal CD… nel menu." - -#: crates/cr-addons/src/main.rs:296 -msgid "Chosen Folder" -msgstr "Cartella scelta" - -#: crates/cr-addons/src/main.rs:305 -msgid "Update the app to version 0.7.2 or newer to see all the add-ons." -msgstr "Aggiorna l'app alla versione 0.7.2 o successiva per vedere tutti gli add-on." - -#: crates/cr-addons/src/main.rs:321 -msgid "Core Rules Data" -msgstr "Dati di Core Rules" - -#: crates/cr-addons/src/main.rs:330 -msgid "No Core Rules Found" -msgstr "Nessun Core Rules trovato" - -#: crates/cr-addons/src/main.rs:331 -msgid "I looked for the Flatpak, the .deb and .rpm packages and AppImages in the usual folders (Downloads, Applications, Desktop and the home folder)." -msgstr "Ho cercato il Flatpak, i pacchetti .deb e .rpm e le AppImage nelle cartelle consuete (Scaricati, Applicazioni, Scrivania e la cartella home)." - -#: crates/cr-addons/src/main.rs:340 -msgid "The add-ons will be installed in the data folder above. First the installer keeps a copy of UserDbas and Chars beside it. A record of yours with the same name as an add-on is replaced by the add-on." -msgid_plural "The add-ons will be installed in the {n} data folders above. First the installer keeps a copy of UserDbas and Chars beside each one. A record of yours with the same name as an add-on is replaced by the add-on." -msgstr[0] "Gli add-on verranno installati nella cartella dei dati qui sopra. Prima l'installatore salva una copia di UserDbas e Chars accanto a essa. Un tuo record con lo stesso nome di un add-on viene sostituito da quello dell'add-on." -msgstr[1] "Gli add-on verranno installati nelle {n} cartelle dei dati qui sopra. Prima l'installatore salva una copia di UserDbas e Chars accanto a ciascuna. Un tuo record con lo stesso nome di un add-on viene sostituito da quello dell'add-on." - -#: crates/cr-addons/src/main.rs:350 -msgid "Install Core Rules 0.7.2 or newer from the project's releases page, open it and use Extract Data from CD… in the menu; then search again here." -msgstr "Installa Core Rules 0.7.2 o successivo dalla pagina delle release del progetto, aprilo e usa Estrai dati dal CD… nel menu; poi cerca di nuovo qui." - -#: crates/cr-addons/src/main.rs:356 -msgid "Open Core Rules and use Extract Data from CD… in the menu to create the data folder; then search again here." -msgstr "Apri Core Rules e usa Estrai dati dal CD… nel menu per creare la cartella dei dati; poi cerca di nuovo qui." - -#: crates/cr-addons/src/main.rs:372 -msgid "Core Rules Data Folder" -msgstr "Cartella dei dati di Core Rules" - -#: crates/cr-addons/src/main.rs:402 -msgid "Could not open Core Rules" -msgstr "Impossibile aprire Core Rules" - -#: crates/cr-addons/src/main.rs:403 -#: crates/cr-addons/src/main.rs:502 -msgid "Close" -msgstr "Chiudi" - -#: crates/cr-addons/src/main.rs:427 -msgid "Install into the Original Program?" -msgstr "Installare nel programma originale?" - -#: crates/cr-addons/src/main.rs:428 -msgid "One of the folders is the original program's installation inside Wine. The add-ons work there too, but the original's Import takes about 35 minutes to read the same package." -msgstr "Una delle cartelle è l'installazione del programma originale dentro Wine. Gli add-on funzionano anche lì, ma l'Import dell'originale impiega circa 35 minuti a leggere lo stesso pacchetto." - -#: crates/cr-addons/src/main.rs:434 -msgid "Cancel" -msgstr "Annulla" - -#: crates/cr-addons/src/main.rs:456 -msgid "Keeping a copy of UserDbas and Chars from {place}…" -msgstr "Salvataggio di una copia di UserDbas e Chars da {place}…" - -#: crates/cr-addons/src/main.rs:468 -msgid "The backup failed." -msgstr "Il backup non è riuscito." - -#: crates/cr-addons/src/main.rs:472 -msgid "Importing the add-ons into {place}. This takes less than a minute." -msgstr "Importazione degli add-on in {place}. Ci vuole meno di un minuto." - -#: crates/cr-addons/src/main.rs:484 -msgid "The import stopped with an unexpected error." -msgstr "L'importazione si è interrotta per un errore imprevisto." - -#: crates/cr-addons/src/main.rs:501 -msgid "The Add-ons Were Not Installed" -msgstr "Gli add-on non sono stati installati" - -#: crates/cr-addons/src/main.rs:512 -msgid "{items} items imported into {place}. The backup is in {backup}." -msgstr "{items} elementi importati in {place}. Il backup è in {backup}." - -#: crates/cr-addons/src/main.rs:518 -msgid "{items} items imported into {place}, {n} of them a character. The backup is in {backup}." -msgid_plural "{items} items imported into {place}, {n} of them characters. The backup is in {backup}." -msgstr[0] "{items} elementi importati in {place}, di cui {n} personaggio. Il backup è in {backup}." -msgstr[1] "{items} elementi importati in {place}, di cui {n} personaggi. Il backup è in {backup}." - -#: crates/cr-addons/src/main.rs:531 -msgid "{n} picture of the add-ons was copied there." -msgid_plural "{n} pictures of the add-ons were copied there." -msgstr[0] "Vi è stata copiata {n} immagine degli add-on." -msgstr[1] "Vi sono state copiate {n} immagini degli add-on." - -#: crates/cr-addons/src/main.rs:539 -msgid "If Core Rules is open, close it and open it again to see the add-ons." -msgstr "Se Core Rules è aperto, chiudilo e riaprilo per vedere gli add-on." - #: crates/cr-app/src/about.rs:31 msgid "Core Rules is a complete Linux version of AD&D Core Rules 2.0 and its Expansion (TSR/Evermore, 1998-1999), the character manager and Dungeon Master's toolkit for Advanced Dungeons & Dragons 2nd Edition. It is written in Rust with GTK 4 and libadwaita and runs natively, with no Wine and no Windows." msgstr "Core Rules è una versione completa per Linux di AD&D Core Rules 2.0 e della sua Expansion (TSR/Evermore, 1998-1999), il gestore di personaggi e kit di strumenti del Dungeon Master per Advanced Dungeons & Dragons 2ª edizione. È scritto in Rust con GTK 4 e libadwaita e funziona in modo nativo, senza Wine e senza Windows." @@ -390,6 +115,10 @@ msgstr[1] "{n} altri file (testi, documenti) restano come sono." msgid "The user databases and the characters are copied to a backup first. The add-ons come in from the oldest file to the newest, and characters already in the list are left out." msgstr "Prima i database utente e i personaggi vengono copiati in un backup. Gli add-on entrano dal file più vecchio al più recente, e i personaggi già nell’elenco vengono saltati." +#: crates/cr-app/src/addons.rs:626 +msgid "Could not write {file}: {e}" +msgstr "Impossibile scrivere {file}: {e}" + #: crates/cr-app/src/addons.rs:685 msgid "{n} item came in." msgid_plural "{n} items came in." @@ -456,6 +185,10 @@ msgid_plural "Imported {n} Add-ons" msgstr[0] "{n} add-on importato" msgstr[1] "{n} add-on importati" +#: crates/cr-app/src/addons.rs:815 +msgid "Could not copy {folder}: {e}" +msgstr "Impossibile copiare {folder}: {e}" + #: crates/cr-app/src/bundle.rs:60 msgid "{used} of {capacity} pages used" msgstr "{used} di {capacity} pagine usate" diff --git a/crates/cr-i18n/po/pt_BR.po b/crates/cr-i18n/po/pt_BR.po index 02ff3f3..c406be8 100644 --- a/crates/cr-i18n/po/pt_BR.po +++ b/crates/cr-i18n/po/pt_BR.po @@ -9,281 +9,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: crates/cr-addons/src/details.rs:25 -#: crates/cr-addons/src/details.rs:27 -#: crates/cr-addons/src/details.rs:45 -#: crates/cr-addons/src/details.rs:171 -msgid "Add-on Details" -msgstr "Detalhes dos addons" - -#: crates/cr-addons/src/details.rs:36 -#: crates/cr-addons/src/extras.rs:83 -msgid "The built-in pictures are damaged." -msgstr "As imagens embutidas estão danificadas." - -#: crates/cr-addons/src/details.rs:42 -msgid "The Details Could Not Be Read" -msgstr "Não foi possível ler os detalhes" - -#: crates/cr-addons/src/details.rs:98 -msgid "{count} item" -msgid_plural "{count} items" -msgstr[0] "{count} item" -msgstr[1] "{count} itens" - -#: crates/cr-addons/src/details.rs:105 -msgid "{n} text" -msgid_plural "{n} texts" -msgstr[0] "{n} texto" -msgstr[1] "{n} textos" - -#: crates/cr-addons/src/details.rs:130 -msgid "Search the add-ons" -msgstr "Buscar nos addons" - -#: crates/cr-addons/src/details.rs:149 -msgid "Each add-on folder of the community's archive, what its packages brought into the collection and the texts its authors wrote. Most texts are in English." -msgstr "Cada pasta de addons do acervo da comunidade, o que os pacotes dela trouxeram para a coleção e os textos que os autores escreveram. A maioria dos textos está em inglês." - -#: crates/cr-addons/src/details.rs:186 -msgid "Texts" -msgstr "Textos" - -#: crates/cr-addons/src/details.rs:207 -msgid "{count} item, all in the collection" -msgid_plural "{count} items, all in the collection" -msgstr[0] "{count} item, que está na coleção" -msgstr[1] "{count} itens, todos na coleção" - -#: crates/cr-addons/src/details.rs:213 -msgid "{n} item, which a newer add-on replaced" -msgid_plural "{n} items, which newer add-ons replaced" -msgstr[0] "{n} item, que um addon mais novo substituiu" -msgstr[1] "{n} itens, que addons mais novos substituíram" - -#: crates/cr-addons/src/details.rs:218 -msgid "{n} item; {kept} are in the collection as written here" -msgid_plural "{n} items; {kept} are in the collection as written here" -msgstr[0] "{n} item; {kept} estão na coleção como escritos aqui" -msgstr[1] "{n} itens; {kept} estão na coleção como escritos aqui" - -#: crates/cr-addons/src/details.rs:242 -msgid "and {n} more" -msgid_plural "and {n} more" -msgstr[0] "e mais {n}" -msgstr[1] "e mais {n}" - -#: crates/cr-addons/src/extras.rs:82 -msgid "The built-in pictures are damaged: {e}" -msgstr "As imagens embutidas estão danificadas: {e}" - -#: crates/cr-addons/src/extras.rs:208 -#: crates/cr-addons/src/install.rs:101 -#: crates/cr-addons/src/install.rs:125 -#: crates/cr-addons/src/install.rs:132 -#: crates/cr-app/src/addons.rs:626 -msgid "Could not write {file}: {e}" -msgstr "Não consegui gravar {file}: {e}" - -#: crates/cr-addons/src/install.rs:57 -msgid "The built-in add-ons are damaged: {e}" -msgstr "Os addons embutidos estão corrompidos: {e}" - -#: crates/cr-addons/src/install.rs:58 -msgid "Could not read the built-in add-ons: {e}" -msgstr "Não consegui ler os addons embutidos: {e}" - -#: crates/cr-addons/src/install.rs:69 -#: crates/cr-app/src/addons.rs:815 -msgid "Could not copy {folder}: {e}" -msgstr "Não consegui copiar {folder}: {e}" - -#: crates/cr-addons/src/install.rs:94 -msgid "The import failed: {e}" -msgstr "A importação falhou: {e}" - -#: crates/cr-addons/src/locate.rs:45 -msgid ".deb package" -msgstr "pacote .deb" - -#: crates/cr-addons/src/locate.rs:46 -msgid ".rpm package" -msgstr "pacote .rpm" - -#: crates/cr-addons/src/locate.rs:49 -msgid "AppImage in {folder}" -msgstr "AppImage em {folder}" - -#: crates/cr-addons/src/main.rs:63 -#: crates/cr-addons/src/main.rs:125 -msgid "Core Rules Community Add-ons Collection" -msgstr "Coleção de addons da comunidade do Core Rules" - -#: crates/cr-addons/src/main.rs:71 -msgid "Core Rules on This Computer" -msgstr "Core Rules neste computador" - -#: crates/cr-addons/src/main.rs:75 -msgid "Search Again" -msgstr "Procurar de novo" - -#: crates/cr-addons/src/main.rs:86 -#: crates/cr-addons/src/main.rs:434 -msgid "Install" -msgstr "Instalar" - -#: crates/cr-addons/src/main.rs:90 -#: crates/cr-addons/src/main.rs:156 -msgid "Open Core Rules" -msgstr "Abrir o Core Rules" - -#: crates/cr-addons/src/main.rs:100 -msgid "Other Folder…" -msgstr "Outra pasta…" - -#: crates/cr-addons/src/main.rs:104 -msgid "Add-on Details…" -msgstr "Detalhes dos addons…" - -#: crates/cr-addons/src/main.rs:126 -msgid "The {addons} add-ons the community made for AD&D Core Rules 2.0 and the Expansion, in one package: races, classes, kits, spells, monsters, equipment, encounters, the characters of the modules and the User Database. {items} items in all, with the pictures that came with them." -msgstr "Os {addons} addons feitos pela comunidade para o AD&D Core Rules 2.0 e a Expansion, num só pacote: raças, classes, kits, magias, monstros, equipamentos, encontros, os personagens dos módulos e a User Database. São {items} itens, com as imagens que vieram com eles." - -#: crates/cr-addons/src/main.rs:150 -msgid "Installing the Add-ons" -msgstr "Instalando os addons" - -#: crates/cr-addons/src/main.rs:154 -msgid "Open the Log" -msgstr "Abrir o registro" - -#: crates/cr-addons/src/main.rs:168 -msgid "Add-ons Installed" -msgstr "Addons instalados" - -#: crates/cr-addons/src/main.rs:264 -msgid "Data in {place}" -msgstr "Dados em {place}" - -#: crates/cr-addons/src/main.rs:265 -msgid "Data in {place}. The add-ons were installed here before." -msgstr "Dados em {place}. Os addons já foram instalados aqui." - -#: crates/cr-addons/src/main.rs:270 -msgid "Data of the original program in Wine: {place}" -msgstr "Dados do programa original no Wine: {place}" - -#: crates/cr-addons/src/main.rs:272 -msgid "Data of the original program in Wine: {place}. The add-ons were installed here before." -msgstr "Dados do programa original no Wine: {place}. Os addons já foram instalados aqui." - -#: crates/cr-addons/src/main.rs:282 -msgid "{place} has Core Rules 2.0; the add-ons are for the Expansion." -msgstr "{place} tem o Core Rules 2.0; os addons são para a Expansion." - -#: crates/cr-addons/src/main.rs:289 -msgid "No game data yet: open it and use Extract Data from CD… in the menu." -msgstr "Ainda sem os dados do jogo: abra-o e use Extrair dados do CD… no menu." - -#: crates/cr-addons/src/main.rs:296 -msgid "Chosen Folder" -msgstr "Pasta escolhida" - -#: crates/cr-addons/src/main.rs:305 -msgid "Update the app to version 0.7.2 or newer to see all the add-ons." -msgstr "Atualize o app para a versão 0.7.2 ou mais nova para ver todos os addons." - -#: crates/cr-addons/src/main.rs:321 -msgid "Core Rules Data" -msgstr "Dados do Core Rules" - -#: crates/cr-addons/src/main.rs:330 -msgid "No Core Rules Found" -msgstr "Nenhum Core Rules encontrado" - -#: crates/cr-addons/src/main.rs:331 -msgid "I looked for the Flatpak, the .deb and .rpm packages and AppImages in the usual folders (Downloads, Applications, Desktop and the home folder)." -msgstr "Procurei o Flatpak, os pacotes .deb e .rpm e as AppImages nas pastas de sempre (Downloads, Aplicativos, Área de Trabalho e a pasta pessoal)." - -#: crates/cr-addons/src/main.rs:340 -msgid "The add-ons will be installed in the data folder above. First the installer keeps a copy of UserDbas and Chars beside it. A record of yours with the same name as an add-on is replaced by the add-on." -msgid_plural "The add-ons will be installed in the {n} data folders above. First the installer keeps a copy of UserDbas and Chars beside each one. A record of yours with the same name as an add-on is replaced by the add-on." -msgstr[0] "Os addons vão ser instalados na pasta de dados acima. Antes, o instalador guarda uma cópia de UserDbas e Chars ao lado da pasta. Um registro seu com o mesmo nome de um addon é substituído pelo do addon." -msgstr[1] "Os addons vão ser instalados nas {n} pastas de dados acima. Antes, o instalador guarda uma cópia de UserDbas e Chars ao lado de cada pasta. Um registro seu com o mesmo nome de um addon é substituído pelo do addon." - -#: crates/cr-addons/src/main.rs:350 -msgid "Install Core Rules 0.7.2 or newer from the project's releases page, open it and use Extract Data from CD… in the menu; then search again here." -msgstr "Instale o Core Rules 0.7.2 ou mais novo pela página de releases do projeto, abra-o e use Extrair dados do CD… no menu; depois procure de novo aqui." - -#: crates/cr-addons/src/main.rs:356 -msgid "Open Core Rules and use Extract Data from CD… in the menu to create the data folder; then search again here." -msgstr "Abra o Core Rules e use Extrair dados do CD… no menu para criar a pasta de dados; depois procure de novo aqui." - -#: crates/cr-addons/src/main.rs:372 -msgid "Core Rules Data Folder" -msgstr "Pasta de dados do Core Rules" - -#: crates/cr-addons/src/main.rs:402 -msgid "Could not open Core Rules" -msgstr "Não consegui abrir o Core Rules" - -#: crates/cr-addons/src/main.rs:403 -#: crates/cr-addons/src/main.rs:502 -msgid "Close" -msgstr "Fechar" - -#: crates/cr-addons/src/main.rs:427 -msgid "Install into the Original Program?" -msgstr "Instalar no programa original?" - -#: crates/cr-addons/src/main.rs:428 -msgid "One of the folders is the original program's installation inside Wine. The add-ons work there too, but the original's Import takes about 35 minutes to read the same package." -msgstr "Uma das pastas é a instalação do programa original dentro do Wine. Os addons também funcionam nele, mas o Import do original leva cerca de 35 minutos para ler o mesmo pacote." - -#: crates/cr-addons/src/main.rs:434 -msgid "Cancel" -msgstr "Cancelar" - -#: crates/cr-addons/src/main.rs:456 -msgid "Keeping a copy of UserDbas and Chars from {place}…" -msgstr "Guardando uma cópia de UserDbas e Chars de {place}…" - -#: crates/cr-addons/src/main.rs:468 -msgid "The backup failed." -msgstr "A cópia de segurança falhou." - -#: crates/cr-addons/src/main.rs:472 -msgid "Importing the add-ons into {place}. This takes less than a minute." -msgstr "Importando os addons em {place}. Isso leva menos de um minuto." - -#: crates/cr-addons/src/main.rs:484 -msgid "The import stopped with an unexpected error." -msgstr "A importação parou com um erro inesperado." - -#: crates/cr-addons/src/main.rs:501 -msgid "The Add-ons Were Not Installed" -msgstr "Os addons não foram instalados" - -#: crates/cr-addons/src/main.rs:512 -msgid "{items} items imported into {place}. The backup is in {backup}." -msgstr "{items} itens importados em {place}. A cópia de segurança ficou em {backup}." - -#: crates/cr-addons/src/main.rs:518 -msgid "{items} items imported into {place}, {n} of them a character. The backup is in {backup}." -msgid_plural "{items} items imported into {place}, {n} of them characters. The backup is in {backup}." -msgstr[0] "{items} itens importados em {place}, {n} deles personagem. A cópia de segurança ficou em {backup}." -msgstr[1] "{items} itens importados em {place}, {n} deles personagens. A cópia de segurança ficou em {backup}." - -#: crates/cr-addons/src/main.rs:531 -msgid "{n} picture of the add-ons was copied there." -msgid_plural "{n} pictures of the add-ons were copied there." -msgstr[0] "{n} imagem dos addons foi copiada para lá." -msgstr[1] "{n} imagens dos addons foram copiadas para lá." - -#: crates/cr-addons/src/main.rs:539 -msgid "If Core Rules is open, close it and open it again to see the add-ons." -msgstr "Se o Core Rules estiver aberto, feche e abra de novo para ver os addons." - #: crates/cr-app/src/about.rs:31 msgid "Core Rules is a complete Linux version of AD&D Core Rules 2.0 and its Expansion (TSR/Evermore, 1998-1999), the character manager and Dungeon Master's toolkit for Advanced Dungeons & Dragons 2nd Edition. It is written in Rust with GTK 4 and libadwaita and runs natively, with no Wine and no Windows." msgstr "Core Rules é uma versão completa para Linux do AD&D Core Rules 2.0 e da sua Expansion (TSR/Evermore, 1998-1999), o gerenciador de personagens e kit de ferramentas do Mestre para Advanced Dungeons & Dragons 2ª Edição. É escrito em Rust com GTK 4 e libadwaita e roda nativamente, sem Wine e sem Windows." @@ -390,6 +115,10 @@ msgstr[1] "{n} outros arquivos (textos, documentos) ficam como estão." msgid "The user databases and the characters are copied to a backup first. The add-ons come in from the oldest file to the newest, and characters already in the list are left out." msgstr "Antes, os bancos de dados do usuário e os personagens são copiados para um backup. Os addons entram do arquivo mais antigo para o mais novo, e personagens que já estão na lista ficam de fora." +#: crates/cr-app/src/addons.rs:626 +msgid "Could not write {file}: {e}" +msgstr "Não consegui gravar {file}: {e}" + #: crates/cr-app/src/addons.rs:685 msgid "{n} item came in." msgid_plural "{n} items came in." @@ -456,6 +185,10 @@ msgid_plural "Imported {n} Add-ons" msgstr[0] "{n} addon importado" msgstr[1] "{n} addons importados" +#: crates/cr-app/src/addons.rs:815 +msgid "Could not copy {folder}: {e}" +msgstr "Não consegui copiar {folder}: {e}" + #: crates/cr-app/src/bundle.rs:60 msgid "{used} of {capacity} pages used" msgstr "{used} de {capacity} páginas usadas" diff --git a/data/addons/icons/hicolor/128x128/apps/io.github.brahm.CoreRules.Addons.png b/data/addons/icons/hicolor/128x128/apps/io.github.brahm.CoreRules.Addons.png deleted file mode 100644 index 70f51f3..0000000 Binary files a/data/addons/icons/hicolor/128x128/apps/io.github.brahm.CoreRules.Addons.png and /dev/null differ diff --git a/data/addons/icons/hicolor/16x16/apps/io.github.brahm.CoreRules.Addons.png b/data/addons/icons/hicolor/16x16/apps/io.github.brahm.CoreRules.Addons.png deleted file mode 100644 index 842201a..0000000 Binary files a/data/addons/icons/hicolor/16x16/apps/io.github.brahm.CoreRules.Addons.png and /dev/null differ diff --git a/data/addons/icons/hicolor/24x24/apps/io.github.brahm.CoreRules.Addons.png b/data/addons/icons/hicolor/24x24/apps/io.github.brahm.CoreRules.Addons.png deleted file mode 100644 index 4567f75..0000000 Binary files a/data/addons/icons/hicolor/24x24/apps/io.github.brahm.CoreRules.Addons.png and /dev/null differ diff --git a/data/addons/icons/hicolor/32x32/apps/io.github.brahm.CoreRules.Addons.png b/data/addons/icons/hicolor/32x32/apps/io.github.brahm.CoreRules.Addons.png deleted file mode 100644 index 0a59ffa..0000000 Binary files a/data/addons/icons/hicolor/32x32/apps/io.github.brahm.CoreRules.Addons.png and /dev/null differ diff --git a/data/addons/icons/hicolor/48x48/apps/io.github.brahm.CoreRules.Addons.png b/data/addons/icons/hicolor/48x48/apps/io.github.brahm.CoreRules.Addons.png deleted file mode 100644 index aef9b9a..0000000 Binary files a/data/addons/icons/hicolor/48x48/apps/io.github.brahm.CoreRules.Addons.png and /dev/null differ diff --git a/data/addons/icons/hicolor/512x512/apps/io.github.brahm.CoreRules.Addons.png b/data/addons/icons/hicolor/512x512/apps/io.github.brahm.CoreRules.Addons.png deleted file mode 100644 index 7bab882..0000000 Binary files a/data/addons/icons/hicolor/512x512/apps/io.github.brahm.CoreRules.Addons.png and /dev/null differ diff --git a/data/addons/icons/hicolor/64x64/apps/io.github.brahm.CoreRules.Addons.png b/data/addons/icons/hicolor/64x64/apps/io.github.brahm.CoreRules.Addons.png deleted file mode 100644 index 4e6e0b5..0000000 Binary files a/data/addons/icons/hicolor/64x64/apps/io.github.brahm.CoreRules.Addons.png and /dev/null differ diff --git a/data/addons/io.github.brahm.CoreRules.Addons.desktop b/data/addons/io.github.brahm.CoreRules.Addons.desktop deleted file mode 100644 index bb76f43..0000000 --- a/data/addons/io.github.brahm.CoreRules.Addons.desktop +++ /dev/null @@ -1,19 +0,0 @@ -[Desktop Entry] -Name=Core Rules Community Add-ons Collection -Name[pt_BR]=Coleção de addons da comunidade do Core Rules -Name[es]=Colección de add-ons de la comunidad de Core Rules -Name[it]=Raccolta di add-on della comunità di Core Rules -Name[fr]=Collection d’add-ons de la communauté Core Rules -Name[de]=Community-Add-on-Sammlung für Core Rules -Comment=Install the community add-ons into Core Rules -Comment[pt_BR]=Instale os addons da comunidade no Core Rules -Comment[es]=Instale los add-ons de la comunidad en Core Rules -Comment[it]=Installa gli add-on della comunità in Core Rules -Comment[fr]=Installez les add-ons de la communauté dans Core Rules -Comment[de]=Installieren Sie die Add-ons der Community in Core Rules -Exec=corerules-community-addons -Icon=io.github.brahm.CoreRules.Addons -Terminal=false -Type=Application -Categories=Game;RolePlaying; -StartupNotify=true diff --git a/packaging/appimage/build-in-sdk.sh b/packaging/appimage/build-in-sdk.sh index 08cae1f..a0e4d24 100755 --- a/packaging/appimage/build-in-sdk.sh +++ b/packaging/appimage/build-in-sdk.sh @@ -25,9 +25,6 @@ flatpak run --share=network --filesystem=host --cwd="$PWD" --command=sh \ "org.gnome.Sdk//$gnome" -c ' set -eu export PATH=/usr/lib/sdk/rust-stable/bin:$PATH CARGO_HOME=$PWD/target/cargo-home - case $2 in - addons) cargo build --release --locked -p cr-addons ;; - *) cargo build --release --locked ;; - esac - packaging/appimage/build.sh "$1" "$2" - ' sh "$version" "${2:-app}" + cargo build --release --locked + packaging/appimage/build.sh "$1" + ' sh "$version" diff --git a/packaging/appimage/build.sh b/packaging/appimage/build.sh index 269dd26..429c284 100755 --- a/packaging/appimage/build.sh +++ b/packaging/appimage/build.sh @@ -1,20 +1,14 @@ #!/bin/sh # Builds dist/CoreRules-VERSION-ARCH.AppImage from target/release with # linuxdeploy and its GTK plugin, which bundle GTK 4, libadwaita and their -# data from the system it runs on. `build.sh VERSION addons` builds the -# Community Add-ons Collection instead, -# dist/CoreRules-Community-Addons-VERSION-ARCH.AppImage. +# data from the system it runs on. # Releases run it inside the GNOME 51 SDK (build-in-sdk.sh), so the # AppImage carries that platform's libraries and runs on systems with the # SDK's glibc or newer. set -eu version=$1 arch=$(uname -m) -case ${2:-app} in - app) app=io.github.brahm.CoreRules exe=corerules name=CoreRules ;; - addons) app=io.github.brahm.CoreRules.Addons exe=corerules-community-addons name=CoreRules-Community-Addons ;; - *) echo "$0: unknown target $2" >&2; exit 2 ;; -esac +app=io.github.brahm.CoreRules exe=corerules name=CoreRules tools=${TOOLS_DIR:-$PWD/target/appimage-tools} appdir=$PWD/target/AppDir mkdir -p "$tools" @@ -33,16 +27,7 @@ grep -q 'pixbuf loaders, if any' "$plugin" || sed -i \ -e 's|^echo "Copying more libraries"$|fi\n&|' "$plugin" rm -rf "$appdir" -if [ "$exe" = corerules ]; then - packaging/install.sh "$appdir" /usr -else - install -Dm755 "target/release/$exe" "$appdir/usr/bin/$exe" - install -Dm644 "data/addons/$app.desktop" "$appdir/usr/share/applications/$app.desktop" - for icon in data/addons/icons/hicolor/*/apps/$app.png; do - size=$(basename "$(dirname "$(dirname "$icon")")") - install -Dm644 "$icon" "$appdir/usr/share/icons/hicolor/$size/apps/$app.png" - done -fi +packaging/install.sh "$appdir" /usr # The GTK plugin reads the version to bundle from DEPLOY_GTK_VERSION. export DEPLOY_GTK_VERSION=4 APPIMAGE_EXTRACT_AND_RUN=1 NO_STRIP=1 PATH="$tools:$PATH" linuxdeploy --appdir "$appdir" \ diff --git a/site/build.py b/site/build.py index 9dcf9ae..b4ebb36 100644 --- a/site/build.py +++ b/site/build.py @@ -131,10 +131,9 @@ def main(): icons = out / "icons" icons.mkdir() app = "data/icons/hicolor/{}/apps/io.github.brahm.CoreRules.png" - addons = "data/addons/icons/hicolor/{}/apps/io.github.brahm.CoreRules.Addons.png" shutil.copy(ROOT / app.format("512x512"), icons / "corerules.png") shutil.copy(ROOT / app.format("64x64"), icons / "favicon.png") - shutil.copy(ROOT / addons.format("256x256"), icons / "addons.png") + shutil.copy(ROOT / "addons" / "icon.png", icons / "addons.png") (out / ".nojekyll").touch() page = (SITE / "index.html").read_text() diff --git a/site/index.html b/site/index.html index 4ff3551..11e52fa 100644 --- a/site/index.html +++ b/site/index.html @@ -201,12 +201,9 @@

Download Core Rules

  • Any distribution (glibc 2.43+)AppImage CoreRules-1.1.0-x86_64.AppImage chmod +x CoreRules-1.1.0-x86_64.AppImage
  • -
  • Community Add-ons, for any of the aboveInstaller - CoreRules-Community-Addons-x86_64.AppImage - chmod +x CoreRules-Community-Addons-x86_64.AppImage
  • Community Add-ons, for Linux, Windows and macOS.zip CoreRules-Community-Addons.zip - In Core Rules, choose Import Add-ons… and pick the folder that holds the zip.
  • + In Core Rules, choose Import Add-ons… and pick the folder that holds the zip (how).
  • Windows 11Microsoft Store Core Rules on the Microsoft Store Free; the Store installs it with the Windows App Runtime it needs and brings every update.
  • @@ -282,10 +279,10 @@

    You need the original discs

    Twenty-five years of homebrew

    Community Add-ons Collection

    The add-ons that the Core Rules community made for Core Rules 2.0 and its Expansion, - gathered into one package and installed with one click. 672 add-on packages became - 36,525 items, in the Expansion's own format, so they open in the app and in the original - program alike. The 668 pictures that came with them are installed too, and the texts their - authors wrote can be read in the installer.

    + gathered into one package that the app imports in one go, on Linux, Windows 11 and macOS. + 672 add-on packages became 36,525 items, in the Expansion's own format, so they open in the + app and in the original program alike. The 668 pictures that came with them come along, and + so do the texts their authors wrote.

    7,479
    wizard spells
    3,514
    priest spells
    @@ -294,33 +291,39 @@

    Community Add-ons Collection

    1,547
    races, classes and kits
    584
    encounters and templates
    48
    characters from the published modules
    -
    6
    languages in the installer
    +
    668
    pictures of monsters, races and characters
    -

    Version 1.0.0 · one self-installing AppImage

    -

    Needs Linux x86-64 (glibc 2.43 or newer), Core Rules 0.7.2 or newer and your - Expansion data in the app. The installer backs up your UserDbas and Chars - folders first. It leaves out Evermore's monthly goodies; the add-ons belong to their authors in - the Core Rules community.

    +

    One .zip · for Linux, Windows 11 and macOS

    -

    On Windows, macOS or any Linux, the .zip - holds the same validated add-ons, pictures and texts: in Core Rules, choose - Import Add-ons… and pick the folder that holds the zip, with no need to extract it. - The original Expansion program imports its Comunidade.xpx too.

    -

    The link always gives the newest build. The same file, version by version: - CoreRules-Community-Addons-1.0.0-x86_64.AppImage - on the addons release, and on - GitHub Packages as the AppImage file itself.

    +

    Importing the add-ons

    +
      +
    1. Download CoreRules-Community-Addons.zip + and put it in a folder of its own. There is no need to extract it.
    2. +
    3. In Core Rules, choose Import Add-ons…: in the main menu on Linux, the + More menu on Windows and the File menu on the Mac.
    4. +
    5. Pick the folder that holds the zip. The app reads it, with its subfolders and the zips + in it, and lists what comes in, what was found twice and what cannot be imported, with why.
    6. +
    7. Press Import. The whole collection comes in in about a minute, with + its pictures, and the module characters join the character list.
    8. +
    +

    Needs Core Rules 1.2.0 or newer and your Expansion data in the app. Import + backs up your UserDbas and Chars folders first and writes a log; + importing again does not duplicate the characters. The same command imports any other folder + of add-ons, loose or zipped. The original Expansion program imports the zip's + Comunidade.xpx too. The link always gives the newest build; the + addons release keeps each + version. The collection leaves out Evermore's monthly goodies; the add-ons belong to their + authors in the Core Rules community.