Skip to content

Commit

Permalink
add donate info
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim Biesbjerg committed Jul 31, 2019
1 parent 393e1ed commit 7ce01b9
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 15 deletions.
7 changes: 2 additions & 5 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
github: biesbjerg
open_collective: ngx-translate-extract
ko_fi: biesbjerg
custom: https://ngx-translate-extract.biesbjerg.com/donate

github: #biesbjerg
custom: https://donate.biesbjerg.com
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
If this tool saves you time, please consider making a donation towards the continued maintainence and development: https://donate.biesbjerg.com

[![Donate](images/donate-badge.png)](https://donate.biesbjerg.com)

# Usage

## ngx-translate-extract
Expand Down Expand Up @@ -74,7 +78,7 @@ _('Extract me');
`ngx-translate-extract ... -m _`

## Commandline arguments
```
```shell
Usage:
ngx-translate-extract [options]

Expand Down
Binary file added images/donate-badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
179 changes: 173 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@
},
"dependencies": {
"@angular/compiler": "^8.1.3",
"boxen": "^4.1.0",
"colorette": "^1.1.0",
"flat": "^4.1.0",
"gettext-parser": "^4.0.1",
"glob": "^7.1.4",
"mkdirp": "^0.5.1",
"path": "^0.12.7",
"terminal-link": "^1.3.0",
"typescript": "^3.5.3",
"yargs": "^13.3.0"
}
Expand Down
9 changes: 6 additions & 3 deletions src/cli/cli.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import * as fs from 'fs';
import * as yargs from 'yargs';

import { ExtractTask } from './tasks/extract.task';
import { ParserInterface } from '../parsers/parser.interface';
import { PipeParser } from '../parsers/pipe.parser';
Expand All @@ -10,9 +13,7 @@ import { KeyAsDefaultValuePostProcessor } from '../post-processors/key-as-defaul
import { PurgeObsoleteKeysPostProcessor } from '../post-processors/purge-obsolete-keys.post-processor';
import { CompilerInterface } from '../compilers/compiler.interface';
import { CompilerFactory } from '../compilers/compiler.factory';

import * as fs from 'fs';
import * as yargs from 'yargs';
import { donateMessage } from '../utils/donate';

export const cli = yargs
.usage('Extract strings from files for translation.\nUsage: $0 [options]')
Expand Down Expand Up @@ -133,3 +134,5 @@ const compiler: CompilerInterface = CompilerFactory.create(cli.format, {
extractTask.setCompiler(compiler);

extractTask.execute();

console.log(donateMessage);
19 changes: 19 additions & 0 deletions src/utils/donate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { yellow } from 'colorette';
import * as boxen from 'boxen';
import * as terminalLink from 'terminal-link';

const url = 'https://donate.biesbjerg.com';
const text = `
If this tool saves you time, please consider making a
donation towards the continued maintainence and development:
${yellow(terminalLink(url, url))}
`;

export const donateMessage = boxen(text.trim(), {
padding: 1,
margin: 0,
borderColor: 'yellow',
backgroundColor: 'black',
dimBorder: true
});

0 comments on commit 7ce01b9

Please sign in to comment.