Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translate doc to zh #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 17 additions & 47 deletions docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,45 +81,34 @@
<a href='#json'>%decoding_json</a>
<a href='#testing'>%testing</a>
<a href='#memory'>%memory_management</a>
<a href='#defer'>Defer</a>
<a href='#orm'>ORM</a>
<a href='#vfmt'>vfmt</a>
<a href='#defer'>%defer</a>
Copy link
Member

@dhonx dhonx Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think defer, ORM, VFMT doesn't need to be translated into another language

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reverted related change of defer , ORM and vfmt.

<a href='#orm'>%orm</a>
<a href='#vfmt'>%vfmt</a>
<a href='#writing_docs'>%writing_documentation</a>
<br>
Advanced Topics
%advanced_topics

<br>
<br>
<a href='#calling_c'>Calling C functions from V</a>
<a href='#comp_if'>Compile time if</a>
<a href='#codegen'>Reflection via codegen</a>
<a href='#op'>Limited operator overloading</a>
<a href='#asm'>Inline assembly</a>
<a href='#cpp'>Translating C/C++ to V</a>
<a href='#hot'>Hot code reloading</a>
<a href='#cross'>Cross compilation</a>
<a href='#bash'>Cross-platform shell scripts in V</a>
<a href='#calling_c'>%calling_c_func_from_v</a>
<a href='#comp_if'>%compile_time_if</a>
<a href='#codegen'>%refl_via_codegen</a>
<a href='#op'>%limited_operator_overloading</a>
<a href='#asm'>%inline_assembly</a>
<a href='#cpp'>%trans_cxx_to_v</a>
<a href='#hot'>%hot_code_reloading</a>
<a href='#cross'>%cross_compile</a>
<a href='#bash'>%cross_scripts_in_v</a>
<br>
<a href='#keywords'>Appendix I: Keywords</a>
<a href='#operators'>Appendix II: Operators</a>
<a href='#keywords'>%appd_1_keywords</a>
<a href='#operators'>%appd_2_operators</a>

</div>


<div class='docs'>
<h2 id=introduction style='border:0; margin-top:0; padding-top:20px;'>%introduction</h2>
V is a statically typed compiled programming language designed for building maintainable software.

<p>
It's similar to Go and is also influenced by Oberon, Rust, Swift.

<p>
V is a very simple language. Going through this documentation will take you about half an hour,
and by the end of it you will learn pretty much the entire language.

<p>
Despite being simple, it gives a lot of power to the developer. Anything you can do in other languages,
you can do in V.
%intro_details

<!--
<p>
Expand All @@ -134,26 +123,7 @@ <h2 id=hello>Hello World</h2>
}</pre>

<input class='run' type='button' value='Run'>

<p>
Functions are declared with <code>fn</code>. Return type goes after the function
name. In this case <code>main</code> doesn't return anything, so the type is
omitted.

<p>
Just like in C and all related languages, <code>main</code> is an entry point.

<p>
<code>println</code> is one of the few built-in functions. It prints the value
to standard output.

<p><code>fn main()</code> declaration can be skipped in one file programs.
This is useful when writing small programs, "scripts", or just learning
the language. For brevity, <code>fn main()</code> will be skipped in this
tutorial.

<p>
This means that a "hello world" program can be as simple as
%fn_intro

<pre>
println(<str>'hello world'</str>)
Expand Down
72 changes: 72 additions & 0 deletions en.tr
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,90 @@ fast_comp4
no_null
No null
-----
references
References
-----
defer
Defer
-----
orm
ORM
-----
vfmt
vfmt
-----
writing_documentation
Writing documentation
-----
advanced_topics
Advanced Topics
-----
calling_c_func_from_v
Calling C functions from V
-----
compile_time_if
Compile time if
-----
refl_via_codegen
Reflection via codegen
-----
limited_operator_overloading
Limited operator overloading
-----
inline_assembly
Inline assembly
-----
trans_cxx_to_v
Translating C/C++ to V
-----
hot_code_reloading
Hot code reloading
-----
cross_compile
Cross compilation
-----
cross_scripts_in_v
Cross-platform shell scripts in V
-----
appd_1_keywords
Appendix I: Keywords
-----
appd_2_operators
Appendix II: Operators
-----
intro_details
V is a statically typed compiled programming language designed for building maintainable software.

<p>
It's similar to Go and is also influenced by Oberon, Rust, Swift.

<p>
V is a very simple language. Going through this documentation will take you about half an hour,
and by the end of it you will learn pretty much the entire language.

<p>
Despite being simple, it gives a lot of power to the developer. Anything you can do in other languages,
you can do in V.
-----
fn_intro
<p>
Functions are declared with <code>fn</code>. Return type goes after the function
name. In this case <code>main</code> doesn't return anything, so the type is
omitted.

<p>
Just like in C and all related languages, <code>main</code> is an entry point.

<p>
<code>println</code> is one of the few built-in functions. It prints the value
to standard output.

<p><code>fn main()</code> declaration can be skipped in one file programs.
This is useful when writing small programs, "scripts", or just learning
the language. For brevity, <code>fn main()</code> will be skipped in this
tutorial.

<p>
This means that a "hello world" program can be as simple as
-----

76 changes: 76 additions & 0 deletions zh.tr
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ pure_fns
high_fns
高阶函数
-----
references
引用
-----
constants
常量
-----
Expand Down Expand Up @@ -139,6 +142,79 @@ testing
memory_management
内存管理
-----
defer
延迟执行
-----
orm
对象关系表映射
-----
vfmt
格式化
-----
writing_documentation
书写文档
-----
advanced_topics
高级特性
-----
calling_c_func_from_v
从V语言调用C函数
-----
compile_time_if
条件编译
-----
refl_via_codegen
通过codegen的反射
-----
limited_operator_overloading
有限制的算符重载
-----
inline_assembly
内联汇编
-----
trans_cxx_to_v
把C/C++代码转成V
-----
hot_code_reloading
代码热替换
-----
cross_compile
交叉编译
-----
cross_scripts_in_v
跨平台的V脚本Cross-platform shell scripts in V
-----
appd_1_keywords
附录 I: 关键字
-----
appd_2_operators
附录 II: 操作符
-----
intro_details
V语言是一种静态类型的编译语言。设计用于构建可维护软件的。

<p>
它和Go语言很类似,并且受到了Oberon, Rust和Swift语言的影响。

<p>
V是非常简单的语言. 阅读本文档将花费您大约半小时, 阅读后您将学到几乎所有的语言特性。

<p>
尽管它很简单, 但是它可以给开发者很多的能力。通过其它语言可以做的事,通过V一样可以做到。
-----
fn_intro
<p>
函数通过<code>fn</code>声明。返回值的类型在函数名之后。在<code>main</code>函数这个例子中没有返回值,所以类型可以省略。

<p>
和C语言以及其它语言一样,, <code>main</code>函数是程序入口。

<p>
<code>println</code>是一个内置函数。它会打印到标准输出。

在单文件的程序中,<p><code>fn main()</code>函数的声明可以省略。
在写很小的程序或者脚本,或者是学习语言的时候,这一点非常有用。为了更加简洁, 本文档省略<code>fn main()</code>。

<p>
这意味这"hello world"程序可以简写为
-----