Skip to content

Commit

Permalink
add i18n for markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
work7z committed Mar 7, 2024
1 parent 0168e24 commit ab464f4
Show file tree
Hide file tree
Showing 90 changed files with 6,011 additions and 709 deletions.
36 changes: 15 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
<br><br>
</p>

# 💡 Introduction
<i>Note: This page is generated from LafTools internally.</i>

You may wonder why we are determined to develop this toolbox as there are numerous tools can be used on the Internet.
# 💡 Introduction

Indeed, most tools we have provided can be easily found on the Internet, such as codec, formatter, translation, QR Code, etc… However, it’s not the most comfortable and efficient approach to use these tools.
You may wonder why we are determined to develop this toolbox as there are numerous tools can be used on the Internet. Indeed, most tools we have provided can be easily found on the Internet, such as codec, formatter, translation, QR Code, etc… However, it is not the most comfortable and efficient approach to use these tools.

Have you ever met the below issues while using those online tools?

- No Offline Accessibility.
- No Global Dark Theme.
- No Productive UI style.
- Poor Network Performance.
- Upsetting Advertisements
- Upsetting Advertisements.
- Data Leakage Issue.

If the answer to any of the above is yes, then you should consider trying our toolbox. It offers the following features:
Expand All @@ -43,14 +43,8 @@ If the answer to any of the above is yes, then you should consider trying our to
### Preview(English):

