
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@neiderruiz/translate-files
Advanced tools
Internationalize and manage your website easily with (CSV and i18n)
npm i @neiderruiz/translate-files
import { translateFileCsv } from "@neiderruiz/translate-files";
const { translateFileCsv } = require("@neiderruiz/translate-files");
translateFileCsv(idDocument,routeFolderSave)
const { convertJsonToCsv } = require("@neiderruiz/translate-files");
const data = require('../services/lang/languages/es.json')
convertJsonToCsv(data, {
separator: '.',
langs: ['es', 'en', 'fr', 'gu'],
nameFile: 'my_result'
})
import your result in Google Drive open google drive
after select keys and base, and copy in your copy of next document
🟢 document base spreadsheets translations
// src/utils/translate.js
const { translateFileCsv } = require("@neiderruiz/translate-files");
translateFileCsv('19sxdh1WE5RMXiuTWuMJonu81NWrewZbZ','./translations')
// package.json
{
"scripts": {
"translate": "node src/utils/translate.js"
}
}
npm run translate
npm i @neiderruiz/translate-files react-i18next i18next
// src/utils/translate.js
import { translateFileCsv } from '@neiderruiz/translate-files'
translateFileCsv('1UwWGPdr8XDO29tNzFiJtPDTFVt1xCLG-gSVeQd-x5Oc', './src/locales/translations')
// package.json
{
"scripts": {
...more scripts,
"translate": "node src/utils/translate.js"
}
}
// src/locales/index.js
import en from './translations/en.json'
import es from './translations/es.json'
import fr from './translations/fr.json'
export const resources = {
en: {
translation: en
},
es: {
translation: es
},
fr: {
translation: fr
}
}
// src/locales/i18n.ts
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import { resources } from ".";
i18n.use(initReactI18next)
.init({
resources,
lng: "es",
fallbackLng: "es",
interpolation: {
escapeValue: false
}
});
export default i18n;
// src/main.tsx or src/App.tsx
import './locales/i18n';
// src/hooks/use-translate.tsx
import { useTypedTranslation } from '@neiderruiz/translate-files/dist/react'
import en from '../locales/translations/en.json'
import i18n from '../locales/i18n'
type Tylelang = typeof en
const useTranslation = () => {
const { t } = useTypedTranslation<Tylelang>()
return {
t,
i18n
}
}
export default useTranslation
// src/components/Example.tsx
import React from 'react'
import useTranslation from '../hooks/use-translate'
const Example = () => {
const { t } = useTranslation()
return (
<div>
{t('actions.save')}
{/* how pased params */}
<span>
{t('actions.save_items', ['mi param', 'second param'])}
</span>
</div>
)
}
FAQs
Internationalize and manage your website easily with (CSV or JSON to i18n)
The npm package @neiderruiz/translate-files receives a total of 28 weekly downloads. As such, @neiderruiz/translate-files popularity was classified as not popular.
We found that @neiderruiz/translate-files demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.