Giter Site home page Giter Site logo

odoo_translation's Introduction

TOC

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

1. 使用翻译

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

bundle目录,包含

  1. 主要应用的翻译,包含po格式和csv格式,例如account, stock, mrp, project

  2. 全部模块的中文翻译,po格式,zh_CN.po

  3. 全部模块的中文翻译,csv格式,zh_CN.csv

1.1 使用po文件

覆盖po文件

addons目录,和openerp目录包含了常用的i18n 中文翻译包,可以直接直接覆盖系统自带的翻译

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

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

同步术语

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

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 准备工作

申请github账号,略

Fork 翻译项目

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

image

点击 fork 建立一个克隆

Tips:
你必须有github 账号,才可以fork。 给gihub账号申请,不再累述。

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.2 进行翻译工作

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

git checkout master -b project

image

建议在bundle基础上进行翻译

建议使用poedit

image

翻译好之后,保存

2.3 提交翻译成果

保存翻译之后,如果执行命令 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.4 申请合并到master repo.

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

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

image

点击 compare & pull request

image

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

odoo_translation's People

Contributors

jeffery9 avatar leangjia avatar

Watchers

 avatar  avatar

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.