[Online Preview](http://cloud.laf-tools.com)
![](https://github.com/work7z/LafTools/blob/dev/devtools/images/preview-enus.png?raw=true)
![](https://github.com/work7z/LafTools/blob/dev/devtools/images/preview-1.png?raw=true)

### Preview(Simplified Chinese|简体中文):

[在线预览](http://cloud.laf-tools.com)
![](https://github.com/work7z/LafTools/blob/dev/devtools/images/preview-zhcn.png?raw=true)
![](https://github.com/work7z/LafTools/blob/dev/devtools/images/preview-dark-jan.png?raw=true)
![](https://github.com/work7z/LafTools/blob/dev/devtools/images/preview.png?raw=true)
![](https://github.com/work7z/LafTools/blob/dev/devtools/images/preview-dark.png?raw=true)

# 🍀 Getting Started

Expand All @@ -60,16 +54,16 @@ Recently, we are refactoring the architecture of LafTools based on next.js, belo

## 1. Setup System Environment

For the sake of simplicity, let's say that you've cloned this repository to either `C:\\Users\jerry\\project\\laftools-repo` on Windows or `/Users/jerry/projects/laftools-repo` on Linux/MacOS, then you should declare env and set config below in your file **~/.bashrc**, or simply execute them before running any command.
For the sake of simplicity, let's say that you've cloned this repository to either `C:\Usersjerry\project\laftools-repo` on Windows or `/Users/jerry/projects/laftools-repo` on Linux/MacOS, then you should declare env and set config below in your file **~/.bashrc**, or simply execute them before running any command.

If you're using Windows OS, please ensure that all commands are executed in git-bash, learn more please refer to [CONTRIBUTION](./docs/CONTRIBUTION.md). Apart from this, it is recommended to avoid using any whitespace or non-English characters in the file path where this project is located.
If you're using Windows OS, please ensure that all commands are executed in git-bash, learn more please refer to [CONTRIBUTION](./docs/${lang}/CONTRIBUTION.md). Apart from this, it is recommended to avoid using any whitespace or non-English characters in the file path where this project is located.

**Env for Windows:**

```bash
git config core.ignorecase false
export LAFTOOLS_ROOT="C:\\users\\jerry\\project\\laftools-repo"
export PATH=$PATH:$LAFTOOLS_ROOT\\dev\\source\\windows-bin
export LAFTOOLS_ROOT="C:\users\jerry\project\laftools-repo"
export PATH=$PATH:$LAFTOOLS_ROOT\dev\source\windows-bin
```

**Env for Linux/MacOS:**
Expand All @@ -88,7 +82,7 @@ go run ./core/app.go server

To debug Go service, we have configured it in VSCode, you can just follow below steps:

1. Enter Visual Studio Code
1. Enter {0}
2. Click "Run and Debug" on your sidebar
3. Click "Run" button.

Expand All @@ -106,13 +100,13 @@ cd $LAFTOOLS_ROOT/devtools/scripts/scan && pnpm install

npm run win-clean # It's for Windows Only, it will close all terminals and previous processes.

# run web service on [Terminal - 1]
# run web service on terminal 1
npm run fe-web

# run CSS processor on [Terminal - 2]
# run CSS processor on terminal 2
npm run fe-css

# run extra jobs on [Terminal - 3]
# run extra jobs on terminal 3
npm run fe-extra

```
Expand Down Expand Up @@ -154,7 +148,7 @@ Hopefully LafTools will make your daily tasks easier, reducing the need for over
Below are further materials that you can have a look if you'd like to learn more detail about this project:

- [FAQ](./docs/FAQ.md)
- [CONTRIBUTION](./docs/CONTRIBUTION.md)
- [CONTRIBUTION](./docs/en_US/CONTRIBUTION.md)
- [For China Developers](devtools/notes/common/issues.md)

# 💐 Icons
Expand Down
163 changes: 163 additions & 0 deletions devtools/docs-generator/files/CONTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
## Pre-requisites

Before you start developing this project, please ensure that you have the following SDKs and software installed. Pay close attention to the versions specified to avoid any compatibility issues. Some versions may work, but the ones listed below are recommended.

- Node v20.9.0
- Go 1.21.1
- Git Bash(for Windows)
- Need to select "Use Git and optional Unix...." in installation.
- Visual Studio Code

Before modifying the source code, you should read the below sections to learn the architecture and technical details.

## How to launch project?

To avoid writing duplicate parts, please read [README.md](../README.md) about this section, it includes complete guideline for how to install deps and run frontend and backend project.

## How to build project?

We fully opened the source project of this project, to build this project, you can trigger below commands in Git-Bash:

```bash
./pipeline/build-all.sh
```

## VSCode Extensions for Dev

If you are going to develop this project, here are some awesome extensions for you to check that might be helpful. Note that this section is surely of no interest.

1. Prettier - Code formatter
2. TODO Highlight
3. React
4. Go
5. Golang Tools
6. Tailwind CSS IntelliSense
7. Nano ID generator
8. HTML CSS Support
9. Go To Method
10. go snippets
11. Go Outliner
12. Go Asm
13. Go Doc

## Dev && Build on VSCode

If you are going to develop or build this project, note that you should complete below steps first, otherwise, you will receive unexcepted errors.

1. Set your terminal execution path as Git Bash
2. Set an env in your system: LAFTOOLS_ROOT=${Your Actual Project Root}.
3. Install dlv and gopls for Go backend service when you launch it firstly.

## Technologies

To start developing, please check if you are familiar with the technologies we use. No need to learn all of them if not, it’s ok if you are only familiar with F/E or B/E technologies, we have unit tests and pull request workflow to ensure your changes are done properly.

We’re looking forward to your contribution.

For Front-end development:

- React
- TypeScript
- BluePrint.js
- Tailwind.css

For Back-end development:

- Go
- Node.js

For desktop/client development:

- Wails.io
- Electron
- Browser Extension

To write our docs concisely, we will not elaborate on every detail about that 3rd library here, kindly read the source code for further details.

## Architecture

TODO:

Client (Web, Desktop, IDE Plugin)
<interact with>
Server SIde Go
<interact with>
Server Side Node

## Specifications

### Tools Implementation

To make sure all tools are supported on all UI clients (Web, Desktop, IDE, mobile, etc…), it is recommended that we implement the logic of tools on the server side, not the client side.

For instance, if you want to convert a base64 text into plain text, we should always do the conversion on the Go server side although there’s a quicker way to do it in the browser directly, which takes user experiences and tool compatibility into consideration.

### Node Module Design

You probably noticed there’s a Node.js server module in the architecture. Why should we use Node.js in this software, isn’t it eating our memory? Aren’t we are we pursuing low memory usage?

The reason why we bring Node worker is to :

- Utilize the ecosystem for extra tools logic in Node.js
- Define system menus, extensions, and config dynamically.
- Develop extensions without restarting the Go service.

To avoid the Node worker keeps eating u machine’s memory, we adopt the below strategy:

- Run Node as a sub-process in Go.
- Only run it when there’s a necessity.
- Using WebSocket as the protocol between Go and Node.
- Terminate Node if there’s no new request for it.

For instance, when you click a button to beautify a piece of code, the client will send a request to the server side. Note that the server side is the Go service.

Then, the Go service receives and detects this request depending on the Node service, accordingly, it will:

- Check if Node is still alive.
- If not then just launch it and keep waiting until Node is active.
- Publish a job to the node worker.
- Waiting for the response from the Node worker.

Once the Node worker completes the process, it will return the data to Go(service) via WebSocket protocol.

## Code Style

To have a good software quality and strong international support, please follow the code styles as below:

- Any label, text or message in front-end or back-end project that will be visible to users should be wrriten in English, and be wrapped by Dot function. (Learn more in i18n setup).
- Any comment for your changes should also be written in English.
- Consider performance and extensibility in your code.

## About i18n Config

Please ensure all text is written in English, for instance:

```Typescript
// "leVsK" -> fragment id
// "This is a {0} project, I like {1}" -> main text
// "awesome" -> {0}
// "LafTools" -> {1}
let str: string = Dot("leVsK","This is an {0} project, I like {1}","awesome","LafTools")

console.log(str) // This is an awesome project, I like LafTools
```

## Next Chapter

Great! You’ve learned the architecture and basic technical detail about this project.

Now, you can click below sections to learn more if you’re still interested.

- How to translate texts by using i18n config?
- How to develop and build for front-end project?
- How to develop and build for back-end project?
- How to write my extension?
- How to run unit tests?
- How to build the binary from source code?

For sure, there's also a FAQ link for your reference.

Lastly, we appreciate that you want to contribute to this project. Should you had any issues or bewilderments, feel free to contact us via Github issue at any time.

Thanks and Regards,
Laftools Team
Loading

0 comments on commit ab464f4

Please sign in to comment.