Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/l10n.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: L10n
on: pull_request

jobs:
l10n-extract-check:
runs-on: ubuntu-latest
name: Pot check
steps:
- uses: actions/checkout@master
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install
run: npm ci
- name: extract l10n files
run: npm run l10n:extract
- name: Check l10n file changes
run: bash -c "[[ ! \"`git status --porcelain l10n`\" ]] || ( echo 'Uncommited l10n changes. Run `npm l10n:extract`.' && git status && exit 1 )"
2 changes: 1 addition & 1 deletion build/extract-l10n.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ extractor
])
.parseFilesGlob('./lib/**/*.@(ts|js)');

extractor.savePotFile('./messages.pot');
extractor.savePotFile('./l10n/messages.pot');

extractor.printStats();
3 changes: 3 additions & 0 deletions l10n/messages.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"build": "babel ./lib --out-dir dist --extensions '.ts,.tsx' --source-maps && tsc --emitDeclarationOnly",
"build:doc": "typedoc --excludeNotExported --mode file --out dist/doc lib/index.ts && touch dist/doc/.nojekyll",
"check-types": "tsc",
"extract-l10n": "node build/extract-l10n.js",
"dev": "babel ./lib --out-dir dist --extensions '.ts,.tsx' --watch",
"l10n:extract": "node build/extract-l10n.js",
"test": "jest",
"test:watch": "jest --watchAll"
},
Expand Down