ONLYOFFICE界面漢化

http://blog.csdn.net/hotqin888/article/details/79337881html

上面連接裏一樣介紹瞭如何漢化和開發。git

我用golang的beego框架開發了文檔管理,實現實時文檔協做。github

首先是安裝docker,而後是拉取document server鏡像,再就是漢化界面,最後是用golang提供回調和存儲編輯後的文檔。golang

漢化的步驟:一、刪除容器裏的文件,替換windows下的字體。docker

 刪除容器 /usr/share/fonts下的全部文件. 而後運行script: documentserver-generate-allfonts.sh 而後清理瀏覽器緩存。windows

 

//進入容器(運行的鏡像)內,刪除/usr/share/fonts下除truetype外其餘文件和文件夾瀏覽器

$ dockerexec -it 38e27 /bin/bash緩存

root@38e27823ae92:/#dir或者ls –albash

 

root@6dfa5705aaef:~#cd /usr/share/fonts/app

root@6dfa5705aaef:/usr/share/fonts#ls

truetype  X11

//刪除文件夾X11

root@6dfa5705aaef:/usr/share/fonts#rm -R dir X11

rm:cannot remove dir: No such file or directory

root@6dfa5705aaef:/usr/share/fonts#ls

truetype

root@6dfa5705aaef:/usr/share/fonts#cd truetype

root@6dfa5705aaef:/usr/share/fonts/truetype#ls –al

root@6dfa5705aaef:/usr/share/fonts/truetype#ls -al

total462392

drwxr-xr-x11 root   root       4096 Feb 19 04:17 .

………………

//刪除trutype文件夾下全部文件,除了custome文件夾外

root@6dfa5705aaef:/usr/share/fonts/truetype#rm -R dir *.*

rm:cannot remove dir: No such file or directory

root@6dfa5705aaef:/usr/share/fonts/truetype#rm -R dir *

rm:cannot remove dir: No such file or directory

rm:cannot remove custom: Device or resource busy

root@6dfa5705aaef:/usr/share/fonts/truetype#ls

custom

root@6dfa5705aaef:/usr/share/fonts/truetype#ls -al

total 12

drwxr-xr-x10 root root 4096 Feb 19 10:14 .

drwxr-xr-x  6 root root 4096 Feb 19 10:12 ..

drwxr-xr-x  2 root root 4096 Feb 19 03:48 custom

……

 

root@6dfa5705aaef:/usr/share/fonts/truetype#exit

exit

 

Administrator@604TFALNDKDKJWCMINGW64 ~/winfont

//將當前文件夾C:\Users\Administrator\下的winfont文件夾內的字體所有拷貝到容器的文件夾/usr/share/fonts/truetype中

$ tar -cv* | docker exec -i 6df tar x -C /usr/share/fonts/truetype

kaiu.ttf

msjh.ttc

msjhbd.ttc

msjhl.ttc

msyh.ttc

msyh.ttf

msyhbd.ttc

msyhl.ttc

simfang.ttf

simhei.ttf

simkai.ttf

simli.ttf

simsun.ttc

simsunb.ttf

simyou.ttf

……

 

Administrator@604TFALNDKDKJWCMINGW64 ~/winfont

//進入容器內

$ dockerexec -it 6df /bin/bash

root@6dfa5705aaef:/#sudo mkfontscale

root@6dfa5705aaef:/#sudo mkfontdir

root@6dfa5705aaef:/#sudo fc-cache -fv

/usr/share/fonts:caching, new cache contents: 0 fonts, 1 dirs

…………

fc-cache:succeeded

root@6dfa5705aaef:/#exit

exit

//退出容器

Administrator@604TFALNDKDKJWCMINGW64 ~/winfont

$ dockerexec 6df /usr/bin/documentserver-generate-allfonts.sh

GeneratingAllFonts.js, please wait...Done

onlyoffice-documentserver:docservice:stopped

onlyoffice-documentserver:docservice:started

onlyoffice-documentserver:converter:stopped

onlyoffice-documentserver:converter:started

 

若是機器重啓後,不要用dockerrun命令,要用dockerstart

具體步驟見圖:

 

而後在調用onlyoffice協同編輯的頁面中,設置"lang": "zh-CN",

[html] view plain copy

  1.                 "editorConfig": {  
  2.                     "callbackUrl": "http://192.168.99.1/url-to-callback?id={{.Doc.Id}}",  
  3.                     "user": {  
  4.                         "id": "{{.Uid}}",  
  5.                         "name": "{{.Uname}}"  
  6.                     },  
  7.                     "lang": "zh-CN",//"en-US",  
  8.                 },  

詳細代碼見http://blog.csdn.net/hotqin888/article/details/79337881

https://github.com/3xxx/EngineerCMS

相關文章
相關標籤/搜索