Giter Site home page Giter Site logo

odoo_translation's Introduction

TOC

在线演示链接

可以在此查看安装了此汉化成果的odoo实例 odoouse.cn

用户名 demo

密码 demo

0. 翻译策略 [guide]

先在 src/zh_CN.po的基础上完成翻译;因为有大量重复的词汇、短语,所以这样能节省时间

原则

  • base 模块里面关于其他模块的说明,无需翻译

  • {} 包含的是 JS代码,无需翻译

  • [] 包含的是 domain,无需翻译

  • 原文里面 包含的html 标签,必须原样保留,无需翻译

  • 贴近原文,符合专业标准

  • 优先评审现有的中文翻译,评审时,参考 术语表 以及其他的翻译

  • 优先翻译目前是英文的语句, 翻译之前,参考 术语表 以及其他的翻译

  • 其次为长语句,长段落

  • 第一阶段的任务对象是 src/zh_CN.po

src/zh_CN.po完全翻译之后,再在build/odoo 目录的单个po文件上优化翻译,针对不同的应用,进行优化。

1. 使用翻译 [use_it]

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

src 目录,包含

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

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

build 目录 翻译成果 ,包含

1. 模块的po文件, 按odoo addons目录结构 存放在 odoo目录下

2. 业务功能po文件集合,按业务功能命名 存放在 bundle目录下

scripts 目录,包含

1. po文件 构建脚本

2. po文件 部署脚本

reference 目录,包含

1. 专业词典 【会计词典】

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. 参与翻译 [improve_it]

翻译时参考 词汇表

repo 是repository的缩写, 即 库

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

fork repo 是指你的克隆

2.1 git操作概述 [git_overview]

增加master repo

git remote add  master https://github.com/odoo-cn/odoo_translation.git # 增加 master repo 地址。

同步master repo

git checkout master  # 切换至master分支

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

建立翻译工作的分支

git checkout master  # 切换至master分支

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

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

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

申请pull request...

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

更详细情况,请阅读下面部分

2.2 准备工作 [prepare]

申请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 master https://github.com/odoo-cn/odoo_translation.git

image

同步主库,执行命令

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

image

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

2.3 进行翻译工作 [working]

首先为翻译工作建立一个分支,例如 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

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.