How to add a new language to Book Library, ebook library manager

This article will describe how to add a new language file to the Book Library component for Joomla

Obtaining or creating language files

Many Language files for the Joomla Book Library component (if not already included in the Pro version) can be obtained from the website. But if your language isn't there yet, you can translate Book Library yourself and add your language. Once you have it, please share it on the website to help others!

How to translate language variables of Book Library, eBook library manager

First, find the file called english.php, either in your installation or in the zip archive of the component. Or download the latest English language file for Book Library from the Book Library languages section of the website. In the BookLibrary installation it is located in the directory /components/com_booklibrary/language/.

Next, make a copy of english.php and rename it to your own language, for example dutch.php. Now open dutch.php with a text editor which is capable of handling UTF-8. We recommend PSPad if you are on a Windows operating system.

WARNING: All Joomla files need to be saved as UTF-8. WordPad or Notepad can NOT handle UTF-8, so they are NOT FIT to create or edit these files with! Try PSPad instead (http://www.pspad.com/), and set it under Format to UTF-8before you edit and save your files.
A partial example of what you will see:
/**
*
* @package BookLibrary
* @copyright Andrey Kvasnevskiy-OrdaSoft( This e-mail address is being protected from spambots. You need JavaScript enabled to view it ); Rob de Cleen( This e-mail address is being protected from spambots. You need JavaScript enabled to view it );
* Homepage: http://www.ordasoft.com
* @version: 3.5 FREE
*
*/
if (!defined('_VALID_MOS') && !defined('_JEXEC')) die('Direct Access to ' . basename(__FILE__) . ' is not allowed.');
$LangLocal = array('lang_code'=>'en-GB', 'title'=>'English');
$constLang = array();
$constLang[] = array('const'=>'_BOOKLIBRARY_TITLE', 'value_const'=>'BookLibrary');
$constLang[] = array('const'=>'_BOOKLIBRARY_DESC', 'value_const'=>'Our library with suggestions for books for you to enjoy.');
$constLang[] = array('const'=>'_BOOKLIBRARY_SEARCH_DESC1', 'value_const'=>'Search books');

You translate the text portions only, so ONLY the parts between the single quotes (marked with this color).
Language tag should be changed in format xx-XX, see all language tags here

Example translation for Dutch (NL) would look like this:

/**
*
* @package BookLibrary
* @copyright Andrey Kvasnevskiy-OrdaSoft( This e-mail address is being protected from spambots. You need JavaScript enabled to view it ); Rob de Cleen( This e-mail address is being protected from spambots. You need JavaScript enabled to view it );
* Homepage: http://www.ordasoft.com
* @version: 3.5 FREE
*
*/
if (!defined('_VALID_MOS') && !defined('_JEXEC')) die('Direct Access to ' . basename(__FILE__) . ' is not allowed.');
$LangLocal = array('lang_code'=>'nl-NL', 'title'=>'Dutch');
$constLang = array();
$constLang[] = array('const'=>'_BOOKLIBRARY_TITLE', 'value_const'=>'BookLibrary');
$constLang[] = array('const'=>'_BOOKLIBRARY_DESC', 'value_const'=>'Onze bibliotheek met suggesties voor boekendie je misschien leuk en nuttig vindt.');
$constLang[] = array('const'=>'_BOOKLIBRARY_SEARCH_DESC1', 'value_const'=>'Boek zoeken');

Continue to translate all language variables in your language.

REMARK: You can use accented letters and special characters like é, ô, ü, ç, ñ, ¿. ©, ß etc. inside the files, with ONE exception:
You cannot use single quotes inside the language variables.
Please replace all single quotes ( ' ) with back-accents ( ` ) So for example French "l'emprunt" inside a language variable needs to be written "l`imprunt".This is because single quotes are part of the PHP code normally. The ` or back-accent will be ignored by PHP and interpreted as normal text.

Adding your language file to the Joomla Book Library installation

You can either do the operations on the component archive and then re zip and install, or edit the necessary files in place inside an existing installation.
  1. Place your language file inside the directory
  2. /components/com_booklibrary/language/using an FTP client or similar(if you are on a shared hosting account, please use internal Joomla FTP or QuiXplorer or similar to preserve the file ownership).
  3. In the file booklibrary.xmlin the directory/components/com_booklibrary/add the language entry for your language.
  4. This goes right after the entrylanguage/english.php. So if you use for example Dutch and Spanish on your site you would add those, like this:

    language/english.php
    language/dutch.php
    language/spanish.php
  5. To ensure the languages you use are visible inside the dropdown boxes in the administration part for selecting, you will need to add the language entries to every language file in use in your installation. In each language file, find the part marked //Languages and add your language there.
  6. Example:
    //Languages
    DEFINE('_BOOKLIBRARY_LANGUAGE_NOT_USED', 'Not specified');
    DEFINE('_BOOKLIBRARY_LANGUAGE_ENG', 'English');
    DEFINE('_BOOKLIBRARY_LANGUAGE_DUT', 'Dutch');
    DEFINE('_BOOKLIBRARY_LANGUAGE_GER', 'German');
    DEFINE('_BOOKLIBRARY_LANGUAGE_FRE', 'French');
    DEFINE('_BOOKLIBRARY_LANGUAGE_ITA', 'Italian');
    DEFINE('_BOOKLIBRARY_LANGUAGE_SPA', 'Spanish');
    etc.
  7. Save each file.
  8. Remember to translate the entries according to the language file you are editing. That's it, you're done!

Sharing your created language files with the community

Once you have a working translation for Book Library ready, please share it on the website to help others! You will receive full credits for your work in the Book Library Languages Section, as well as a link to your website.

    Submitting language files for Joomla Book Library can be done in way of attaching the file in a forum post. When submitting your language file, please mention:
  1. version of Book Library the language translation is for
  2. your name as you want it mentioned in the credits
  3. the website you want mentioned in the credits
Thank you in advance for sharing your efforts with the rest of the Book Library users!
What are you looking for?
Anti-spam question: How many eyes has a typical person?