Skip to content

wyjinter/odoo_translation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOC

    1. 使用翻译
    • 1.1 使用翻译
    • 1.2 导入翻译
    1. 参与翻译
    • 2.1 git操作概述
    • 2.2 准备工作
    • 2.3 进行翻译工作
    • 2.4 提交翻译成果
    • 2.5 申请合并到master repo.

1. 使用翻译

建议使用po bundle,即所有模块的翻译合并在一起的po文件

bundle 目录,包含

  1. 全部常用模块的中文翻译,po格式,zh_CN.po 所有的翻译工作都在此文件的基础上进行

  2. 全部常用模块的中文翻译,csv格式,zh_CN.csv

build 目录 此目录为翻译成果 ,包含

  1. 单个模块的po文件

  2. 以及常用业务功能po文件集合,po budnle

1.1 使用翻译

覆盖po文件

build/odoo目录包含了常用模块的i18n 中文翻译包,可以用来直接覆盖系自带的翻译

使用 build/odoo 目录 覆盖 odoo 目录

同步术语

至菜单 翻译 - 应用程序术语 - 同步术语

image

选择语言 简体中文, 点击按钮 更新

1.2 导入翻译

图形方式

至 导入/导出,选择 导入翻译

alt tag

如果你没有看到 导入/导出 , 那是因为你的账号没有开启‘技术特性’权限

在弹窗

alt tag

输入 语言名 以及代码, 并选择下载的 po 文件 勾选 覆盖已存在的术语

field value
语言名 Chinese (CN) / 简体中文
代码 zh_CN

Tips:

导入翻译之前,最好先删除旧有的翻译, odoo 翻译导入的overwrite选项似乎不起作用

参考下面

alt tag

至菜单 "已翻译术语"

设置筛选器 语言,比如 Chinese (CN) / 简体中文

alt tag

以及相关模块,比如 account

alt tag

这样会列出全部与account模块相关的已翻译术语

alt tag

可以修改 列表显示数量,以便可以列出全部的与account模块相关的已翻译术语

选择全部,然后删除。

命令行方式

使用下面的命令导入翻译.

 # !/bin/bash
 python openerp-server -c $openerp.conf --stop-after-init -d $database -l zh_CN --i18n-import=$po_file --overwrite

2. 参与翻译

翻译时参考 词汇表

repo 是repository的缩写, 即 库

master repo 是指主库,即 https://github.com/odoo-cn/odoo_translation.git

fork repo 是指你的克隆

2.1 git操作概述

同步master repo

git pull master master  # 第一个master 是指 master repo ; 后一个master 是指 master 分支。

建立翻译工作的分支

git checkout -b new_branch  # new_branch 是指进行翻译工作的分支,必须建立,否则无法申请pull request

将翻译分支发布到你在github的 repo.

git push --all origin  # 将分支发布到github 

申请pull request...

略,参考 申请合并到master repo.

2.2 准备工作

申请github账号,略

Fork 翻译项目

至master repo.的github页面 https://github.com/odoo-cn/odoo_translation

image

点击 fork 建立一个克隆

Tips:
你必须有github 账号,才可以fork。

fork需要一定的时间

image

Fork 好之后,就可以在你的github账号下看到你的fork

image

将fork repo 克隆到本地

在github上选择repo的 URL, 最好选择 ssh。 因为github上传你的提交需要使用ssh进行无密码验证身份。

image

克隆repo.

执行命令 git clone 如

image

更新repo

因为在你fork odoo-cn/odoo_translation 之后, master repo.可能已经更新了,为了保持你的repo.为最新,你需要 与master repo.同步

首先,添加master repo. 到你的库里,执行命令

git remot add https://github.com/odoo-cn/odoo_translation.git

image

同步主库,执行命令

git pull master master # 后一个master是 分支的名字

image

此时,你的本地库与odoo-cn/odoo_translation主库是同步的。

2.3 进行翻译工作

首先为翻译工作建立一个分支,例如 project

git checkout master -b project

image

建议在bundle基础上进行翻译

建议使用poedit

image

翻译好之后,保存

2.4 提交翻译成果

保存翻译之后,如果执行命令 git status

会发现修改的po文件会显示

image

如果执行命令 git diff 还可以查看 修改的部分,例如

image

提交修改

翻译成果需要提交到repo里面, 使用以下命令提交修改

git add *.po

git commit -m ‘提交的消息’ # ‘提交的消息’ 为摘要信息,方便其他人查看,以及备将来自己查看。

例如

image

将本地repo 同步到fork repo

需要将本地的repo 同步到 fork repo,这样其他协作的人才能看到你的工作成果。

执行命令 git push --all origin 进行同步,如

image

完成同步之后,去你的github,可以看到提交的工作成果。

image

你可以看到你提交的工作成果

2.5 申请合并到master repo.

你的本地修改提交到你的fork repo之后,还需要合并到master repo,这样,其他与人协作的人才能使用你的工作成果。

在你进行提交的时候,github能识别到你的新分支和提交,它会建议你提交一个pull request, 如

image

点击 compare & pull request

image

填写提交信息,然后 create pull request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%