GithubHelp home page GithubHelp logo

rescript-idea / rescript-lang.org-chinese-translation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rescript-association/rescript-lang.org

16.0 1.0 17.0 13.13 MB

ReScript语言官方网站 https://rescript-lang.org/ 的中文翻译

Home Page: https://rescript-idea.github.io/

License: MIT License

JavaScript 58.03% CSS 2.55% Makefile 0.03% HTML 0.97% ReScript 38.42%

rescript-lang.org-chinese-translation's Introduction

Contributor Covenant

rescript-lang.org

This is the official documentation platform for the ReScript programming language.

In case you want to report a technical issue, please refer to the appropriate repository:

In case you are missing some specific documentation:

  • Some language / compiler feature may not be documented yet
  • Create an issue to let us know what you are missing
  • In case you want to contribute missing docs, please refer to our Contribution section

System Requirements

Setup

# For first time clone / build (install dependencies)
npm i

# Only needed for initial clone (or content H2 changes)
npm run update-index

# Initial build
npx rescript

# Build the index data
npm run update-index

# In a new tab
npm run dev

open localhost:3000

In case you want to run ReScript in watchmode:

npx rescript build -w

Build Index Data

We are parsing our content for specific index data (such as, all interesting search terms we need for searching inside the Belt docs). You can create your index by running following command:

npm run update-index

All the index data is stored in index_data, but will not be tracked by git. Make sure to build the index after a fresh clone, otherwise Next might not build specific pages (file index_data/x.json not found).

Project Structure Overview

  • data: Contains hand-curated data, such as sidebar ordering, blog data, etc
  • index_data: Contains generated data, usually generated by scripts like scripts/extract-tocs.js
  • compilers: Contains a subdirectory with independently installed ReScript compilers, to be able to compile / test examples with different ReScript versions
  • misc_docs: Contains pages independent resources that are embedded in miscellaneous pages (e.g. for the syntax lookup)
  • pages: All Next pages. Those are written in JS / MDX, some pages are re-exporting ReScript based pages from the src/ directory.
  • styles: Contains all extra CSS that cannot be expressed with Tailwind
  • src: Contains all ReScript related code for the UI. Within src, you will also find all ReScript based Next pages that are re-exported in the pages directory
    • /bindings: (Zero-cost) bindings to JS libraries / apis
    • /common: ReScript modules that are neither bindings, nor components
    • /components: ReScript / React components used by multiple pages
    • /ffi: (to be deprecated) Plain JS that some ReScript code binds to (use raw statements for that)
    • /layouts: All Next layouts used in our pages. Check out src/common/App.res for mapping layouts to routes
  • plugins: Contains plugins for all kinds of things: HighlightJS, MDX, webpack loader, etc.
  • scripts: Contains a mix of JS / ReScript based scripts that do all kind of code generation / code introspection logic
  • tailwind.config.js: Contains our Tailwind configuration for all the low level design tokens

Run Tests

Markdown Codeblock Tests

We check the validity of our code examples marked with:

  • ```res example (ReScript code snippet)
  • ```res sig (signature)
  • ```res prelude (ReScript code snippet available for all subsequent code snippets)

Run the checks with:

node scripts/test-examples.mjs

Markdown Hyperlink Tests

We are also verifying markdown href links to relative resources (via [text](url) syntax) with our scripts/test-hrefs.js script. Here is a short explanation on how the href testing works:

Domain relative links, such as /docs/manual/latest, ./introduction, introduction, /docs/foo/introduction.md will be verified. That means the tester will check if given path exists in the pages directory.

If there are any anchor refs, such as /docs/manual#test, then the anchor will be ignored for the specific file path check. If there are any hrefs with .md, .mdx or .html file extension, then those will be stripped before the check happens (the markdown renderer drops file extensions on relative links as well).

External hrefs, such as https://www.hello.world, //www.hello.world will NOT be checked since they are assumed to be external resources.

Here is an example on how to run the tests:

# Tests all files
node scripts/test-hrefs.mjs

# Or just a subset (glob pattern)
node scripts/test-hrefs.mjs "pages/docs/manual/**/*.mdx"

Continous Integration

Always make sure to run npm test before pushing any content, otherwise our CI might trigger a failure warning. Failing branches are very unlikely to be merged.

Design / UX

Design mockups can be found here.

Be aware that some screen designs might still be work in progress, if you have any design / UX questions, either comment directly on the design tool as guest, or open an issue.

Useful commands

Build CSS seperately via npx postcss (useful for debugging)

# Devmode
npx postcss styles/main.css -o test.css

# Production
NODE_ENV=production npx postcss styles/main.css -o test.css

Writing Blog Posts

In case you are a blog author, please refer to our guide on writing blog posts.

How to Add Your Company Logo to Our Front Page

In case your company is a user of ReScript and wants to be displayed on our front page ("Trusted by our users" section), do the following:

  • Get your logo as a black / white .svg version and use #979AAD as a fill color (check out the existing logos on our front page).
  • Put your logo into the public/static/lp folder; the file should be named after your company.
  • Open src/common/OurUsers.res and add your info
  • Commit, push, and open a PR.

Contributing

Please make sure to first read and comply to our Code of Conduct and check out our CONTRIBUTING.md file to learn how to get started with our contribution process!

rescript-lang.org-chinese-translation's People

Contributors

a-c-sreedhar-reddy avatar baransu avatar bdunn313 avatar bettistein avatar bobzhang avatar bodhish avatar butterunderflow avatar chenglou avatar cristianoc avatar fhammerschmidt avatar include-yy avatar jdeisenberg avatar jeong-sik avatar kellydanma avatar kevanstannard avatar kirisky avatar kmq116 avatar lessp avatar minnozz avatar moox avatar nikgraf avatar oakland avatar ryyppy avatar srikanthkyatham avatar sync avatar weakish avatar wendraw avatar wontheone1 avatar yj-qin avatar zth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rescript-lang.org-chinese-translation's Issues

翻译的最终收尾工作 🎉

在大家的共同努力下, ReScript 语言手册的中文文档的翻译和校对工作已经初步完成了. 这里要感谢翻译/校对小队每一位同学的帮助, ReScript的推广普及离不开你们的共同支持! 🤝

在这里要特别感谢 include-yy 同学, 日夜兼程完成了绝大部分的校对工作(大佬注意休息🌙). 接下来 include-yy 将继续进行全文的最终检查和风格统一工作, 还请大家短时间内不要发起PR. 如果有任何问题请随时发起issue或者在微信沟通, 再次感谢大家的帮助❤

翻译工作流程

翻译的进度放在这个issue中同步:
目前的中文文档在这里.
可以在中文文档页面查看翻译后的中文文档

翻译规范

为了便于校对, 目前是在翻译后的文档中保留了官方文档原文的.

和之前略有不同的是, 这一次请在翻译的时候就直接注释掉英文原文

<!-- 
Ever wanted a language like JavaScript, but without the warts, with a great type system, and with a lean build toolchain that doesn't waste your time?
-->

想要一个Javascript一样的编程语言, 但是没有先天缺陷, 而是有一个更好的类型系统, 和一整套不会浪费你时间的简洁易用的构建工具链吗?

对于列表, 请将原来的英文列表和翻译的列表分开, 如:

<!-- 
Unreadable JavaScript code generated from other compiled-to-js languages makes it so that it could be, practically speaking:

- Hard to debug (cryptic stack trace, mangled variable names)
- Hard to learn from (non-straightforward mapping of concepts from one language to another)
- Hard to profile for performance (unclear what runtime performance cost there is)
- Hard to integrate with existing hand-written JS code
-->

<!--
其他编译到JS的语言生成的不可读的JavaScript代码使得它们:
- 难以调试(模糊的堆跟踪, 混乱的变量名)
- 难以学习(不存在一种语言到另一种语言的概念上的映射)
- 难以分析其性能(对于代码的运行时性能消耗是不清晰的)
- 难以集成到现有手写的JS代码项目
-->

如果你在使用VSCode, 可以通过 Ctrl + Shift + P -> change language mode -> markdown 修改当前的语言模式为 markdown, 这样就可以通过 Shift + Ctrl + A 注释了.
也可以使用 OlingCat 写的翻译插件, 安装插件后, 按 alt + D 可以注释掉当前段落并在下方复制原文.

标点符号

请尽量采用中文的标点符号(如果输入法不方便也可以用英文标点, 由小助手后续统一调整)

不确定的术语

对于不确定的术语, 可以在译文中保留原文术语或采用临时翻译. 并在这个issue下补充: #1

翻译合作方式

opened issue中列出了所有未翻译的章节, 如果你愿意开启一个章节的翻译, 请直接在对应的issue下留言.

校对工作也是欢迎的哈, 如果你阅读了某一章节, 并且认为这一章翻译不存在有争议的部分, 欢迎参与校对工作, 进一步细节请移步这个issue
#3

再次感谢大伙们的热情相助!

校对工作流程

校对的主要工作:

  1. 是否按照原意翻译完全, 是否存在漏翻、错翻的现象
  2. 确认翻译的段落是否通顺
  3. 对于专业名词, 请确认是否按照术语表 进行翻译

如果校验过程中发现上述问题, 请直接修改后发起PR,
校对方式:
对一个段落校对完毕后, 通过注释语法注释掉英文原文, 如:

Ever wanted a language like JavaScript, but without the warts, with a great type system, and with a lean build toolchain that doesn't waste your time?

想要一个Javascript一样的编程语言, 但是没有先天缺陷, 而是有一个更好的类型系统, 和一整套不会浪费你时间的简洁易用的构建工具链吗?

校对后请修改为:

校对后请修改为:

<!-- 
Ever wanted a language like JavaScript, but without the warts, with a great type system, and with a lean build toolchain that doesn't waste your time? 
-->

想要一个Javascript一样的编程语言, 但是没有先天缺陷, 而是有一个更好的类型系统, 和一整套不会浪费你时间的简洁易用的构建工具链吗?

对于标题校对完毕后, 删除英文原文后, 新加一条包含原文的注释, 如:

## Introduction | 引言

校对后请修改为:

<!--
## Introduction 
-->
## 引言

注意:: <!--, 原文--> 分别出现在三行

如果你愿意接手一个章节的校对工作, 请在这个issue下留言, 或者直接发起一个新的issue, 我会更新这个表格和project的进度.

校对工作进度:

剩余章节 校对
Introduction butterunderflow
Installation include-yy
Editor Plugins include-yy
Migrate to ReScript Syntax include-yy
Try include-yy
Overview include-yy
Let Binding include-yy
Type include-yy
Primitive Types butterunderflow, include-yy
Tuple butterunderflow
Record butterunderflow
Object butterunderflow
Variant butterunderflow
Polymorphic Variant include-yy
Null, Undefined and Option include-yy
Array & List include-yy
Function include-yy
If-Else & Loops butterunderflow
Pipe butterunderflow
Pattern Matching / Destructuring butterunderflow
Mutation oakland
JSX butterunderflow
Exception butterunderflow
Lazy Value butterunderflow
Async & Promise include-yy
Module butterunderflow
Import & Export include-yy
Attribute (Decorator) include-yy
Unboxed include-yy
Reserved Keyword kirisky
Extensible Variant include-yy
Interop Cheatsheet include-yy
Embed Raw JavaScript include-yy
Shared Data Types include-yy
External (Bind to Any JS Library) include-yy
Bind to JS Object include-yy
Bind to JS Function include-yy
Import from / Export to JS include-yy
Bind to Global JS Values include-yy
JSON include-yy
Inlining Constants include-yy
Use Illegal Identifier Names include-yy
Generate Converters & Helpers include-yy
Browser Support & Polyfills include-yy
Libraries & Publishing include-yy
Overview(Build System) butterunderflow
Configuration butterunderflow
Configuration Schema butterunderflow
External Stdlib butterunderflow
Pinned Dependencies butterunderflow
Interop with JS Build Systems butterunderflow
Performance oakland
Warning Numbers butterunderflow

术语表和部分不确定的翻译 (Glossary and some uncertain translations)

名词 中文含义 翻译
Exhaustive check 检查模式匹配是否覆盖了所有可能的模式 穷举性检查
Mutate - 修改, 变动
Unboxed - 拆箱
Module ReScript程序的组成单位 模块
Spread 取决于上下文可能有不同的含义:既可以值ReScript中对列表或记录值的一种操作, 将一个列表/记录 "展开" 到另一个列表/记录; 也可能只是指值的传播 展开/传播
Shape 文档中指的是不同的不同的变体有着不同的shape 形状
Extensible Variant ReScript中的一种变体类型, 可以被扩展创建新的变体 可扩展变体
External 指ReScript中的一类绑定, 但是其绑定值在JavaScript中实现 external
Functor ReScript中模块级别的函数 仿函数
heterogeneous 指一个容器可以包含多种类型的元素 异构性
prepend 指向一个列表头部插入元素 头插操作

I'm not sure of the translation of some jargon, so I'll list them here for now.
关于文档翻译的不确定的部分, 在这里列出.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.