defguard
  • Introduction
  • User documentation (help)
    • Configuring VPN
      • Defguard Desktop Client
        • Update instance
      • Other WireGuard® Clients
        • Configuring a device for new VPN Location manually
    • Password change / Reset
    • Enrollment & Onboarding
      • With internal Defguard SSO
      • With external SSO (Google/Microsoft/Custom)
    • Setting up 2FA/MFA
    • Desktop Client
    • CLI Client
  • Admin & features
    • Deploying your instance
      • One-line install script
      • Standalone package based installation
      • Docker images and tags
      • Docker Compose
      • Kubernetes
      • Upgrading
      • Gateway
        • Running gateway on MikroTik routers
      • Securing gRPC communication
      • OpenID RSA key
      • Configuration
      • Pre-production and development releases
      • High Availability and Failover
      • Health check
    • Features & configuration
      • Zero-Trust VPN with 2FA/MFA
        • Create/manage VPN Location
        • Network overview
        • Executing custom gateway commands
        • Multi-Factor Authentication (MFA/2FA)
          • MFA Architecture
        • Remote desktop client configuration
        • DNS and domains
      • Remote user enrollment
        • User onboarding after enrollment
      • SSO (OpenID Connect)
        • Portainer
        • Grafana setup
        • Proxmox
        • Matrix / Synapse
        • Django
        • MinIO
        • Vault
      • SMTP for email notifications
      • YubiKey Provisioning
      • Webhooks
      • Forward auth
      • SSH Authentication
      • Network devices
      • Gateway notifications
      • New version notifications
  • Troubleshooting Guide
    • Sending support information
    • Client Windows installer exit codes
    • Client "All traffic" connection issues
    • WebAuthn security keys
  • Enterprise Features
    • License
    • Enteprise features
      • Automatic (real time) desktop client configuration & sync
      • External OpenID providers
        • Google
        • Microsoft
        • Zitadel
        • Keycloak
        • JumpCloud
        • Okta
        • Custom
      • External OIDC secure enrollment
      • VPN & Client behavior customization
      • REST API
      • Access Control List
        • ACL Aliases
      • LDAP and Active Directory integration
        • Configuration
        • Settings table
        • Two-way LDAP and Active Directory synchronization
  • Tutorials
    • Step by step setting up a VPN server
      • Adding additional VPN locations
  • In depth
    • Roadmap
    • Architecture
      • How do VPN statistics work
      • Security concepts
  • For Developers
    • Contributing
    • Environment setup
    • Translations (core/web)
      • Switching language
      • Adding translations
  • Translations (client)
    • Adding translations
  • Contact us
    • Community & Support
Powered by GitBook
On this page
  • Generating types
  • Switching language

Was this helpful?

Edit on GitHub
  1. Translations (client)

Adding translations

PreviousTranslations (client)NextCommunity & Support

Last updated 2 months ago

Was this helpful?

All locale files can be found under src/i18n in the . In order to add a new translation, you will need to create an appropriate folder in this directory. You can refer to the en locale as an example.

If you'd like to add a new locale, e.g. French, create an fr folder in the src/i18n directory and copy the index.ts file from the base (en) locale folder into your newly created fr directory. After copying the file, open it and change the locale name from en to fr as below:

/* eslint-disable no-irregular-whitespace */
/* eslint-disable max-len */
import type { BaseTranslation } from '../i18n-types';

const en = { // <-- change it to fr or other language code of your choice
[...]
} satisfies BaseTranslation;

export default en; // <-- change it to fr or other language code of your choice

Now you can edit your index.ts file and translate its strings into the chosen language.

Generating types

After every change in your translation you will have to generate the locale types in order for the locale to load properly. To do this, you will need to install some client dependencies: at least typesafe-i18n but ideally you should setup the whole client development environment in order to preview your translations. You can find the client development prerequisites in the client's readme: . You will also need to have some node package manager, we use pnpm.

The types can be generated by executing one of the following commands in the client directory:

pnpm typesafe-i18n

or

pnpm tauri dev

The first command only generates the required locale types, the second one runs the client along with UI hot reload, so you can observe your locale changes in real-time.

Switching language

Currently client picks the locale based on the operating system's settings. There is no straightforward way to switch the locale in the client by hand, other than to hardcode different detectedLocale in src/components/App/App.tsx or change your operating system's language. This is a temporary shortcoming and will be changed in the future.

client repository
https://github.com/DefGuard/client?tab=readme-ov-file#development