C. Translating Hotcakes to your native tongue

How to go about to create an extra language for Hotcakes.

C.1. Multi Language support

Hotcakes Beta-5 has is a new feature which enables you to translate Hotcakes in your native language. The default is English.

Your language may already be included, but if not, here's the steps you could follow to implement it. We will take the Afrikaans language as a sample.

  1. Ensure the locale package of the language installed.

    This will typically be a package like 'language-pack-af' for Afrikaans.

  2. To confirm, you can check the name of the locale under the '/usr/lib/locale' directory.

    The Afrikaans one is shown as 'af_ZA.utf8'.

  3. This will be used in the links which cause the language to change. You change the link by giving the locale string as an parameter to the '/cake/hotcakes/landing_pages/set_language' page.

    To set the language to Afrikaans, a link will look like this: href="/cake/hotcakes/landing_pages/set_language?language=en_ZA.utf8"

  4. The file containing all the translatable phrases (messages.po) is situated under '/var/www/cake/hotcakes/plugins/locale'.

    The different languages are in their respective folders under the 'locale' folder (without the '.utf8'). See the existing ones as reference, and remember 'msgfmt' to generate the 'messages.mo' file.

  5. If your install is not under '/var/www/cake' please edit the 'hotcakes/app_controller.php' file to reflect the current location. (value of '$locale_location')

  6. You may want to add menu entries for this language.

    /var/www/cake/hotcakes/webroot/files/menu_cashier.php
    /var/www/cake/hotcakes/views/layouts/default.thtml
    /var/www/cake/hotcakes/views/layouts/client.thtml
    /var/www/cake/hotcakes/webroot/files/menu.php

  7. Flags are under '/var/www/cake/hotcakes/webroot/img/flags'.

Tip

You are also encouraged to donate the translation back to the Hotcakes project for integration.