Localization

Introduction

openClinic is developed for use by everyone from every country, we aim to support as many languages as we could however we need your help to translate languages that we don't have expertise in. Language strings are stored in files within the resources/lang directory. Within this directory there should be a subdirectory for each language supported by the application:

/resources
    /lang
        /en
            general.php
        /ms
            general.php

All language files return an array of keyed strings. For example:

<?php

// resources/lang/en/general.php

return [
    'welcome' => 'Welcome to openClinic'
];

Pluralization

Pluralization is a complex problem, as different languages have a variety of complex rules for pluralization. By using a "pipe" character, you may distinguish singular and plural forms of a string:

'apples' => 'There is one apple|There are many apples',

You may even create more complex pluralization rules which specify translation strings for multiple number ranges:

'apples' => '{0} There are none|[1,19] There are some|[20,*] There are many',

Submiting new localizations

The process of submitting a new localization or an update of an existing one is as simple creating a pull request with the updated file or opening up an issue with the linked localization file.