Skip to content

Localization

Jannik edited this page Sep 13, 2023 · 2 revisions

LoriTime supports a number of collaborative translations of the plugin locales into different languages. The default language is en (English). The message file is formatted with MiniMessage.

You can change the language to use by changing the general.language key in the config.yml file of the plugin. You must change this setting to one of the supported languages. You can view a list of supported languages by looking at the locales source folder. The key is the file-name.

A special feature of the localization are the adjustable identifiers of the time strings. The identifiers are used to recognize whether the time units seconds, minutes, hours or others are meant. In the example below it is indicated that months have the identifier mo, weeks the identifier w, seconds the identifiers s and sec. These are to be changed as desired. Please note that the identifiers must be unique and not the same!

Identifier in Locale (en.yml)
unit:
  second:
    singular: 'second'
    plural: 'seconds'
    identifier:
      - 's'
      - 'sec'
  minute:
    singular: 'minute'
    plural: 'minutes'
    identifier:
      - 'min'
      - 'm'
  hour:
    singular: 'hour'
    plural: 'hours'
    identifier:
      - 'h'
  day:
    singular: 'day'
    plural: 'days'
    identifier:
      - 'd'
  week:
    singular: 'week'
    plural: 'weeks'
    identifier:
      - 'w'
  month:
    singular: 'month'
    plural: 'months'
    identifier:
      - 'mo'
  year:
    singular: 'year'
    plural: 'years'
    identifier:
      - 'y'
      - 'yhr'

Contribute locales

You can contribute locales by submitting a pull request with a yml file containing translations of the default locales to your language. Here are a few hints on how to do this:

  • Do not translate the locale keys themselves (e.g. teleporting_offline_player).
  • Your pull request should be for a file in the locales folder.
  • Do not translate the MiniMessage syntax itself or commands and their parameters; only the English interface text.
  • Each locale should be on one line, and the header line should be removed.
  • Use the correct ISO 639-1 locale code for your language and dialect.
Clone this wiki locally