mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-19 09:59:54 +00:00
.github
.vscode
app
build
docs
extras
locale
patches
scripts
build-docs.js
build-linux.js
build-macos.js
build-modules.js
build-native.js
build-typings.js
build-windows.js
generate-icon-metadata.js
i18n-extract.js
install-deps.js
prepackage-plugins.js
publish-plugins.js
sentry-upload.js
vars.js
snap
tabby-community-color-schemes
tabby-core
tabby-electron
tabby-linkifier
tabby-local
tabby-plugin-manager
tabby-serial
tabby-settings
tabby-ssh
tabby-telnet
tabby-terminal
tabby-uac
tabby-web
tabby-web-demo
web
.all-contributorsrc
.eslintrc.yml
.gitignore
.mergify.yml
.pug-lintrc.js
CODE_OF_CONDUCT.md
HACKING.md
LICENSE
README.ko-KR.md
README.md
README.ru-RU.md
README.zh-CN.md
appveyor.yml
electron-builder.yml
firebase.json
package.json
tsconfig.json
typedoc.js
webpack.config.js
webpack.plugin.config.js
yarn.lock
28 lines
912 B
JavaScript
Executable File
28 lines
912 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
const sh = require('shelljs')
|
|
const fs = require('fs/promises')
|
|
const vars = require('./vars')
|
|
const log = require('npmlog')
|
|
|
|
const tempOutput = 'locale/app.new.pot'
|
|
const pot = 'locale/app.pot'
|
|
const tempHtml = 'locale/tmp-html'
|
|
|
|
;(async () => {
|
|
sh.mkdir('-p', tempHtml)
|
|
for (const plugin of vars.builtinPlugins) {
|
|
log.info('extract-pug', plugin)
|
|
|
|
sh.exec(`yarn pug --doctype html -s --pretty -O '{require: function(){}}' -o ${tempHtml}/${plugin} ${plugin}`, { fatal: true })
|
|
|
|
log.info('extract-ts', plugin)
|
|
sh.exec(`node node_modules/.bin/ngx-translate-extract -i ${plugin}/src -m -s -f pot -o ${tempOutput}`, { fatal: true })
|
|
}
|
|
|
|
log.info('extract-pug')
|
|
sh.exec(`node node_modules/.bin/ngx-translate-extract -i ${tempHtml} -f pot -s -o ${tempOutput}`, { fatal: true })
|
|
|
|
sh.rm('-r', tempHtml)
|
|
await fs.rename(tempOutput, pot)
|
|
})()
|