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

Onesky & i18n-loader guide #2

Open
guan-wy opened this issue Jun 29, 2016 · 0 comments
Open

Onesky & i18n-loader guide #2

guan-wy opened this issue Jun 29, 2016 · 0 comments

Comments

@guan-wy
Copy link
Contributor

guan-wy commented Jun 29, 2016

Onesky & i18n-loader guide

此指南仅用于实现同步本地项目翻译内容至 Onesky

GitHub / teambition / tb-i18n-loader

Guide

  1. 在 Onesky 中创建新项目
    Create New Project in Onesky
  2. 可以先上传已有的翻译文件
    Upload files
  3. getProjectID:可以在 url 中获取 (id.length = 6)
  4. getCredentials:右上角 site settings,选择 API Keys & Usage
    Site Setting
  5. 在开发项目中支持上传与下载同步

Usage

package.json

"tb-i18n-loader": "github:teambition/tb-i18n-loader#v1.4.4"

gulp/onesky.js

var gulp      = require('gulp')
var post      = require('tb-i18n-loader/gulp/post')
var download  = require('tb-i18n-loader/gulp/download')
var sorter    = require('tb-i18n-loader/gulp/sorter')
var tranlsate = require('tb-i18n-loader/gulp/translate')
var util      = require('tb-i18n-loader/gulp/util')

var languages = ['zh', 'en', 'tw', 'ja', 'ko']
var options = {
  projectId: YouProjectID
}

gulp.task('i18n-download', function () {
  return download(languages, options)
    .pipe(sorter())
    .pipe(gulp.dest('locales'))
})

gulp.task('i18n-post', function () {
  return gulp.src('locales/zh.json')
    .pipe(post('zh', options))
})

gulpfile.js

// OneSky tasks
require('./gulp/onesky')

Develop

export ONESKY_SECRET='OneSky Secret'

export ONESKY_API_KEY='OneSky ApiKey'

export TRANSLATE_KEY='Baidu Translate Key'

(OneSky Secret and OneSky ApiKey from guide-4)

上传基础翻译至 Onesky 中:gulp i18n-post

下载所有翻译至开发项目中:gulp i18n-download

Tips

  1. 上传翻译没有反应?
    若字段已经被 Finalized,此时无法通过直接上传文件和 gulp i18n-post 的形式更新该字段内容,可以在如图所示的处勾选全部,取消 Finalized。
    Tips: Undo Finalized
  2. 如何添加截图?
    为了确保翻译的准确性与通用性,建议为所有可能出现的情况进行实际截图,此截图可以采用设计稿的内容。上传完截图可以点击对应截图的 Tag phrases添加字段标识。字段仅通过 base language 进行搜索,应多加注意相同 value 的不同 key 的情况。
    Tips: Screenshots
  3. 如何购买翻译?
    在 Onesky 的项目首页右上角,点击绿色的 Order translation按钮,进入购买翻译界面。确认各项信息是否正确,需要翻译的语言是否选择正确。注意:取消勾选Phrases not yet approvedUpdated phrases since last order。订单确认无误后截图给翻译负责人核对翻译价格完毕之后可以确认购买。需要特别注意翻译周期时间
    Tips: Order translation
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

No branches or pull requests

1 participant