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

RFC: use Transifex as our translation platform #19

Merged
merged 9 commits into from
Aug 13, 2018
Merged

Conversation

Gnimuc
Copy link
Member

@Gnimuc Gnimuc commented Aug 5, 2018

This is basically working now. I'll write detailed workflow later on maybe tomorrow.

@Gnimuc
Copy link
Member Author

Gnimuc commented Aug 6, 2018

在CI上,文档编译到stdlib相关的地方会出现一个奇怪的错误: https://travis-ci.org/JuliaCN/JuliaZH.jl/jobs/412598141#L567 但是我在本地编是正常的:

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-rc1.0 (2018-07-31 20:29 UTC)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-apple-darwin17.7.0

julia> ┌ Warning: The start/next/done iteration protocol is deprecated. Implement `iterate(::Tokenize.Lexers.Lexer{Base.GenericIOBuffer{Array{UInt8,1}},Tokenize.Tokens.Token})`.
│   caller = ip:0x0
└ @ Core :-1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1646k  100 1646k    0     0   130k      0  0:00:12  0:00:12 --:--:--  254k
Documenter: setting up build directory.
Documenter: expanding markdown templates.
Documenter: building cross-references.
Documenter: running document checks.
 !! Skipped doctesting.
 > checking footnote links.
Documenter: populating indices.
Documenter: rendering document.
 !! Overwriting 'build/assets/arrow.svg'.
 !! Overwriting 'build/assets/documenter.js'.
 !! Overwriting 'build/assets/search.js'.
 !! Overwriting 'build/assets/documenter.css'.
 !! Invalid local link: unresolved path
    '../base/#Base.missing' in base/collections.md
 !! Invalid local link: unresolved path
    '../base/#Base.missing' in base/collections.md
julia>

@Gnimuc
Copy link
Member Author

Gnimuc commented Aug 6, 2018

此PR大部分内容是从transifex同步的译文,需要check的有:

  1. transifex客户端的配置文件 .tx/config
  2. .travis.yml 为了能让CI监控文档编译的过程,我把Documenter的编译脚本提到了script里
  3. doc/make.jl 文档编译几乎跟Julia官方一致,本来希望能fix 配置stdlib #5 , 但现在来看仍有bug

@Roger-luo
Copy link
Member

这PR我们不妨等等1.0的正式release再开始merge吧。

@Roger-luo
Copy link
Member

transifex同步下来的文档是直接替换 docs/src 里面的文件?那么原文是怎么保存的?

Copy link
Member

@Roger-luo Roger-luo left a comment

Choose a reason for hiding this comment

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

我没看到最后译文从transifex上同步下来是什么样子?还是在markdown里面?还是说有一个什么中间格式?然后就是docstring要怎么解决?

@@ -0,0 +1,653 @@
[main]
Copy link
Member

Choose a reason for hiding this comment

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

我比较好奇,这个配置文件是手写的嘛?还是说有自动生成的工具?如果不是自动生成的我觉得最好能写到make.jl里面自动生成?

Copy link
Member Author

Choose a reason for hiding this comment

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

执行tx config mapping-remote “project-URL”会自动生成这个文件,但是file_filter路径是默认的,我这里手动批量修改了一下路径,以便和Documenter要求的一致。

doc/make.jl Outdated

baremodule GenStdLib end
@isdefined(build_sysimg) || @eval module BuildSysImg
include(joinpath(@__DIR__, "..", "contrib", "build_sysimg.jl"))
Copy link
Member

Choose a reason for hiding this comment

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

重新编译一个sysimg我印象中不需要,我们只需要把stdlib里面的拿出来(复制出来即可),sysimg里面的docstring可以直接调用下载下来的Julia(当前运行这个script的Julia)。

@Gnimuc
Copy link
Member Author

Gnimuc commented Aug 7, 2018

这PR我们不妨等等1.0的正式release再开始merge吧。

嗯,不着急merge,等等大家对transifex平台的使用反馈。

transifex同步下来的文档是直接替换 docs/src 里面的文件?那么原文是怎么保存的?

我没看到最后译文从transifex上同步下来是什么样子?还是在markdown里面?还是说有一个什么中间格式?然后就是docstring要怎么解决?

对于Markdown,transifex只同步译文(也是Markdown格式),不同步原文,原文是在transifex上配置的URL,会自动和Julia repo同步。

对于docstrings, 可以利用Localize生成.po原文,然后通过transifex的客户端,tx push到transifex上,在翻译之后,用tx pull --all同步译文和原文的.po文件。

@Roger-luo
Copy link
Member

我看了一下,stdlib路径你在本地是正确的吗?如果是在Linux上会装在share下面,但是这个make是源代码里面的make,目录的路径不一样。

@Roger-luo
Copy link
Member

@Gnimuc 我们在这个PR里先不要管stdlib吧,然后集中到另外一个比如 #11 再说。先搞定用transifex翻译manual的这个过程。我觉得你可以先吧make改回去,然后我们把transifex上的更新到gh-pages

@Gnimuc
Copy link
Member Author

Gnimuc commented Aug 12, 2018

@Roger-luo OK, stdlib的问题我新开个PR

@Gnimuc Gnimuc changed the title WIP: use Transifex as our translation platform(DO NOT MERGE) use Transifex as our translation platform Aug 12, 2018
@Gnimuc Gnimuc changed the title use Transifex as our translation platform RFC: use Transifex as our translation platform Aug 12, 2018
@Gnimuc
Copy link
Member Author

Gnimuc commented Aug 12, 2018

@Roger-luo rebase好了

@Roger-luo
Copy link
Member

OK,great job。我早上review一下就merge

@Roger-luo Roger-luo merged commit b4f2947 into master Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants