
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
i18n-po-sheet-sync
Advanced tools
A Node.js library that facilitates synchronization between multilingual PO files and Google Spreadsheets.
English | 한국어
A Node.js library that facilitates synchronization between multilingual PO files and Google Spreadsheets.
Paid collaborative tools are often used for efficient multilingual management.
However, in most cases, paid tools can be a financial burden. Therefore, Google Spreadsheets alone are usually sufficient.
The .PO extension is widely used in internationalization and localization (i18n) systems for multilingual programs. i18n-po-sheet-sync enables quick and simple multilingual management through synchronization between .PO files and Google Spreadsheets.
i18n-po-sheet-sync
.example-account-auth.json
is an example of service account credentials with access permissions to Google Spreadsheet. Please change it to your own service account credentials when using.npm install i18n-po-sheet-sync
# or
yarn add i18n-po-sheet-sync
import I18nPOSheetSync from 'i18n-po-sheet-sync';
import { join } from 'path';
// Configuration
const config = {
serviceAccount: {
email: process.env.GOOGLE_SERVICE_ACCOUNT_EMAIL,
key: process.env.GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY,
},
spreadsheetId: 'GOOGLE_SHEET_ID',
languages: ['ko', 'en', 'ja', 'zh', '...'],
poFilesBasePath: join(__dirname, 'locale/locales')
};
// Create instance
const i18nSync = new I18nPOSheetSync(config);
async function exportToPO() {
try {
const results = await i18nSync.exportToPO({
filterMissingTranslations: false,
preserveExistingItems: true
});
console.log('Export completed:', results);
} catch (error) {
console.error('Export failed:', error);
}
}
exportToPO();
async function uploadFromPO() {
try {
const result = await i18nSync.uploadFromPO({
applyConditionalFormatting: true, // Apply background color to empty cells
emptyColor: '#FFEBEE', // Empty cell background color (light red)
preserveExistingTranslations: true, // Preserve existing translations
});
console.log('Upload from po completed:', result);
} catch (error) {
console.error('Upload failed:', error);
}
}
uploadFromPO();
async function applyFormatting() {
try {
await i18nSync.applyConditionalFormatting('#FFEBEE');
console.log('Conditional formatting applied successfully');
} catch (error) {
console.error('Failed to apply formatting:', error);
}
}
applyFormatting();
Option | Type | Description |
---|---|---|
serviceAccount | ServiceAccountConfig | Google service account information |
languages | string[] | Array of supported language codes |
poFilesBasePath | string | Base path where PO files are stored |
sheetIndex | number (optional) | Sheet index within the spreadsheet (default: 0) |
Option | Type | Description |
---|---|---|
msgid | string | Message ID header (default: 'messageId') |
msgctxt | string (optional) | Context header (default: 'context') |
references | string (optional) | References header (default: 'references') |
comments | string (optional) | Comments header (default: 'comments') |
extractedComments | string (optional) | Extracted comments header (default: 'extractedComments') |
Option | Type | Default | Description |
---|---|---|---|
filterMissingTranslations | boolean | false | Whether to filter items with missing translations |
preserveExistingItems | boolean | false | Whether to preserve existing PO items not in the spreadsheet |
pluralFormsByLanguage | Record<string, string> | - | Specify plural rules by language |
Option | Type | Default | Description |
---|---|---|---|
applyConditionalFormatting | boolean | false | Whether to apply background color to empty translation cells |
emptyColor | string | #FFEBEE | Background color for empty translation cells (HEX code) |
preserveExistingTranslations | boolean | false | Whether to preserve existing translation values |
The library expects a spreadsheet in the following format:
messageId | ko | en | ... | context | references | comments | extractedComments |
---|---|---|---|---|---|---|---|
hello | 안녕하세요 | Hello | ... | greeting | src/App.js | Greeting | User greeting |
goodbye | 안녕히 가세요 | Goodbye | ... | greeting | src/App.js | Farewell | On logout |
Header names can be changed through the HeaderMapping
option.
yarn add --dev @lingui/cli
{
"scripts": {
"extract": "lingui extract",
"compile": "lingui compile",
"upload": "ts-node scripts/upload-translate.ts",
"export": "ts-node scripts/export-translate.ts",
}
}
i18next-conv -l en -s ./locales/en.translation.json -t ./locales/en/translation.po
MIT
FAQs
A Node.js library that facilitates synchronization between multilingual PO files and Google Spreadsheets.
We found that i18n-po-sheet-sync demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.