国际化方案Lokalise 使用

一、注册

  1. 地址 https://app.lokalise.com/login
  2. 也可以直接用Github登录

二、下载cli工具

地址:https://github.com/lokalise/lokalise-cli-2-go

1. 打开 PowerShell

2. 下载scoop

win下载命令
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
scoop.png
验证scoop
PS C:\Users\haoyi> scoop help
Usage: scoop  []

Some useful commands are:

alias       Manage scoop aliases
bucket      Manage Scoop buckets
cache       Show or clear the download cache
checkup     Check for potential problems
cleanup     Cleanup apps by removing old versions
config      Get or set configuration values
create      Create a custom app manifest
depends     List dependencies for an app
export      Exports (an importable) list of installed apps
help        Show help for a command
hold        Hold an app to disable updates
home        Opens the app homepage
info        Display information about an app
install     Install apps
list        List installed apps
prefix      Returns the path to the specified app
reset       Reset an app to resolve conflicts
search      Search available apps
status      Show status and check for new app versions
unhold      Unhold an app to enable updates
uninstall   Uninstall an app
update      Update apps, or Scoop itself
virustotal  Look for app's hash on virustotal.com
which       Locate a shim/executable (similar to 'which' on Linux)


Type 'scoop help ' to get help for a specific command.
安装lokalise2
scoop bucket add extras
scoop install lokalise2
提示
PS C:\Users\haoyi> scoop bucket add extras
WARN  The 'extras' bucket already exists. Use 'scoop bucket rm extras' to remove it.
PS C:\Users\haoyi> scoop install lokalise2
WARN  'lokalise2' (2.6.4) is already installed.
Use 'scoop update lokalise2' to install a new version.
PS C:\Users\haoyi>

三、配置Token

token在上传/下载json文件的时候需要用到。


token.png

没有可以新创建


image.png

四、创建项目

create-porject.png

五、项目 ID

ID在上传/下载json文件的时候需要用到。


project-id.png

id.png

六、上传本地语言文件

1、进入开发项目

cmd进入项目目录。
json.png
2、 上传

1.使用命令

lokalise2 --token  --project-id  file upload --file  --lang-iso en

其中token和project-id就是上面获取到的token和项目ID,json文件就是当前目录下对应的json文件路径。


upload.png
  1. 视图上传


    image.png

七、录入语种语言

image.png

八、下载语言文件

1.使用命令

lokalise2 --token  --project-id   file download --format json 
image.png

image.png

2. 视图下载

image.png

你可能感兴趣的:(国际化方案Lokalise 使用)