https://github.com/nventive/sheet2i18n
https://github.com/nventive/sheet2i18n
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nventive/sheet2i18n
- Owner: nventive
- License: apache-2.0
- Created: 2023-10-18T15:09:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-23T18:29:19.000Z (almost 2 years ago)
- Last Synced: 2026-01-25T21:22:35.480Z (5 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Sheet2i18n
## Demo
Example SpreadSheet
https://docs.google.com/spreadsheets/d/1qjNcJ4JEonpwRKVtkR99TOHif1plFsr5jUW2bLXwmhM/
## Installation
***Prerequisite:***
Node
***Steps:***
1. Install the latest version of the package from npm as a dev dependency:
```
npm i -D sheet2i18n
```
2. Create a `sheet2i18n.config.js` configuration file in your project's root directory:
```diff
my-app
├── node_modules
+ ├── sheet2i18n.config.js
└── package.json
```
3. Add and edit config values of your newly created `sheet2i18n.config.js` :
```title="sheet2i18n.config.js"
module.exports = {
exportPath: ,
tabsUrl: Array,
localesKey: Array,
};
```
***Example:***
```title="sheet2i18n.config.js"
module.exports = {
exportPath: "locales",
tabsUrl: [
"https://docs.google.com/spreadsheets/d/e/2PACX-1vR8qY9uP-jDrUMpZfk9BYk8qZZ7T-cj3xzEy9DAfauyVci_Od0qvG1EPTiYoNf-SpC_c4A04b54Jv8C/pub?gid=0&single=true&output=csv",
"https://docs.google.com/spreadsheets/d/e/2PACX-1vR8qY9uP-jDrUMpZfk9BYk8qZZ7T-cj3xzEy9DAfauyVci_Od0qvG1EPTiYoNf-SpC_c4A04b54Jv8C/pub?gid=229463273&single=true&output=csv",
],
localesKey: ["en", "fr", "es"],
};
```
Go to (Google Sheet -> File -> Share -> Publish to web) to generate Google Sheet CSV publish url.
4. Add the command in the `scripts` section of your `package.json` to use the `sheet2i18n` CLI:
[Default] ConfigPath: "sheet2i18n.config"
```diff title="package.json"
"scripts": {
+ "sheet2i18n": "sheet2i18n "
}
```
***Example:***
```diff title="package.json"
"scripts": {
+ "sheet2i18n": "sheet2i18n src/app/utilities/config.sheet2i18n"
}
```
## Use
Run the following command in console.
```
npm run sheet2i18n
```
### Dependencies
* [axios/axios](https://github.com/axios/axios) - Promise based HTTP client for the browser and node.js.
* [adaltas/node-csv](https://github.com/adaltas/node-csv) - Full featured CSV parser with simple api and tested against large datasets.
### Project Structure
/sheet2i18n
|--- node_modules/ <-- generated by npm install
|--- bin/ <-- binaries of the modules
|--- sheet2i18n.config.js <-- modules configurations example
|--- index.js <-- entry script
|--- package.json <-- defines build commands and dependencies
## License
This project is licensed under the Apache 2.0 license - see the
[LICENSE](LICENSE) file for details.