Jamroom Logo Jamroom 5 Core
is now Open Source!
Follow Jamroom on Twitter!

Allowing Media importing via FTP Index Creating and Selling Event Tickets using the Jamroom Vault

Translating Jamroom into a different language

It’s very easy to translate Jamroom into your local language (or a language you are fluent in). Jamroom separates the “text strings” that your users see into a separate file, depending on the language. This makes it easy to modify the language of the Jamroom Features without having to modify any code.

Jamroom Control Panel

  • The language files for the Jamroom Control Panel are located in the jamroom/language directory, and by default “on a new Jamroom install” the directory will contain only 1 language file:
english.lang.php
  • Creating a new language file is easy - simply copy the “english.lang.php” file to the name of the new language file you would like to create - i.e.:
cp english.lang.php newlanguage.lang.php
  • Next, open the new file in your favorite text editor and replace ALL of the English strings with their “new language” equivalents.
Note: The Language files must be 100% valid PHP, since they are “sourced” in by Jamroom, and any PHP syntax errors in the language file will result in a PHP error in your User Menu, or missing parts of menus, etc.

Note: the Language Strings in the Jamroom Master Admin Control Panel are hard coded in English - since the Master Admin is the only user to ever see this section of Jamroom, it has been left in English to allow better support for any issues that might arise.
  • After you’ve finished translating the language file, the next step is to “install” the language file so Jamroom will see it. Make sure your new language file is located in the jamroom/language directory:
jamroom/language/newlanguage.lang.php
  • Next, open the jamroom/config/language.cfg.php file, and add your new language file in:
$lang['available_languages'] = array(
  'english.lang.php'     => 'english',
  'newlanguage.lang.php' => 'New Language'
);

This will “activate” the new language once you save the file.

  • The final step is to log in to your Jamroom, go to the “Account Info” link from the Control Panel and change your language to the newly installed language. Save your settings, and if everything was entered correctly in the language file, the Control Panel will now show up in your new language!
Note: If you receive any PHP errors, simply modify the jamroom/language/newlanguage.lang.php file and fix the syntax errors on the lines indicated in the PHP error.

Jamroom Skins

Beginning with Jamroom 4.1, the capability to make the Jamroom Skin multilinguall was introduced.  This is possible becuase the actual text strings that the viewer sees when viewing your Jamroom are stored in a "language file" that can be modified easily without having to change any of the skin templates.  For our stepsbelow we will use the "Sage" skin as an example.  If you are using a different Jamroom 4.1 skin, modify the paths to suit your installation.
  • The first step is to make a copy of the default English language file:
jamroom/skins/Sage/lang/en-US.php
the "proper" naming method for the file is based on the 2 letter country and locale code - i.e. "es-ES.php" for Spanish, etc.  You will find a listing of country and locale codes in the "lang_ccodes.txt" file located in the same lang sub directory.  You can download the en-US.php file to your local computer and rename it before editing.
  • Next, you want to open the file you have just downloaded and renamed in a text editor (such as notepad or wordpad) - it is not recommended that you edit this file in an HTML editor, as this can cause syntax errors within the file - a "plain" text editor is best.  What you'll need to do at this point is translate each "string" of text in the main part of the language file into the language you want.
Note: Important!  The Language file is a PHP script - it must contain valid PHP code.  If the string you are translating has single quotes in the string, they will need to have a backslash added before the single quote in order to prevent a PHP Syntax error - i.e.
  • Next, make sure the "name", "charset" and "direction" options at the top are set properly (most languages are ltr (left-to-right), but if you are using a right-to-left language such as Hebrew, make sure and set the "direction" to "rtl").
  • Next, you can upload the new language file to the jamroom/skins/Sage/lang directory - this "adds" the language to the skin.
  • Finally, you will now need to edit the template within the skin that gives the viewer the abiltiy to click on the smal flag icon (or link) that "sets" the new language to be their viewing language.  In the "Sage" skin, this file is called "jr_overall_header.tpl", and you will see a section in the template that looks like this:

<a href="{$JAMROOM_URL}/index.php?lang=en-US&amp;ref=1"><img src="{$SKIN_URL}/images/flags/us.png" alt="us" title="us" style="padding-bottom:2px"></a>
<a href="{$JAMROOM_URL}/index.php?lang=en-GB&amp;ref=1"><img src="{$SKIN_URL}/images/flags/gb.png" alt="gb" title="gb" style="padding-bottom:2px"></a>

You will want to add your new language flag into the section:

<a href="{$JAMROOM_URL}/index.php?lang=es-ES&amp;ref=1"><img src="{$SKIN_URL}/images/flags/es.png" alt="es" title="es" style="padding-bottom:2px"></a>

(Note that "es-ES", Spanish, was used here as an example - you'll want to use the actual language file you have created).

Save your template, then give it a test - if there are no syntax errors in your new Language file, you should be set!

Jamroom Profile Themes

Beginning in Jamroom 4.1, the ability for a Profile Theme to support multiple languages in the same templates was added - this makes translating the profile theme templates very easy and fast.  For our steps below we will use the "Sage" theme as an example.  If you are using a different Jamroom 4.1 theme, modify the paths to suit your installation.

  • The first step is to make a copy of the default English language file:
jamroom/themes/Sage/lang/en-US.php
the "proper" naming method for the file is based on the 2 letter country and locale code - i.e. "es-ES.php" for Spanish, etc.  You will find a listing of country and locale codes in the "lang_ccodes.txt" file located in the same lang sub directory.  You can download the en-US.php file to your local computer and rename it before editing.
  • Next, you want to open the file you have just downloaded and renamed in a text editor (such as notepad or wordpad) - it is not recommended that you edit this file in an HTML editor, as this can cause syntax errors within the file - a "plain" text editor is best.  What you'll need to do at this point is translate each "string" of text in the main part of the language file into the language you want.
Note: Important!  The Language file is a PHP script - it must contain valid PHP code.  If the string you are translating has single quotes in the string, they will need to have a backslash added before the single quote in order to prevent a PHP Syntax error - i.e.
  • Next, make sure the "name", "charset" and "direction" options at the top are set properly (most languages are ltr (left-to-right), but if you are using a right-to-left language such as Hebrew, make sure and set the "direction" to "rtl").
  • Next, you can upload the new language file to the jamroom/themes/Sage/lang directory - this "adds" the language to the theme.
  • Finally, make sure you have followed the steps outlined above in adding a new language to your Jamroom Skin - it is within the skin templates you want to allow your visitors to make their language selection.

 

Sharing your new language translation with other Jamroom users

If you are fluent in a language that Jamroom has not yet been translated into, and would like to make your language translation available to other Jamroom users, please send an e-mail to  support@jamroom.net - Note that you can receive a free Jamroom upgrade for your work!


Allowing Media importing via FTP page 38 of 171 Creating and Selling Event Tickets using the Jamroom Vault
Solutions Products Support Community Company
Social Media Platform
Social Networking Software
Musician Website Manager
Community Builder
Jamroom 5
Jamroom 5 Modules
Jamroom Marketplace
Support Forum
Documentation
Support Center
Contact Support
Community Forum
Member Sites
Developers
About Us
Contact Us
Privacy Policy
©2003 - 2024 The Jamroom Network