# sheet2i18n

> Import locale from Google Sheet into Json file.

Latest version **1.1.2** (published 2024-07-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install sheet2i18n
pnpm add sheet2i18n
yarn add sheet2i18n
bun add sheet2i18n
```

Provides the command `sheet2i18n`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2024-07-23 |
| First published | 2022-12-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 27.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nventive |
| Maintainers | mounir-abdous |

## Links

- npm: https://www.npmjs.com/package/sheet2i18n
- Repository: https://github.com/AbdousMounir/sheet2i18n
- Homepage: https://github.com/AbdousMounir/sheet2i18n#readme
- Issues: https://github.com/AbdousMounir/sheet2i18n/issues
- npm.io page: https://npm.io/package/sheet2i18n

## Dependencies (1)

- [csv-parse](https://npm.io/package/csv-parse.md) ^5.5.6

## Recent versions

- 1.1.2 (latest) — 2024-07-23
- 1.1.1 — 2024-07-23
- 1.0.2 — 2022-12-22
- 1.0.1 — 2022-12-22
- 1.0.0 — 2022-12-22

## 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: <ExportPath>,
    tabsUrl: Array<TabUrl>,
    localesKey: Array<LocaleKey>,
};
```

***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 <ConfigPath>"
}
```

***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.

---
_Source: https://npm.io/package/sheet2i18n · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
