Languages

Seven languages out of the box, and any word can be changed on your own installation.

Loghound speaks seven languages out of the box. You can reword any of them, or add a language of your own, on your own installation and without touching the code.

Everything is translated

The panel, every chart and table, the settings, the sign-in page, the installer, and the messages the server sends back when something goes wrong. A word that has no translation yet is shown in English, so nothing is ever left blank.

01 · The languages it ships
  • English — the original every other language is translated from
  • Română — Romanian
  • Français — French
  • Deutsch — German
  • Español — Spanish
  • 中文 — Simplified Chinese
  • 日本語 — Japanese

Two things stay the same in every language, on purpose. Dates are always written as mm/dd/yyyy hh:mm:ss, and CSV exports are always written in English, so a file exported from one installation imports into any other, whatever language each of them is set to.

02 · Choosing the language
In the panel

Open Settings → Display, pick a language and save. The whole panel switches at once. The choice belongs to the installation, so everyone who signs in to it sees the same language.

While you install

Every setup screen has a row of language links at the top. Until you pick one, the installer uses the language your browser asks for. Whatever you pick is saved with the rest of the setup, so the panel opens in that same language when you finish.

In the configuration file

For an installation you set up with a script: put 'language' => 'ro' in the 'ui' section of config/loghound.php, using the language’s code (en, ro, fr, de, es, zh, ja).

03 · Changing a word you do not like

Every translation is a plain text file that pairs each English sentence with its translation. To change a few of them, you do not edit that file: you write a small file of your own that holds only the sentences you want different, and Loghound puts yours on top.

  1. Create config/lang/ inside the Loghound folder, and in it a file named after the language: ro.json for Romanian, de.json for German.
  2. Write the English sentence on the left and your wording on the right. Copy the English exactly, capitals and full stops included.
  3. Reload the panel. Everything you did not list keeps its normal translation.
{
    "Settings": "Configurare",
    "Recent visitors": "Ultimii vizitatori"
}

Create the file as the Loghound user, so the panel is allowed to read it:

sudo -u loghound mkdir -p /opt/loghound/config/lang
sudo -u loghound vi /opt/loghound/config/lang/ro.json
Your changes survive upgrades

An upgrade replaces the translations Loghound ships, but it never touches config/lang/. Your wording stays exactly as you left it.

04 · Adding a language Loghound does not ship

Every sentence Loghound can show is listed in one file, lang/template.json, with English on both sides. Copy it into config/lang/ under the code of your language, then replace the English on the right with your translation.

sudo -u loghound cp /opt/loghound/lang/template.json /opt/loghound/config/lang/pt-BR.json

Put the name of the language, written in the language itself, at the top of the file. That is what the language list in Settings → Display will show:

{
    "@name": "Português (Brasil)",
    "Settings": "Configurações",
    ...
}

The language appears in the list as soon as the file exists. You do not have to translate everything before you start using it: whatever is still in English simply shows in English.

Words like {n} in curly brackets

Loghound fills those in itself: a number, a file name, a link. Keep every one of them in your translation, spelled the same, and move it wherever your sentence needs it.

Sentences that change with a number

“1 visit” and “5 visits” are one entry with a form for each case. Give the forms your language uses; a language with only one form, like Chinese or Japanese, writes a single sentence instead.

Seeing what is left to translate

This lists every sentence your file is still missing, and warns about any curly-bracket word you changed by mistake. Run it again after each upgrade: new features bring new sentences.

cd /opt/loghound && php tools/i18n.php check pt-BR
05 · Sharing a translation

If you translated Loghound into a language it does not ship, or fixed a wording that was wrong for everyone, send it on GitHub as lang/<code>.json and it can ship with the next release for every installation.

Loghound is open source and MIT licensed. Questions about the Opensolr half — the account, the indexes, the plan — go to opensolr.com/contact; questions about the software itself belong on GitHub.

Loghound Documentation