Latest News - July 2020: MIDAS v4.25 Now Available | COVID-19 Support

MIDAS Knowledge BaseMIDAS Knowledge Base

How to translate MIDAS into another language or improve upon an existing translation

If you'd like to translate MIDAS into another language, or think you can improve upon an existing translation, we'd love to hear from you!
Head on over to our translation tool to start translating and submitting your language changes online!

If instead you wish to make "custom" language modifications specific to your own self hosted MIDAS room scheduling system, then please read on...

Editing a Language file

Existing Language files have the file extension .pm and reside within the "language" directory of your software installation.

These .pm files may be opened in a regular text editor.

When you open a language file in a text editor, you will see the file starts with the following section:

package lang;

### MIDAS LANGUAGE PACK ###
#Language: English (US)
#File Version: 1.00
#Author: https://mid.as
###########################

sub ln {
my $pkg=shift;my $obj={

'charset' => q!UTF-8!,

Edit the RED TEXT to give a brief description of the language you are translating into.

Edit the BLUE TEXT to show your name, contact e-mail (if desired), and/or your Website.

Edit the GREEN TEXT if the language you are translating into requires a different Character Set to display correctly in a web browser.

NO OTHER EDITING OF THIS SECTION OF THE FILE IS REQUIRED.

The following lines in the language file are split into two parts, for example:

'manage_venues' => q!Manage Venues!,

The first part of each line (i.e. 'manage_venues' in the above example) denotes an internal variable, and should NOT be changed.

The second part of the line (the section in between the two "!" markers, 'Manage Venues' in the above example) is the part to be translated.

TIP: Be sure to leave every other part of the line "as is". Removing or changing any other part of a line may cause the software to function incorrectly, or not at all. Pay particular attention to the trailing comma (,) at the end of each line

TIP: If you need to use the "!" character as part of a translated phrase, precede it with a "\" character Example: "The end time cannot come before the start time\!"

TIP: If you encounter the characters "<BR>" in translated phrase, the software interprets this as meaning 'start a new line" - Please leave them in!

The final few lines of the language file (shown below) should be left untouched:

};
bless $obj, $pkg;return $obj;
}
1;

If you wish to create a new translation, (rather than modifying an existing one), then be sure to save your changes as a new .pm file within the "languages" directory. We advising using the filename format "xx-XX.pm" where "xx" is the two-letter language code for your translation (i.e. for English, this would be "en"), and where "XX" is the two-digit country code for your translation (i.e. for the UK, this would GB).

In order for your new language file to be recognized, you'll also have to make a small change to the "midas.dat" settings file in your MIDAS server installation. We strongly recommend making a backup of this file before proceeding.

Open the "midas.dat" file up in a regular text editor, and locate the "language" section of the JSON data. Create a new entry in this section, and add the filename of your new .pm language file (omitting the ".pm" part) as the "id", and a descriptive name for your language in as the "name". For example:

{
"id" : "en-GB",
"name" : "English (British)"
},

Save changes to your "midas.dat" file back to the server, and reload your MIDAS login screen. Your new language should now be listed in the language drop-down. If you don't see a drop-down language selector, then you may need to enable it via MIDAS Admin Options → Manage MIDAS → Appearance → Language Settings.


You might also be interested in...


MIDAS » KB » Support » Article 00009

← Return to Knowledge Base