Aptivi - Deprecated Manuals
ProjectsWebsiteBlog
Nitrocid KS v0.1.1 - RTM
Nitrocid KS v0.1.1 - RTM
  • ๐Ÿ‘‹Welcome!
  • ๐Ÿ—ž๏ธVersion Release Notes
  • Installation and Maintenance
    • ๐Ÿ“€Installing the Kernel
      • ๐Ÿ’ปWindows
      • ๐ŸŽmacOS
      • ๐ŸงLinux
      • ๐Ÿ“ฑAndroid
    • โซUpgrading the Kernel
      • ๐Ÿ’ปWindows
      • ๐ŸŽmacOS
      • ๐ŸงLinux
      • ๐Ÿ“ฑAndroid
    • ๐Ÿ“ฆDependency Information
  • Fundamentals
    • ๐ŸŒฝWhat is the Kernel?
    • ๐Ÿ‘พWhat is Nitrocid KS?
    • โญSimulated Kernel Features
      • ๐ŸŒŸExtra Features
        • ๐ŸŒMore Networking
          • ๐Ÿ—ƒ๏ธFTP Client
          • ๐Ÿ”’SFTP Client
          • ๐Ÿ“ฐRSS Client
          • ๐ŸŒHTTP Client
          • ๐Ÿ“งMail Client
        • ๐ŸŽฎGames and Amusements
          • ๐Ÿ”คHangman
          • ๐Ÿ‡BackRace
          • โ˜„๏ธMeteor
          • ๐Ÿ“Pong
          • ๐ŸŽฐRussian Roulette
          • โ˜„๏ธShipDuet
          • ๐ŸSnaker
          • ๐Ÿ”ขSolver
          • โŒจ๏ธSpeedPress
          • ๐Ÿ” Wordle
        • ๐Ÿ–Š๏ธMore Editors
          • ๐Ÿ–Š๏ธJSON Editor
          • ๐Ÿ—„๏ธSQL Editor
        • ๐ŸงฐCommon Programs
          • ๐Ÿ“ฆArchive
          • โ˜•Caffeine
          • ๐Ÿ—“๏ธCalendar
          • ๐Ÿ”ขCalculator
          • ๐Ÿ‘ฅContacts
          • ๐Ÿ“•Dictionary
          • ๐Ÿ‘ฉโ€๐Ÿ’ปGit Shell
          • ๐ŸŽงMusic Player
          • ๐Ÿ—’๏ธNotes
          • ๐Ÿ”ŒSSH Connection
          • ๐Ÿ’นStocks
          • โฐStopwatch and Timer
          • โ˜‘๏ธTo-do List
          • โš–๏ธUnit Converter
          • โ˜€๏ธWeather
        • ๐Ÿ–ผ๏ธDocking
        • ๐ŸŒLanguage Studio
        • ๐ŸŽจTheme Studio
      • ๐Ÿ‘คAccounts
        • ๐Ÿ‘ฅGroups
        • ๐Ÿ”“Permissions
      • โœ๏ธEditors
        • ๐Ÿ“Text Editor
        • ๐Ÿ’พHex Editor
      • ๐ŸšShells
        • ๐Ÿ“„Commands List
        • ๐Ÿ“„Addon Commands List
      • ๐Ÿ“‚Files and Folders
        • ๐Ÿ”Hashing and Encryption
      • ๐ŸŒŽNetworking
      • ๐Ÿ‡บ๐Ÿ‡ธLanguages
      • ๐ŸŒŒScreensavers
      • ๐Ÿ“…Lockscreen Widgets
  • Advanced and Power Users
    • โš’๏ธBuilding the Kernel
      • ๐ŸชŸBuilding on Windows
      • ๐ŸŽBuilding on macOS
      • ๐ŸงBuilding on Linux
      • ๐Ÿ“ฑBuilding on Android
    • ๐ŸงฐKernel Modifications
      • ๐ŸงชBuilding your Mod
      • ๐Ÿ“ˆAnalyzing your Mod
        • ๐Ÿ“‰Text - NKS0001
        • ๐Ÿ“‰ConsoleBase - NKS0002
        • ๐Ÿ“‰ConsoleBase - NKS0003
        • ๐Ÿ“‰ConsoleBase - NKS0004
        • ๐Ÿ“‰ConsoleBase - NKS0005
        • ๐Ÿ“‰ConsoleBase - NKS0006
        • ๐Ÿ“‰ConsoleBase - NKS0007
        • ๐Ÿ“‰ConsoleBase - NKS0008
        • ๐Ÿ“‰ConsoleBase - NKS0009
        • ๐Ÿ“‰Files - NKS0010
        • ๐Ÿ“‰Files - NKS0011
        • ๐Ÿ“‰Files - NKS0012
        • ๐Ÿ“‰Files - NKS0013
        • ๐Ÿ“‰Files - NKS0014
        • ๐Ÿ“‰Files - NKS0015
        • ๐Ÿ“‰Files - NKS0016
        • ๐Ÿ“‰Files - NKS0017
        • ๐Ÿ“‰Files - NKS0018
        • ๐Ÿ“‰Files - NKS0019
        • ๐Ÿ“‰Files - NKS0020
        • ๐Ÿ“‰Files - NKS0021
        • ๐Ÿ“‰Files - NKS0022
        • ๐Ÿ“‰Files - NKS0023
        • ๐Ÿ“‰Kernel - NKS0024
        • ๐Ÿ“‰Kernel - NKS0025
        • ๐Ÿ“‰Kernel - NKS0026
        • ๐Ÿ“‰Kernel - NKS0027
        • ๐Ÿ“‰Kernel - NKS0031
        • ๐Ÿ“‰Kernel - NKS0032
        • ๐Ÿ“‰Kernel - NKS0033
        • ๐Ÿ“‰Kernel - NKS0037
        • ๐Ÿ“‰Kernel - NKS0038
        • ๐Ÿ“‰Kernel - NKS0039
        • ๐Ÿ“‰Kernel - NKS0040
        • ๐Ÿ“‰Kernel - NKS0041
        • ๐Ÿ“‰Kernel - NKS0042
        • ๐Ÿ“‰Kernel - NKS0043
        • ๐Ÿ“‰Kernel - NKS0052
        • ๐Ÿ“‰Kernel - NKS0053
        • ๐Ÿ“‰Languages - NKS0044
        • ๐Ÿ“‰Languages - NKS0045
        • ๐Ÿ“‰Languages - NKS0046
        • ๐Ÿ“‰Network - NKS0051
        • ๐Ÿ“‰Text - NKS0047
        • ๐Ÿ“‰Text - NKS0048
        • ๐Ÿ“‰Text - NKS0049
        • ๐Ÿ“‰Text - NKS0050
        • ๐Ÿ“‰Text - NKS0054
        • ๐Ÿ“‰Text - NKS0055
      • ๐Ÿ”งManaging your Mod
        • ๐Ÿ“žInter-Mod Communication
        • ๐Ÿ“žInter-Addon Communication
    • ๐Ÿฆ Diagnostics
      • ๐Ÿ”ฌDebugging
        • ๐ŸงฌLocal Debugging
        • ๐Ÿ›ฐ๏ธRemote Debugging
      • ๐ŸงชTesting
      • ๐Ÿ’‰Other Diagnostics
    • ๐Ÿ“€Bootloader
      • ๐Ÿ‘†Boot Choices
      • โ–ถ๏ธKernel Environments
      • ๐Ÿ’„Custom Boot Styles
    • โš’๏ธInner Workings
      • ๐Ÿ”งKernel Settings
        • โ›๏ธMechanics of Settings App
        • ๐Ÿ”ฉSettings Format
        • โš™๏ธCustom Settings
      • ๐ŸšShell Structure
        • โ”Help System
        • ๐Ÿ—œ๏ธCommand Parsing
        • ๐Ÿ”‹Command Information
        • โฒ๏ธCommand Switch Management
        • ๐ŸŽš๏ธCommand Switch Information
        • โณShell History
        • ๐Ÿ“œShell Scripting
        • ๐Ÿ“ŸShell Presets
        • ๐Ÿ’ Extra Shell Features
      • ๐ŸŒMultilingual Kernel
        • ๐ŸŒCustom Languages
      • โ™ฆ๏ธInner Essentials
        • ๐Ÿ”ŒKernel Drivers
          • ๐Ÿ”ŒConsole Drivers
          • ๐Ÿ”ŒDebug Logger Drivers
          • ๐Ÿ”ŒEncoding Drivers
          • ๐Ÿ”ŒEncryption Drivers
          • ๐Ÿ”ŒFilesystem Drivers
          • ๐Ÿ”ŒHardware Prober Drivers
          • ๐Ÿ”ŒInput Drivers
          • ๐Ÿ”ŒNetwork Drivers
          • ๐Ÿ”ŒRNG Drivers
          • ๐Ÿ”ŒRegular Expression Drivers
          • ๐Ÿ”ŒSorting Drivers
        • ๐ŸชงKernel Placeholders
        • ๐Ÿ”The Permissions
        • ๐Ÿ‘ฅThe Users
        • ๐Ÿ“žKernel Threads
        • ๐ŸŽ›๏ธKernel Arguments
        • ๐Ÿ“’Kernel Journaling
        • ๐Ÿ“กRemote Procedure
        • ๐Ÿ—ƒ๏ธNitrocid Filesystem
        • ๐ŸŒƒScreensaver Internals
        • ๐Ÿ’ฆSplash Internals
        • ๐Ÿ–ฅ๏ธKernel Platform
        • ๐ŸŽจTheme Internals
        • โ›ฑ๏ธColor Internals
        • ๐Ÿ”Privacy Consents
        • ๐Ÿ””System Notifications
        • โœ‰๏ธMAL and MOTD
        • โŒ›Progress Handlers
        • โœ’๏ธAssembly Signing
        • ๐Ÿ”Assembly Reflection
        • ๐ŸŽฐRandom Number Generation
        • ๐ŸŒNetwork Tools
        • ๐Ÿ•™Date and Time
        • ๐Ÿ“–Mod Manual Pages
      • ๐ŸŒ€Miscellaneous APIs
  • ๐ŸงฑProject Dependencies
  • Report an issue
  • Source code
  • API Reference
