sheet-i18n 0.1.22 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +1 -52
  2. package/package.json +5 -6
package/README.md CHANGED
@@ -30,7 +30,7 @@ This is the core package for sheet-based translations. You can use it to work wi
30
30
  The **server-side exporter** subpackage allows you to interact with Google Sheets and export translations directly into your project. This is primarily used in server-side environments, such as Next.js API routes or other backend frameworks, where you want to fetch and store translations from a Google Spreadsheet to be served to clients or used within your server application.
31
31
 
32
32
  ```jsx
33
- import { googleSheetExporter } from 'sheet-i18n/exporter';
33
+ import { googleSheetExporter } from 'sheet-i18n';
34
34
 
35
35
  const exporter = await googleSheetExporter({
36
36
  credentials: {
@@ -136,54 +136,3 @@ This package provides a streamlined way to export data using sheets API. It is d
136
136
  The exported translations will be saved in a format that is easy to use for localization purposes. Each translation is stored in its respective locale folder, with a structured format.
137
137
 
138
138
  </details>
139
-
140
- <!--
141
- <details>
142
- <summary>⚛️ React Component - `sheet-i18n/react`</summary>
143
-
144
- #### `sheet-i18n/react`
145
-
146
- The **React component** subpackage allows you to use translations within your React application. This is ideal for rendering dynamic translations on the frontend, where you may need to load and display translations from a Google Spreadsheet based on the current locale selected by the user.
147
-
148
- ```jsx
149
- import { useState, useEffect } from 'react';
150
- import { googleSheetExporter } from 'sheet-i18n/react';
151
-
152
- const TranslationProvider = ({ children }) => {
153
- const [translations, setTranslations] = useState({});
154
-
155
- useEffect(() => {
156
- const fetchTranslations = async () => {
157
- const exporter = await googleSheetExporter({
158
- credentials: {
159
- sheetId: 'your-google-sheet-id',
160
- clientEmail: 'your-client-email',
161
- privateKey: 'your-private-key',
162
- },
163
- defaultLocale: 'en',
164
- });
165
- const data = await exporter.getTranslations();
166
- setTranslations(data);
167
- };
168
-
169
- fetchTranslations();
170
- }, []);
171
-
172
- return (
173
- <TranslationContext.Provider value={translations}>
174
- {children}
175
- </TranslationContext.Provider>
176
- );
177
- };
178
- ```
179
-
180
- This is useful for applications where translations need to be loaded and displayed dynamically from a backend (e.g., Google Sheets). You can use this provider to wrap your app and pass translations to components.
181
-
182
- </details>
183
-
184
- ---
185
-
186
- ## Additional Notes 📌
187
-
188
- - **Locales**: Ensure that the first row in your Google Sheet contains the locale headers (e.g., `["ko", "en", "fr"]`).
189
- - **Placeholders**: Any placeholders within the translation strings will be replaced during the export process. -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sheet-i18n",
3
- "version": "0.1.22",
3
+ "version": "0.2.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -9,9 +9,8 @@
9
9
  ],
10
10
  "exports": {
11
11
  ".": {
12
- "require": "./dist/exporter/index.js",
13
- "import": "./dist/exporter/index.mjs",
14
- "types": "./dist/index.d.ts"
12
+ "require": "./dist/index.js",
13
+ "import": "./dist/index.mjs"
15
14
  }
16
15
  },
17
16
  "keywords": [
@@ -27,12 +26,12 @@
27
26
  },
28
27
  "license": "ISC",
29
28
  "dependencies": {
30
- "@sheet-i18n/exporter": "0.1.4"
29
+ "@sheet-i18n/exporter": "0.2.1"
31
30
  },
32
31
  "devDependencies": {
33
32
  "tsup": "^6.0.0",
34
33
  "typescript": "^5.0.0",
35
- "@sheet-i18n/typescript-config": "0.1.2"
34
+ "@sheet-i18n/typescript-config": "0.2.1"
36
35
  },
37
36
  "scripts": {
38
37
  "build": "tsup",