https://github.com/xyy94813/mdn-site
A repository for participating in MDN translation.
https://github.com/xyy94813/mdn-site
Last synced: 8 months ago
JSON representation
A repository for participating in MDN translation.
- Host: GitHub
- URL: https://github.com/xyy94813/mdn-site
- Owner: xyy94813
- License: mit
- Created: 2024-04-20T13:01:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-26T13:05:50.000Z (9 months ago)
- Last Synced: 2025-01-26T14:19:33.632Z (9 months ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - xyy94813/mdn-site - Helper scripts for MDN translation tasks, such as initializing an environment, copying specific files, and adding origin commit hashes to translated files in `mdn/translated-content`. (Contributor tools)
- awesome - xyy94813/mdn-site - Helper scripts for MDN translation tasks, such as initializing an environment, copying specific files, and adding origin commit hashes to translated files in `mdn/translated-content`. (Contributor tools)
README
# mdn-site
A repository for participating in MDN translation.
## What does this repo do?
- Use [mdn/content](https://github.com/xyy94813/content) and [mdn/translate-content](https://github.com/xyy94813/translated-content.git) as submodules.
(_Note:I use my fork repo as submodules, you should use your own fork repo~_)
- provide some scripts for translate work
- init_env
- cp_files
- ...others will todo
## Scripts
### Scripts: init_env
Init the `.env` files for "mdn/content" rpeo.
```sh
bash init_env
```
### Scripts: cp
Copy files quickly in root of this project
```sh
npm run cp ORIGIN_EN_CONTENT_SOURCE [LANG]
```
Example:
```sh
# Will copy all files in `web/api/audio_output_devices_api` to `translated-content/files/zh-cn/web/api/audio_output_devices_api`
npm run cp content/files/en-us/web/api/css_counter_styles
# You can pass the second args to select language.
npm run cp content/files/en-us/web/api/css_counter_styles fr
```
### Scripts: add_l10n
Add origin file git commit hash to translated file.
> Note: it will add commit hash again if you run many times!!!
```sh
npm run update:l10n TRANSLATED_DOC_DIR_OR_FILE
```
Example:
```sh
npm run update:l10n ./translated-content/files/zh-cn/web/api/serviceworkerglobalscope/
```
## LICENSE
[MIT](./LICENSE) RoXoM xyy94813@sina.com