Powered by GitBook
On this page
  • Build your language
  • Test your language
  • Changing your kernel language
  • Changing your user language
  • Other options for the generator
  • Installing custom languages by hand
  • Your Mods and Your Strings
Edit on GitHub
  1. Advanced and Power Users
  2. Inner Workings
  3. Multilingual Kernel

Custom Languages

How to define your custom languages.

Last updated 3 months ago

When you extract the binary folder of Nitrocid KS, you may see a folder called CustomLanguages. Inside it, you can see the Metadata.json file that holds language metadata as described in the previous article. Before reading this, you must understand the multilingual kernel feature and how it works by clicking on the below link.

Customized languages play an important role in being a building block for making your custom localization. This feature contains two separate folders:

  • <KSExecutablePath>/CustomLanguages

    • This is the folder which you should place the source .txt files containing all your string translations. You should implement all the translations found in the eng.txt file, usually shipped with the Nitrocid KS binary.

  • <KSConfigPath>/KSLanguages

    • This is the folder that hosts all your custom language JSON files containing the translation metadata and the necessary translation data.

When the kernel starts up, it attempts to install all the custom languages found in the KSLanguages path to the language store found within the language manager. This way, the kernel configuration reader will understand that your custom language exists.

Build your language

Cool! So, you want to build your language? First, open the Metadata.json๏ธŽ file found in the CustomLanguages folder. Write details about your language in their appropriate places. For quick reference, here's an excerpt from the metadata JSON prototype:

]
    {
        "three": "lng",
        "name": "My Language",
        "transliterable": false,
        "codepage": 932,
        "culture": "en-GB"
    }
