CoreInto's pages are written in English, and every text they show can be translated. A language is one file: CoreInto's own languages are in app/lang, yours go in storage/lang. CoreInto comes with Urdu; you can add any other language by filling in a template. Clients, staff and visitors can each use their own language, and emails follow the language of the client's account.
How languages are chosen
Each page is shown in the first of these that applies:
| Who | Language used |
|---|---|
| An administrator | Their own choice on My Account, Language. Empty means the default. |
| A signed-in client user | Their own choice: the language menu in the footer, or the Language box on Account Details. Empty means the default. |
| A visitor who is not signed in | The language they picked in the footer menu (kept in a cookie for a year). |
| Everyone else | The setting Default language (General Settings, Localisation). |
A client who signs up gets the language they were reading the site in; it is recorded on their account and used for the emails CoreInto sends them.
The footer menu and the Language box on Account Details appear only when more than one language is installed and the setting Clients may choose their language (General Settings, Localisation) is on. Turn it off to keep every client on the default language.
Right-to-left languages (Urdu, Arabic, Persian, Hebrew) turn the page layout around: menus, tables and forms run from the right. Numbers, addresses, codes and email addresses stay left to right.
Settings, Languages
This page lists every installed language with its code, its own name, its direction, its file, and how many of CoreInto's texts it translates. Texts a file does not translate are listed under it, so you can see what is left to do. A language is marked Default when it is the one chosen under General Settings.
Download the template gives you a file with every text CoreInto shows and an empty translation next to each. The Download button on an installed language gives you that language's file with its translations filled in and the missing ones empty, which is the file to work on after an update of CoreInto added new texts.
Adding a language
- On Settings, Languages, choose Download the template. You get a file
xx.php. - Open it in a text editor that saves UTF-8 (most do). The file is a list of lines like this:
`` 'Clients' => '', ``
Put the translation between the second pair of quotes:
`` 'Clients' => 'Kunden', ``
The two lines at the top are the language's own name, as it should appear in menus, and its direction: ltr, or rtl for a right-to-left script.
`` '@name' => 'Deutsch', '@dir' => 'ltr', ``
- Keep the marks
%sand%dwhere a number or a name is filled in, and the{{names}}in braces. If your sentence needs them in another order, number them:%2$sis the second value,%1$dthe first. An apostrophe inside a translation is written\'. - Leave a translation empty when you are not sure: the English text is shown for it. Nothing breaks when a file is incomplete.
- Upload the file to
storage/lang/on your server, named by the language's code with the.phpextension:de.phpfor German,ar.phpfor Arabic,fr.phpfor French. Codes are two or three lowercase letters, optionally with a region:pt-BR. - The language appears on Settings, Languages at once. Choose it as the default under General Settings, Localisation, or let people choose it themselves.
Neither folder is served to browsers. Updates keep storage/lang (an update replaces everything except configuration.php and storage/), so keep your own files there. A file in storage/lang with the same code as one in app/lang replaces it, for example your own corrected ur.php.
Keeping a language up to date
An update of CoreInto can add texts. On Settings, Languages, the count for each language then shows how many are untranslated, and the list under it names them. Download that language's file, translate the empty lines, and upload it again.
Translations of texts CoreInto no longer shows are listed too; they are harmless and are dropped when the file is next written by the tool below.
Email templates in other languages
The interface files translate the pages. Emails are templates of their own, edited under Settings, Email Templates. When more than one language is installed, a template's page has a tab for the default text and one for each language. Open a language's tab, change the subject and message, and save: that makes the version for that language. When an email goes to a client, CoreInto uses the version in the client's language if there is one, and the default text otherwise. Remove This Version takes a language version away again, and turning a template off stops every version. See Email.
Announcements and knowledgebase articles are written by you, so they are in whatever language you write them in.
The command-line tool
For people who keep a copy of the code and prefer the command line, the same template and checks are in tools/lang.php, run from the CoreInto folder:
php tools/lang.php template "Deutsch" > storage/lang/de.php # a new, empty file
php tools/lang.php template "العربية" rtl > storage/lang/ar.php # a right-to-left one
php tools/lang.php check de # what de.php is missing or no longer needs
php tools/lang.php update de # rewrites de.php with every current text, keeping its translations
php tools/lang.php keys # every text CoreInto shows, one a line
check exits with 1 when texts are missing, so it can run in a script.
What is translated
Every text on the admin and client pages: menus, titles, labels, buttons, help texts, messages after an action, error pages, the settings pages (labels, tabs, help and choices), report names and column headings, and the common status words (Active, Pending, Paid, Overdue and so on). Names you enter yourself (products, groups, departments, ticket statuses, custom fields) are shown as you typed them. Country names come from a built-in list in English.
