├── BiliConfig.rb ├── BiliFile.rb ├── BiliGui.rb ├── BiliPlaylist.rb ├── BiliWeb.rb ├── BiliWidgets.rb ├── README.md ├── data ├── 2014-hw.jpg ├── BiliGui.desktop ├── bilibili.png ├── bilibili.svgz ├── screenshot.png └── style.qss ├── demo └── demo.m3u8 ├── doc ├── AUTHORS ├── COPYING ├── ChangeLog ├── THANKS └── TODO └── po ├── BiliGui.pot ├── BiliGui.zh_CN.mo ├── BiliGui.zh_CN.po ├── BiliGui.zh_TW.mo ├── BiliGui.zh_TW.po └── scripts ├── README_SCRIPTS ├── install.sh ├── merge.sh └── update_pot.sh /BiliConfig.rb: -------------------------------------------------------------------------------- 1 | module BiliConfig 2 | 3 | require_relative 'BiliFile' 4 | 5 | class BiliConf 6 | 7 | include BiliFile 8 | 9 | $userHome = `echo $HOME`.gsub(/\n/,"") 10 | $configPath = File.join($userHome,".config/BiliGui") 11 | $playlistPath = File.join($configPath,"playlist") 12 | 13 | def initialize(name="biligui.conf", path=$configPath) 14 | 15 | @name = name 16 | @path = path 17 | 18 | unless Dir.exist?(@path) then 19 | Dir.mkdir @path 20 | end 21 | 22 | unless Dir.exist?(File.join(@path,"playlist")) then 23 | Dir.mkdir(File.join(@path,"playlist")) 24 | end 25 | 26 | @config = File.join(path, name) 27 | @configEntries = {} 28 | 29 | unless File.exist?(@config) then 30 | biliTouch(@config) 31 | else 32 | io = File.open(@config, "r") 33 | io.each_line do |line| 34 | line.chomp! 35 | key = line.gsub(/=.*/,"") 36 | if line.index("mpvflags") then 37 | value = line.gsub(/mpvflags=/,"") 38 | elsif line.index("danmaku2assflags") then 39 | value = line.gsub(/danmaku2assflags=/,"") 40 | else 41 | value = line.gsub(/.+=/,"") 42 | end 43 | @configEntries[key] = value 44 | end 45 | io.close 46 | end 47 | 48 | end 49 | 50 | def put(key, value) 51 | 52 | # if Key exists, then we should delete 53 | if @configEntries.key?(key) then 54 | 55 | biliMove(@config,"! line.index('" + key + "')") 56 | 57 | end 58 | 59 | io = File.open(@config, "a") 60 | io.puts("#{key}=#{value}") 61 | io.close 62 | end 63 | 64 | def load 65 | return @configEntries 66 | end 67 | 68 | end 69 | 70 | end 71 | -------------------------------------------------------------------------------- /BiliFile.rb: -------------------------------------------------------------------------------- 1 | module BiliFile 2 | 3 | require 'fileutils' 4 | 5 | def biliMove(file, newfile=file, condition) 6 | 7 | tmp = file + ".tmp" 8 | 9 | open(file, 'r') do |f0| 10 | open(tmp, 'w') do |f1| 11 | f0.each_line do |line| 12 | 13 | status = true 14 | code = eval(condition) 15 | 16 | if code != nil then 17 | if code == false then 18 | status = false 19 | else 20 | if code != true then 21 | if code > 0 then 22 | status = true 23 | else 24 | status = false 25 | end 26 | else 27 | status = true 28 | end 29 | end 30 | else 31 | status = false 32 | end 33 | 34 | f1.write(line) if status 35 | end 36 | end 37 | end 38 | 39 | if newfile == file then 40 | oldfile = file + ".old" 41 | FileUtils.mv file, oldfile 42 | end 43 | 44 | FileUtils.mv tmp, newfile 45 | 46 | end 47 | 48 | def biliTouch(file="") 49 | open(file, 'w').close 50 | end 51 | 52 | end 53 | -------------------------------------------------------------------------------- /BiliGui.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative 'BiliWidgets' 3 | app = Qt::Application.new ARGV 4 | open("data/style.qss",'r') {|f| app.setStyleSheet(f.read)} 5 | BiliGui.new 6 | app.exec 7 | -------------------------------------------------------------------------------- /BiliPlaylist.rb: -------------------------------------------------------------------------------- 1 | module BiliPlaylist 2 | 3 | require 'fileutils' 4 | require_relative 'BiliConfig' 5 | 6 | class BiliPlaylist 7 | 8 | def initialize(videos="") 9 | @videos = videos 10 | @hash = {} 11 | 12 | @historyfile = File.join($configPath,"biligui.history") 13 | @lastfile = File.join($configPath,"biligui.last") 14 | 15 | split 16 | end 17 | 18 | def split 19 | 20 | unless @videos.empty? then 21 | 22 | @videos.split(/\n/).each do |video| 23 | if video.index(",") || video.index(";") then 24 | if video.index(",") then 25 | separator = "," 26 | else 27 | separator = ";" 28 | end 29 | 30 | video.split(separator).each do |nest| 31 | if nest.index("http://") then 32 | key = "av" + nest.gsub(/^.*\/av/,'').gsub(/\//,'') 33 | @hash[key] = nest 34 | elsif nest.index("av") then 35 | value = "http://www.bilibili.com/video/" + nest + "/" 36 | @hash[nest] = value 37 | else 38 | next 39 | end 40 | end 41 | else 42 | if video.index("http://") then 43 | key = "av" + video.gsub(/^.*\/av/,'').gsub(/\//,'') 44 | @hash[key] = video 45 | elsif video.index("av") then 46 | value = "http://www.bilibili.com/video/" + video + "/" 47 | @hash[video] = value 48 | else 49 | next 50 | end 51 | end 52 | end 53 | 54 | end 55 | 56 | end 57 | 58 | def hash 59 | return @hash 60 | end 61 | 62 | def save(filename="") 63 | 64 | playlist = filename 65 | 66 | default_playlist = "#{$configPath}/playlist/biliplaylist.m3u8" 67 | 68 | if playlist.empty? then 69 | playlist = default_playlist 70 | end 71 | 72 | if File.exist?(playlist) then 73 | old_playlist = playlist + ".old" 74 | FileUtils.mv playlist, old_playlist 75 | end 76 | 77 | io = open(playlist,"w") 78 | io.puts "#EXTM3U" 79 | 80 | @hash.to_a.each do |video| 81 | io.puts "#EXTINF:#{video[0]}" 82 | io.puts video[1] 83 | end 84 | 85 | io.close 86 | 87 | end 88 | 89 | def load(playlist="") 90 | 91 | hash = {} 92 | 93 | default_playlist = "#{$configPath}/playlist/biliplaylist.m3u8" 94 | 95 | if playlist.empty? && File.exist?(default_playlist) then 96 | playlist = default_playlist 97 | end 98 | 99 | 100 | if playlist.empty? then 101 | p "[ERR] No playlist available!" 102 | else 103 | 104 | io = open(playlist, 'r') 105 | 106 | array = [] 107 | i = 0 108 | 109 | io.each_line do |line| 110 | 111 | line.chomp! 112 | 113 | i += 1 114 | 115 | unless line.index("http://") then 116 | next 117 | end 118 | 119 | unless line.index("bilibili") then 120 | p "#{line} doesn't seem to be a Bilibili URL!" 121 | else 122 | value = line 123 | key = "av" + value.gsub(/^.*\/av/,'').gsub(/\//,'') 124 | hash[key] = value 125 | array[i] = line 126 | end 127 | 128 | end 129 | 130 | if array.empty? then 131 | p "This playlist has no URL we support!" 132 | end 133 | 134 | io.close 135 | end 136 | 137 | return hash 138 | 139 | end 140 | 141 | def history 142 | 143 | io = open(@lastfile, 'w') 144 | @hash.each_value { |item| io.puts item } 145 | io.close 146 | 147 | open(@lastfile,'r') do |f| 148 | open(@historyfile, 'a') do |f1| 149 | f.each_line do |line| 150 | f1.puts line 151 | end 152 | end 153 | end 154 | 155 | duplicate([@lastfile,@historyfile]) 156 | 157 | end 158 | 159 | def duplicate(files) 160 | 161 | files.each do |file| 162 | array = [] 163 | i = 0 164 | 165 | open(file,'r') do |f| 166 | f.each_line do |line| 167 | line.chomp! 168 | array[i] = line 169 | i+=1 170 | end 171 | end 172 | 173 | new = array.uniq 174 | 175 | io = open(file, 'w') 176 | new.each {|value| io.puts value} 177 | io.close 178 | end 179 | end 180 | 181 | def last 182 | 183 | str = "" 184 | 185 | open(@lastfile,'r') do |f| 186 | f.each_line do |line| 187 | str += line 188 | end 189 | end 190 | 191 | return str 192 | 193 | end 194 | 195 | end 196 | 197 | end 198 | -------------------------------------------------------------------------------- /BiliWeb.rb: -------------------------------------------------------------------------------- 1 | module BiliWeb 2 | 3 | require 'open-uri' 4 | require_relative 'BiliConfig' 5 | 6 | $cachePath = File.join($configPath, 'cache') 7 | 8 | Dir.mkdir($cachePath) unless Dir.exist?($cachePath) 9 | 10 | class BiliParser 11 | 12 | include BiliConfig 13 | include BiliFile 14 | 15 | def initialize(array=["http://bilibili.tv"]) 16 | 17 | @filename = {} 18 | array.each do |url| 19 | filename = $cachePath + "/" + url.gsub(/http:\/\//,"") + ".html" 20 | @filename[filename] = url 21 | end 22 | 23 | @pool = Queue.new 24 | 25 | @index = "bilibili.tv.html" 26 | @indexfile = File.join($cachePath,@index) 27 | 28 | get 29 | 30 | end 31 | 32 | def get 33 | 34 | @filename.each do |array| 35 | Thread.new { 36 | content = open(array[1]).read 37 | io = File.open(array[0], "w") 38 | io.puts(content) 39 | io.close 40 | @pool << array[0] 41 | } 42 | end 43 | 44 | clean 45 | end 46 | 47 | def clean 48 | 49 | @filename.size.times do 50 | 51 | Thread.new { 52 | file = @pool.pop 53 | 54 | if file.index(@index) then 55 | biliMove(file,"line.index('/video/') && ! line.index('av271')") 56 | else 57 | p "[WARN] Don't know what to do!" 58 | end 59 | } 60 | 61 | end 62 | 63 | end 64 | 65 | def parse 66 | 67 | hash1 = {} 68 | lev1 = @indexfile + ".l1" 69 | 70 | biliMove(@indexfile,lev1,"line.index('i-link')") 71 | 72 | # parse level 1 pair 73 | open(lev1) do |f| 74 | f.each_line do |line| 75 | line.chomp! 76 | key = line.gsub(/^.*/,'').gsub(/<\/em.*$/,'') 77 | value = line.gsub(/^.*href=\"/,'').gsub(/\">, YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: PACKAGE VERSION\n" 10 | "Report-Msgid-Bugs-To: \n" 11 | "POT-Creation-Date: 2014-12-14 01:38+0800\n" 12 | "PO-Revision-Date: 2014-12-14 01:38+0800\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 20 | 21 | #: ../BiliWidgets.rb:36 22 | msgid "BiliGui" 23 | msgstr "" 24 | 25 | #: ../BiliWidgets.rb:74 26 | msgid "BiliGui Playlist" 27 | msgstr "" 28 | 29 | #: ../BiliWidgets.rb:75 30 | msgid "BiliGui Settings" 31 | msgstr "" 32 | 33 | #: ../BiliWidgets.rb:76 34 | msgid "Bilibili.tv" 35 | msgstr "" 36 | 37 | #: ../BiliWidgets.rb:89 38 | msgid "Please paste Bilibili URL/bangou below" 39 | msgstr "" 40 | 41 | #: ../BiliWidgets.rb:90 42 | msgid "Visit bilibili.tv (experimental)" 43 | msgstr "" 44 | 45 | #: ../BiliWidgets.rb:94 46 | msgid "Play" 47 | msgstr "" 48 | 49 | #: ../BiliWidgets.rb:95 50 | msgid "Clear" 51 | msgstr "" 52 | 53 | #: ../BiliWidgets.rb:114 54 | msgid "Load" 55 | msgstr "" 56 | 57 | #: ../BiliWidgets.rb:115 58 | msgid "Save" 59 | msgstr "" 60 | 61 | #: ../BiliWidgets.rb:137 62 | msgid "Please enter your bilidan's path:" 63 | msgstr "" 64 | 65 | #: ../BiliWidgets.rb:139 66 | msgid "Choose" 67 | msgstr "" 68 | 69 | #: ../BiliWidgets.rb:141 70 | msgid "mpv flags for bilidan:" 71 | msgstr "" 72 | 73 | #: ../BiliWidgets.rb:144 74 | msgid "danmaku2ass flags for bilidan:" 75 | msgstr "" 76 | 77 | #: ../BiliWidgets.rb:188 78 | msgid "[ERR] you need to choose bilidan.py!" 79 | msgstr "" 80 | 81 | #: ../BiliWidgets.rb:197 82 | msgid "Now Playing: " 83 | msgstr "" 84 | 85 | #: ../BiliWidgets.rb:205 86 | msgid "[ERR] you have to paste at least one URL/bangou!" 87 | msgstr "" 88 | 89 | #: ../BiliWidgets.rb:231 90 | msgid "Please choose your bilidan.py" 91 | msgstr "" 92 | 93 | #: ../BiliWidgets.rb:231 94 | msgid "Python files (*.py)" 95 | msgstr "" 96 | 97 | #: ../BiliWidgets.rb:236 98 | msgid "[WARN] You didn't choose bilidan.py!" 99 | msgstr "" 100 | 101 | #: ../BiliWidgets.rb:267 102 | msgid "Please choose your playlist" 103 | msgstr "" 104 | 105 | #: ../BiliWidgets.rb:267 ../BiliWidgets.rb:282 106 | msgid "Playlist file (*.m3u8)" 107 | msgstr "" 108 | 109 | #: ../BiliWidgets.rb:280 110 | msgid "No video URL/bangou can be saved at all!" 111 | msgstr "" 112 | 113 | #: ../BiliWidgets.rb:282 114 | msgid "Please choose save location" 115 | msgstr "" 116 | -------------------------------------------------------------------------------- /po/BiliGui.zh_CN.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marguerite/BiliGui/0220fee96707cc3d8340c776879751550889561e/po/BiliGui.zh_CN.mo -------------------------------------------------------------------------------- /po/BiliGui.zh_CN.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2014 3 | # This file is distributed under the same license as the BiliGui package. 4 | # Marguerite Su , 2014. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: 0.0.11\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2014-12-14 01:38+0800\n" 11 | "PO-Revision-Date: 2014-12-14 00:25+0800\n" 12 | "Last-Translator: Marguerite Su \n" 13 | "Language-Team: Simplified Chinese \n" 14 | "Language: \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 19 | 20 | #: ../BiliWidgets.rb:36 21 | msgid "BiliGui" 22 | msgstr "比利贵" 23 | 24 | #: ../BiliWidgets.rb:74 25 | msgid "BiliGui Playlist" 26 | msgstr "BiliGui 播放列表" 27 | 28 | #: ../BiliWidgets.rb:75 29 | msgid "BiliGui Settings" 30 | msgstr "BiliGui 设置" 31 | 32 | #: ../BiliWidgets.rb:76 33 | msgid "Bilibili.tv" 34 | msgstr "Bilibili.tv" 35 | 36 | #: ../BiliWidgets.rb:89 37 | msgid "Please paste Bilibili URL/bangou below" 38 | msgstr "请在下面粘贴 B 站 URL/番号" 39 | 40 | #: ../BiliWidgets.rb:90 41 | msgid "Visit bilibili.tv (experimental)" 42 | msgstr "访问 bilibili.tv (实验性)" 43 | 44 | #: ../BiliWidgets.rb:94 45 | msgid "Play" 46 | msgstr "播放" 47 | 48 | #: ../BiliWidgets.rb:95 49 | msgid "Clear" 50 | msgstr "清空" 51 | 52 | #: ../BiliWidgets.rb:114 53 | msgid "Load" 54 | msgstr "加载" 55 | 56 | #: ../BiliWidgets.rb:115 57 | msgid "Save" 58 | msgstr "保存" 59 | 60 | #: ../BiliWidgets.rb:137 61 | msgid "Please enter your bilidan's path:" 62 | msgstr "请输入 bilidan 的路径:" 63 | 64 | #: ../BiliWidgets.rb:139 65 | msgid "Choose" 66 | msgstr "选择" 67 | 68 | #: ../BiliWidgets.rb:141 69 | msgid "mpv flags for bilidan:" 70 | msgstr "bilidan 的 mpv 参数:" 71 | 72 | #: ../BiliWidgets.rb:144 73 | msgid "danmaku2ass flags for bilidan:" 74 | msgstr "bilidan 的 danmaku2ass 参数:" 75 | 76 | #: ../BiliWidgets.rb:188 77 | msgid "[ERR] you need to choose bilidan.py!" 78 | msgstr "[ERR] 需要选择 bilidan.py!" 79 | 80 | #: ../BiliWidgets.rb:197 81 | msgid "Now Playing: " 82 | msgstr "正在播放:" 83 | 84 | #: ../BiliWidgets.rb:205 85 | msgid "[ERR] you have to paste at least one URL/bangou!" 86 | msgstr "[ERR] 需要粘贴至少一个 URL/番号!" 87 | 88 | #: ../BiliWidgets.rb:231 89 | msgid "Please choose your bilidan.py" 90 | msgstr "请选择 bilidan.py" 91 | 92 | #: ../BiliWidgets.rb:231 93 | msgid "Python files (*.py)" 94 | msgstr "Python 文件 (*.py)" 95 | 96 | #: ../BiliWidgets.rb:236 97 | msgid "[WARN] You didn't choose bilidan.py!" 98 | msgstr "[WARN] 未选择 bilidan.py!" 99 | 100 | #: ../BiliWidgets.rb:267 101 | msgid "Please choose your playlist" 102 | msgstr "请选择播放列表" 103 | 104 | #: ../BiliWidgets.rb:267 ../BiliWidgets.rb:282 105 | msgid "Playlist file (*.m3u8)" 106 | msgstr "播放列表文件 (*.m3u8)" 107 | 108 | #: ../BiliWidgets.rb:280 109 | msgid "No video URL/bangou can be saved at all!" 110 | msgstr "根本没有可保存的视频 URL/番号!" 111 | 112 | #: ../BiliWidgets.rb:282 113 | msgid "Please choose save location" 114 | msgstr "请选择保存位置" 115 | -------------------------------------------------------------------------------- /po/BiliGui.zh_TW.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marguerite/BiliGui/0220fee96707cc3d8340c776879751550889561e/po/BiliGui.zh_TW.mo -------------------------------------------------------------------------------- /po/BiliGui.zh_TW.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) 2014 3 | # This file is distributed under the same license as the BiliGui package. 4 | # Marguerite Su , 2014. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: 0.0.11\n" 9 | "Report-Msgid-Bugs-To: \n" 10 | "POT-Creation-Date: 2014-12-14 01:38+0800\n" 11 | "PO-Revision-Date: 2014-12-14 00:25+0800\n" 12 | "Last-Translator: Marguerite Su \n" 13 | "Language-Team: Traditional Chinese \n" 14 | "Language: \n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 19 | 20 | #: ../BiliWidgets.rb:36 21 | msgid "BiliGui" 22 | msgstr "比利貴" 23 | 24 | #: ../BiliWidgets.rb:74 25 | msgid "BiliGui Playlist" 26 | msgstr "BiliGui 播放列表" 27 | 28 | #: ../BiliWidgets.rb:75 29 | msgid "BiliGui Settings" 30 | msgstr "BiliGui 設定" 31 | 32 | #: ../BiliWidgets.rb:76 33 | msgid "Bilibili.tv" 34 | msgstr "Bilibili.tv" 35 | 36 | #: ../BiliWidgets.rb:89 37 | msgid "Please paste Bilibili URL/bangou below" 38 | msgstr "請在下面粘貼 B 站 URL/番號" 39 | 40 | #: ../BiliWidgets.rb:90 41 | msgid "Visit bilibili.tv (experimental)" 42 | msgstr "訪問 bilibili.tv (實驗性)" 43 | 44 | #: ../BiliWidgets.rb:94 45 | msgid "Play" 46 | msgstr "播放" 47 | 48 | #: ../BiliWidgets.rb:95 49 | msgid "Clear" 50 | msgstr "清空" 51 | 52 | #: ../BiliWidgets.rb:114 53 | msgid "Load" 54 | msgstr "載入" 55 | 56 | #: ../BiliWidgets.rb:115 57 | msgid "Save" 58 | msgstr "存檔" 59 | 60 | #: ../BiliWidgets.rb:137 61 | msgid "Please enter your bilidan's path:" 62 | msgstr "請鍵入 bilidan 之路徑:" 63 | 64 | #: ../BiliWidgets.rb:139 65 | msgid "Choose" 66 | msgstr "選擇" 67 | 68 | #: ../BiliWidgets.rb:141 69 | msgid "mpv flags for bilidan:" 70 | msgstr "bilidan 之 mpv 參數:" 71 | 72 | #: ../BiliWidgets.rb:144 73 | msgid "danmaku2ass flags for bilidan:" 74 | msgstr "bilidan 之 danmaku2ass 參數:" 75 | 76 | #: ../BiliWidgets.rb:188 77 | msgid "[ERR] you need to choose bilidan.py!" 78 | msgstr "[ERR] 需要選擇 bilidan.py!" 79 | 80 | #: ../BiliWidgets.rb:197 81 | msgid "Now Playing: " 82 | msgstr "正在播放:" 83 | 84 | #: ../BiliWidgets.rb:205 85 | msgid "[ERR] you have to paste at least one URL/bangou!" 86 | msgstr "[ERR] 需要粘貼至少一個 URL/番號!" 87 | 88 | #: ../BiliWidgets.rb:231 89 | msgid "Please choose your bilidan.py" 90 | msgstr "請選擇 bilidan.py" 91 | 92 | #: ../BiliWidgets.rb:231 93 | msgid "Python files (*.py)" 94 | msgstr "Python 檔案 (*.py)" 95 | 96 | #: ../BiliWidgets.rb:236 97 | msgid "[WARN] You didn't choose bilidan.py!" 98 | msgstr "[WARN] 未選擇 bilidan.py!" 99 | 100 | #: ../BiliWidgets.rb:267 101 | msgid "Please choose your playlist" 102 | msgstr "請選擇播放列表" 103 | 104 | #: ../BiliWidgets.rb:267 ../BiliWidgets.rb:282 105 | msgid "Playlist file (*.m3u8)" 106 | msgstr "播放列表檔案 (*.m3u8)" 107 | 108 | #: ../BiliWidgets.rb:280 109 | msgid "No video URL/bangou can be saved at all!" 110 | msgstr "根本沒有可保存的視頻 URL/番號!" 111 | 112 | #: ../BiliWidgets.rb:282 113 | msgid "Please choose save location" 114 | msgstr "請選擇保存位置" 115 | -------------------------------------------------------------------------------- /po/scripts/README_SCRIPTS: -------------------------------------------------------------------------------- 1 | 1. run `update_pot.sh` to update pot 2 | 2. run `merge.sh` to merge new items to existing po files 3 | 3. translate 4 | 4. run `sudo install.sh` to install 5 | 5. run `sudo remove.sh` to uninstall (optional) 6 | -------------------------------------------------------------------------------- /po/scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for i in zh_CN zh_TW; do 3 | msgfmt ../BiliGui.${i}.po -o ../BiliGui.${i}.mo 4 | done 5 | -------------------------------------------------------------------------------- /po/scripts/merge.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for i in zh_CN zh_TW; do 3 | rmsgmerge -U ../BiliGui.${i}.po ../BiliGui.pot 4 | done 5 | -------------------------------------------------------------------------------- /po/scripts/update_pot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rxgettext ../../BiliWidgets.rb -o ../BiliGui.pot 3 | --------------------------------------------------------------------------------