Skip to content

Commit

Permalink
Automatic translation for docs (#87)
Browse files Browse the repository at this point in the history
* translation automation using deepmark

* chore: github translation workflow

* chore: update deps

* update translation after docusaurus vversion update

* fix broken link

* set husky precommit as executable

* fix broken translation order by upgrading deepmark

* remove generated i18n files

* add i18n to .gitignore
  • Loading branch information
izznat authored Sep 25, 2022
1 parent 68a50d0 commit f777b0c
Show file tree
Hide file tree
Showing 89 changed files with 4,577 additions and 11,708 deletions.
Binary file added .deepmark/db.sqlite
Binary file not shown.
31 changes: 31 additions & 0 deletions .github/workflows/translation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Translation
on:
push:
branches:
- master
paths:
- docs/**
- src/**
jobs:
translate:
name: Translate markdown, json, and yaml files with deepmark.
runs-on: ubuntu-latest
env:
DEEPL_AUTH_KEY: ${{ secrets.DEEPL_AUTH_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn install
- name: Translate
run: yarn translate
- name: Commit changes
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commmit -m "action: translate" --no-verify
git push
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/build

# Generated files
i18n
.docusaurus
.cache-loader

Expand Down
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
22 changes: 22 additions & 0 deletions deepmark.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/** @type {import("deepmark").UserConfig} */
export default {
sourceLanguage: "en",
outputLanguages: ["ja", "zh"],
directories: [
["i18n/$langcode$", "i18n/$langcode$"],
["docs", "i18n/$langcode$/docusaurus-plugin-content-docs/current"],
],
frontmatterFields: {
include: ["title", "tags"],
},
jsxComponents: {
include: {
IfcCard: { children: true, attributes: ["title"] },
IfcTab: { attributes: ["items.content"] },
},
exclude: ["IfcImage", "Scene", "Sponsoring"],
},
jsonOrYamlProperties: {
include: ["message", "description"],
},
};
2 changes: 1 addition & 1 deletion docs/Guide/Getting started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Getting started
sidebar_position: 1
---

import { IfcCard } from "../../src/components/Card/InfoCard";
import { IfcCard } from "@site/src/components/Card/InfoCard";

## Understanding IFC.js

Expand Down
4 changes: 2 additions & 2 deletions docs/Guide/Handling bounties.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ title: Handling bounties
sidebar_position: 1
---

import { IfcAlert } from "../../src/components/Alert/Alert";
import { IfcCard } from "../../src/components/Card/InfoCard";
import { IfcAlert } from "@site/src/components/Alert/Alert";
import { IfcCard } from "@site/src/components/Card/InfoCard";

## Where to find Bounties?

Expand Down
6 changes: 3 additions & 3 deletions docs/Guide/web-ifc-three/Introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ title: Introduction
sidebar_position: 1
---

import { IfcCard } from "../../../src/components/Card/InfoCard";
import { IfcAlert } from "../../../src/components/Alert/Alert";
import { IfcCard } from "@site/src/components/Card/InfoCard";
import { IfcAlert } from "@site/src/components/Alert/Alert";

## BIM is not only geometry...

...but it has geometry.

💪
[Web-ifc]("https://ifcjs.github.io/info/docs/Guide/web-ifc/Introduction") is a very powerful tool capable of reading and writing IFCs with near-native speed. However, almost all BIM applications show the user a 3D view of the models they are working with. You could use `web-ifc` in any graphics engine, but we have already done that for you in **web-ifc-three**.
[Web-ifc](../web-ifc/Introduction.mdx) is a very powerful tool capable of reading and writing IFCs with near-native speed. However, almost all BIM applications show the user a 3D view of the models they are working with. You could use `web-ifc` in any graphics engine, but we have already done that for you in **web-ifc-three**.

🧶
`web-ifc-three` is a wrapper around `web-ifc` that reads all data from IFC files and transforms it into geometry that can be displayed and edited in any browser. You can install it with `npm i web-ifc-three` or `yarn add web-ifc-three`. Some cool facts about this module:
Expand Down
4 changes: 2 additions & 2 deletions docs/Guide/web-ifc-three/Setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ title: Setup
sidebar_position: 2
---

import { IfcCard } from "../../../src/components/Card/InfoCard";
import { IfcAlert } from "../../../src/components/Alert/Alert";
import { IfcCard } from "@site/src/components/Card/InfoCard";
import { IfcAlert } from "@site/src/components/Alert/Alert";

## 🌵 DRY documentation 🌵

Expand Down
6 changes: 3 additions & 3 deletions docs/Guide/web-ifc-three/Tutorials/AdvancedLoading.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ title: 🚀 Multithreading
sidebar_position: 6
---

import { IfcCard } from "../../../../src/components/Card/InfoCard";
import { IfcAlert } from "../../../../src/components/Alert/Alert";
import { Scene } from "../../../../src/components/Scene/Scene";
import { IfcCard } from "@site/src/components/Card/InfoCard";
import { IfcAlert } from "@site/src/components/Alert/Alert";
import { Scene } from "@site/src/components/Scene/Scene";

## Introduction

Expand Down
6 changes: 3 additions & 3 deletions docs/Guide/web-ifc-three/Tutorials/Hiding.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ title: 👓 Hiding
sidebar_position: 4
---

import { IfcCard } from "../../../../src/components/Card/InfoCard";
import { IfcAlert } from "../../../../src/components/Alert/Alert";
import { Scene } from "../../../../src/components/Scene/Scene";
import { IfcCard } from "@site/src/components/Card/InfoCard";
import { IfcAlert } from "@site/src/components/Alert/Alert";
import { Scene } from "@site/src/components/Scene/Scene";

## Introduction

Expand Down
6 changes: 3 additions & 3 deletions docs/Guide/web-ifc-three/Tutorials/Highlighting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ title: ✨ Subsets
sidebar_position: 2
---

import { IfcCard } from "../../../../src/components/Card/InfoCard";
import { IfcAlert } from "../../../../src/components/Alert/Alert";
import { Scene } from "../../../../src/components/Scene/Scene";
import { IfcCard } from "@site/src/components/Card/InfoCard";
import { IfcAlert } from "@site/src/components/Alert/Alert";
import { Scene } from "@site/src/components/Scene/Scene";

## Introduction

Expand Down
Loading

0 comments on commit f777b0c

Please sign in to comment.