Skip to content

Commit

Permalink
Merge pull request #10 from AyogoHealth/public
Browse files Browse the repository at this point in the history
Prepare for public release
  • Loading branch information
isuda authored Dec 13, 2023
2 parents fd86190 + e204fea commit 05aec1d
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: npm
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,36 @@ jobs:
packages: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Use Node.js 18
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
registry-url: 'https://npm.pkg.github.com'
scope: '@ayogohealth'
registry-url: 'https://registry.npmjs.org'

- name: npm test
- name: Install latest npm
run: npm install -g npm

- name: npm install and test
run: npm cit

- name: npm version
run: |
npm version ${{ github.event.inputs.version-type == 'Custom' && github.event.inputs.version-str || github.event.inputs.version-type }}
npm version ${{ github.event.inputs.version-type == 'Custom' && github.event.inputs.version-str || github.event.inputs.version-type }}
- name: git push
run: |
git push origin --follow-tags
git push origin --follow-tags
- name: npm publish
run: |
npm publish --provenance
npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2022 Ayogo Health Inc.
Copyright (c) 2022 - 2023 Ayogo Health Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
86 changes: 86 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
get_copy script
===============

Turns a Google spreadsheet of translation keys and string values into a JSON file, which can be used with tools like [ngx-translate](http://www.ngx-translate.com/), [react-i18next](https://react.i18next.com/), or [vue-i18n](https://vue-i18n.intlify.dev/).

Installation
------------

```
npm install --dev @ayogohealth/get_copy
```

Usage
-----

```
Usage: get_copy [OPTIONS] [SPREADSHEET_ID]
Options:
-h, --help Print this help message and exit
-v, --verbose Print warnings to the console for debugging
-o, --output=FILE Destination file path (default: stdout)
-c, --value-column=COL Title of spreadsheet column to use for the
translation values (default: "value")
-k, --key-column=COL Title of spreadsheet column to use for the
translation key name (default: "key")
--no-auth-cache Disables caching of authentication tokens to file
--header Header to include at the top of the output file
```

Examples
--------

Using [this example spreadsheet](https://docs.google.com/spreadsheets/d/1L9x1ocxy6VwNEPsrWiTri4wGYN9FQUymRg1p267r9R4/):

```
npx get_copy -o src/locales/en.json 1L9x1ocxy6VwNEPsrWiTri4wGYN9FQUymRg1p267r9R4
npx get_copy -o src/locales/fr.json -c "Value-FR" 1L9x1ocxy6VwNEPsrWiTri4wGYN9FQUymRg1p267r9R4
```

The contents of `src/locales/en.json` would be:
```json
{
"app_name": "Hello",
"main": {
"footer": "Goodbye",
"greeting": "Hello {name}!"
}
}
```

The contents of `src/locales/fr.json` would be:
```json
{
"app_name": "Bonjour",
"main": {
"footer": "Au revoir",
"greeting": "Bonjour {name}!"
}
}
```

Contributing
------------

Contributions of bug reports, feature requests, and pull requests are greatly
appreciated!

Please note that this project is released with a [Contributor Code of
Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to
abide by its terms.


Licence
-------

Released under the [MIT Licence](LICENCE).

Copyright © 2022 – 2023 Ayogo Health Inc.
28 changes: 14 additions & 14 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ayogohealth/get_copy",
"version": "1.0.0-rc.3",
"version": "1.0.0",
"description": "Turn a Google spreadsheet of translation strings into a JSON file",
"main": "index.js",
"exports": "index.js",
Expand All @@ -26,7 +26,7 @@
"node": ">= 16.17.0"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
"access": "public"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 05aec1d

Please sign in to comment.