Confinity Documentation
  • Latest Version
  • Latest Version
  • Getting Started

    • Introduction
    • Core Concepts
    • Create an Application
    • Glossary
  • Essentials

    • Authentication & SSO
    • Breaking Changes
    • Roslyn Source Analyzers
    • Changelog
    • ConfinityContent
    • ConfinitySelectable
    • Confinity Schedules
    • Data Seeding
    • Development guidelines [WIP]
    • Entity App
    • Entity Form
    • Entity Permissions
    • Frontend Configuration
    • Images
    • Known Issues
    • Localization
    • Migrations
    • Modules [WIP]
    • On-Site Editing
    • Settings
    • Cascade Delete
    • Replication
    • Infrastructure
  • Modules

    • Analytics Module
    • Assets Module
    • Blog Module
    • Cookie Consent Module
    • Forms Module
    • Friendly Captcha (Forms Module )
    • GeoIP Module
    • Htmx
    • Mail Module
    • Mailing Module
    • MediaPlayer Module
    • GoogleMyBusiness Module
    • OpenTelemetry Module
    • Pages Module [WIP]
    • Pattern Library Module
    • SIX Saferpay (worldline) Module
    • Products Module
    • Search Module
    • Wizard Module
  • Guides

    • Create a Custom Entity App Form Element
    • Date and Time
    • Entity Change Listener
    • File Upload / Temp File
    • HTTP security headers
    • conventions [WIP]
    • How to use Confinity with nginx
    • Notifications
    • Nullability
    • Rename Entity
    • Schedules
    • Useful snippets
    • Content Localization
  • Design Guidelines

    • Introduction
    • Page Components
    • Forms Module

Localization

We divide localization into the following three types:

  • Localization of content (not yet available)
  • Localization of the Confinity author area
  • Localization of the host application

Localization of content

This feature is not yet finished. Read about the current state in Content Localization

Localization of the Confinity author area

The author area is available in multiple languages. When you create new functionality for authors, like a form for ConfinityContent or an Entity App, you can provide all your texts in multiple languages. To accomplish this, we use the .NET localization APIs.

Register your translations

Follow these steps to translate your strings for the author area.

  1. In your project create a new directory with the name Resources.
  2. Create a new *.resx file inside this directory. Your IDE might assist you and should create a *.Designer.cs file.
  3. With the resource manager of your IDE, you can now add new translations.
  4. Now you can register either all translations of a ResouceManager or add a single translation using the Module API (IModuleConfiguration) from Confinity.

public void AddModule(IModuleContext module)
{
    module.Translation.AddAll(MyTestResources.ResourceManager);
    module.Translation.Add(CultureInfo.GetCultureInfo("DE-CH"), "Hello", "Grüezi");
}

Localization of the host application

If you know the ResouceManager that contains the translation, use the
.NET localization APIs for this. Otherwise, you can inject the Confinity.Localization.ITranslationManager and use it to get all registered translations (including translations defined by Confinity).


public string GetGreeting()
{
    return _translationManager.GetText("Hello", CultureInfo.GetCultureInfo("DE-CH"));
}

Prev
Known Issues
Next
Migrations