http://blog.csdn.net/hotqin888/article/details/79337881
The above link also describes how to localize and develop.
I developed document management with golang's beego framework to realize real-time document collaboration.
The first is to install docker, then to pull the document server image, then to Chineseize the interface, and finally to use golang to provide callbacks and store edited documents.
The steps of Chineseization: 1. Delete the files in the container and replace the fonts under Windows.
Delete all files under container /usr/share/fonts. Then run script: documentserver-generate-allfonts.sh and clear browser cache.
// Enter the container (running image), delete other files and folders except truetype under /usr/share/fonts
$ dockerexec -it 38e27 /bin/bash
root@38e27823ae92:/#dir or ls –al
root@6dfa5705aaef:~#cd /usr/share/fonts/
root@6dfa5705aaef:/usr/share/fonts#ls
truetype X11
// delete folder 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 .
………………
// Delete all files in the trutype folder, except the custome folder
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
// Copy all the fonts in the winfont folder under the current folder C:\Users\Administrator\ to the container folder /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
// enter the container
$ 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
// exit the container
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
If the machine restarts, do not use the dockerrun command, use dockerstart
The specific steps are shown in the figure:
Then in the page that calls onlyoffice collaborative editing, set "lang": "zh-CN",
- "editorConfig": {
- "callbackUrl": "http://192.168.99.1/url-to-callback?id={{.Doc.Id}}",
- "user": {
- "id": "{{.Uid}}",
- "name": "{{.Uname}}"
- },
- "lang": "zh-CN",//"en-US",
- },
For the detailed code, see http://blog.csdn.net/hotqin888/article/details/79337881
https://github.com/3xxx/EngineerCMS