[

Again, the codepage parameter and the culture parameter is optional. If you want your language to be able to be transliterated, make two metadata information about your target language, but append the -T postfix to one of the metadata information name, for example:

]
    {
        "three": "lng",
        "name": "My Language",
        "transliterable": true,
        "culture": "en-GB"
    },
    {
        "three": "lng-T",
        "name": "My Language",
        "transliterable": true,
        "codepage": 932,
        "culture": "en-GB"
    }
[

After you filled in the metadata information about languages you want to create, make a text file with the name of the short language name (lng and not My Language) for each language with the .txt extension, like this: lng.txt

Now, head to Translations/eng.txt and use it as a reference to translate all the strings found there to your target language. Put all your translations to the newly-created file.

Both eng.txt and your language text file MUST have the exact same line numbers!

After this is done, launch KSJsonifyLocales either by double-clicking the executable file (usually Nitrocid.LocaleGen.exe) or by opening the terminal to the executable path and executing the dotnet Nitrocid.LocaleGen.dll command.

You can also let this program generate only the custom locale information by passing the --CustomOnly argument to it.

Test your language

After Nitrocid.LocaleGen finishes compiling the JSON file containing your translation, you should be able to find the resulting file in the <KSConfigPath>/KSLanguages folder.

Open Nitrocid KS, and change your system language or your user language to your customized language.

Changing your kernel language

If you want your language to be used in the entire kernel, follow these steps:

  1. Log in to any user account that has administrative permissions or access to the kernel settings program

  2. Execute the settings command

  3. Go to General section

  4. Go to Language entry

  5. Select your language. Your language should be there among the list of the kernel languages.

Changing your user language

If you want your language to be used just for your user account, follow these steps:

  • Log in to any user account that has administrative permissions or access to the kernel settings program

  • Execute the admin command

  • Execute the userlang command, pointing it to a user account and a language as needed

  • Log out and log in as that user

Other options for the generator

This locale generator comes with options to change how it works. These switches provide the following functions:

  • --CustomOnly

    • Restricts the generator to custom languages

  • --Singular <lang>

    • Restricts the generator to a single custom or normal language

Installing custom languages by hand

If you have a custom language file and you want to quickly install it without having to restart the entire kernel, you can use the langman command to use the following parameters:

  • load <lang>

    • Loads the custom language.

  • unload <lang>

    • Unloads the custom language.

  • reload <lang>

    • Reloads the custom language. Synonymous to the sequence of the unload and the reload parameters.

To check that your language is installed, use list <lang> to verify that your language is there and that its information is available.

For mods that want to install or uninstall custom languages, you can use the API functions found within the LanguageManager module.

Your Mods and Your Strings

Your mods can now be translated! Nitrocid KS can now detect your language files from your mods. The mod parser within the kernel looks for the localization files found under the KSMods/Localization/Mod-FileVersion/ path. The format is in JSON, and the file name is the same as the three-letter language name. The format is the same as the regular Nitrocid KS localization files embedded as resources. For example, for the French language, the format would look like below:

fre.json
{
  "Name": "French",
  "Transliterable": false,
  "Localizations": {
    "Invalid color template {0}": "Modรจle de couleur non valide {0}",
    (...)
  }
}

You must use the mklang command within Nitrocid, pointing to a directory that contains your language metadata and your eng.txt file containing all strings from your mod in order to be able to translate them within the app. When you're done, save your changes by choosing the Save option.

In the Localizations property, it holds a group of keys and values. The key is an original string extracted from your mod ("Invalid color template {0}") and the value is the translated string ("Modรจle de couleur non valide {0}").

When Nitrocid KS detects your localization file, it tries to parse it and adds your translated strings to the ModInfo class, which is used by the Translate static class to translate your mod strings.

โš’๏ธ
๐ŸŒ
๐ŸŒ
๐ŸŒMultilingual Kernel