
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.
@gftdcojp/weblate-nextjs-sdk
Advanced tools
A Next.js SDK for integrating with Weblate translation management system
A powerful and easy-to-use SDK for integrating Weblate translation management system with Next.js applications.
# Using pnpm (recommended)
pnpm install @gftdcojp/weblate-nextjs-sdk
# Using npm
npm install @gftdcojp/weblate-nextjs-sdk
# Using yarn
yarn add @gftdcojp/weblate-nextjs-sdk
Wrap your app with the WeblateProvider:
import { WeblateProvider } from '@gftdcojp/weblate-nextjs-sdk';
const weblateConfig = {
baseUrl: process.env.NEXT_PUBLIC_WEBLATE_URL,
apiKey: process.env.WEBLATE_API_KEY,
};
function App({ Component, pageProps }) {
return (
<WeblateProvider config={weblateConfig} defaultLanguage="en">
<Component {...pageProps} />
</WeblateProvider>
);
}
import { useTranslation, useWeblate } from '@gftdcojp/weblate-nextjs-sdk';
function MyComponent() {
const { client, currentLanguage } = useWeblate();
const { translations, isLoading, error } = useTranslation({
componentSlug: 'my-component',
languageCode: currentLanguage,
client,
});
if (isLoading) return <div>Loading...</div>;
if (error) return <div>Error: {error.message}</div>;
return (
<div>
<h1>{translations['welcome'] || 'Welcome'}</h1>
</div>
);
}
import { useLanguage, useWeblate } from '@gftdcojp/weblate-nextjs-sdk';
function LanguageSelector() {
const { client } = useWeblate();
const { languages, currentLanguage, setLanguage } = useLanguage({
client,
});
return (
<select
value={currentLanguage?.code || ''}
onChange={(e) => setLanguage(e.target.value)}
>
{languages.map((lang) => (
<option key={lang.code} value={lang.code}>
{lang.name}
</option>
))}
</select>
);
}
NEXT_PUBLIC_WEBLATE_URL=https://your-weblate-instance.com
WEBLATE_API_KEY=your-api-key
interface WeblateConfig {
baseUrl: string; // Weblate instance URL
apiKey: string; // API key for authentication
timeout?: number; // Request timeout (default: 10000ms)
retries?: number; // Number of retries (default: 3)
}
useWeblate()
Returns the Weblate context with client and language state.
useTranslation(options)
Fetches translations for a specific component and language.
Options:
componentSlug: string
- Component sluglanguageCode: string
- Language codeclient: WeblateClient
- Weblate client instanceuseLanguage(options)
Manages available languages and current language selection.
Options:
client: WeblateClient
- Weblate client instancedefaultLanguage?: string
- Default language codeuseT(key, defaultValue?, options?)
Simple hook for getting a single translation.
useUpdateTranslation(client)
Hook for updating translations.
WeblateClient
getProjects()
- Get all projectsgetProject(slug)
- Get specific projectgetComponents(projectSlug)
- Get project componentsgetTranslations(componentSlug)
- Get component translationsgetTranslation(componentSlug, languageCode)
- Get specific translationgetUnits(translationId)
- Get translation unitsupdateUnit(unitId, target)
- Update translation unitgetStatistics(componentSlug, languageCode)
- Get translation statisticssearchUnits(query, component?, language?)
- Search translation unitsgetLanguages()
- Get available languagesimport { createWeblateClient } from '@gftdcojp/weblate-nextjs-sdk';
const client = createWeblateClient({
baseUrl: 'https://your-weblate-instance.com',
apiKey: 'your-api-key',
timeout: 5000,
retries: 2,
});
// Use client directly
const projects = await client.getProjects();
import { WeblateApiError } from '@gftdcojp/weblate-nextjs-sdk';
function MyComponent() {
const { translations, error } = useTranslation(options);
if (error) {
if (error instanceof WeblateApiError) {
console.error('API Error:', error.code, error.message);
}
return <div>Translation error occurred</div>;
}
return <div>{translations['key']}</div>;
}
import { GetServerSideProps } from 'next';
import { createWeblateClient } from '@gftdcojp/weblate-nextjs-sdk';
export const getServerSideProps: GetServerSideProps = async (context) => {
const client = createWeblateClient({
baseUrl: process.env.WEBLATE_URL,
apiKey: process.env.WEBLATE_API_KEY,
});
const translations = await client.getTranslation(
'my-component',
context.locale || 'en'
);
return {
props: {
translations,
},
};
};
The SDK provides comprehensive TypeScript definitions for all Weblate API objects:
WeblateProject
WeblateComponent
WeblateLanguage
WeblateTranslation
WeblateUnit
WeblateStats
This project uses CalVer (Calendar Versioning) with the format YYYY.MM.MICRO
:
2025.07.1
- First release in July 20252025.07.2
- Second release in July 20252025.08.1
- First release in August 2025# Micro release (increment within current month)
pnpm run calver
pnpm run release
# Major release (reset to .1 for current month)
pnpm run calver:major
pnpm run release:major
MIT License. See LICENSE for details.
FAQs
A Next.js SDK for integrating with Weblate translation management system
The npm package @gftdcojp/weblate-nextjs-sdk receives a total of 3 weekly downloads. As such, @gftdcojp/weblate-nextjs-sdk popularity was classified as not popular.
We found that @gftdcojp/weblate-nextjs-sdk 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.