HowTo: Create a Custom SCInterface UI Language

From SCInterface Wiki

Jump to: navigation, search

The SCInterface UI allows you to create custom languages for the web interface. The following article describes the [[UI]s architecture for language files and how to create your own custom language.

Background on Languages

As of SCInterface v2.2, there are two interfaces that have three separate sets of language files:

  1. Main Web Interface - This is the main UI. The configuration setting for this variable is located under scinterface/www/include/variables.php. Modify the following line and make sure it is set to one of the following:
    $LANG = "games";
    $LANG = "sensors";
    $LANG = "servers";
  2. PocketSCI (Mobile Web) Interface - This is the PDA or mobile interface for the UI. The configuration setting for this variable is located under scinterface/pda/www/include/variables.php. Modify the following line and make sure it is set to one of the following:
    $LANG = "games";
    $LANG = "sensors";
    $LANG = "servers";

Create a Custom Language

One of the things to consider when creating a custom language, is that with each new release of SCInterface, the language default language files listed above will be updated automatically by the SCInterface development team. With a new release, you may want to keep an eye out for any updates or changes to these language files since your language file may need to be updated as well.

The following describes the general process for creating a custom language within SCInterface:

  1. Think of a name for your new language. In this example, we'll call it mynewlang.
  2. Create a new language directory for your language for both of the UIs (PocketSCI (Mobile Web) Interface and the Main Web Interface):
    1. On an Apache/PHP Linux server:
      mkdir scinterface/lang/mynewlang/
      mkdir scinterface/pda/lang/mynewlang/
  3. Make a copy of the default language en for both of the UIs (PocketSCI (Mobile Web) Interface and the Main Web Interface) to the mynewlang folder:
    1. On an Apache/PHP Linux server:
      cp scinterface/lang/en/* scinterface/lang/mynewlang/
      cp scinterface/pda/lang/en/* scinterface/pda/lang/mynewlang/
  4. The language configuration settings for both of the UIs (PocketSCI (Mobile Web) Interface and the Main Web Interface) will need to be configured to use mynewlang for the variable $LANG:
    1. On an Apache/PHP Linux server:
      1. Edit the Main Web Interface:
        vi scinterface/www/include/variables.php
        Edit $LANG = "mynewlang";
        Save scinterface/www/include/variables.php (within vi, type :wq)
      2. Edit the PocketSCI (Mobile Web) Interface:
        vi scinterface/pda/www/include/variables.php
        Edit $LANG = "mynewlang";
        Save scinterface/pda/www/include/variables.php (within vi, type :wq)
  5. Edit all of the files within the mynewlang folder for both of the UIs (PocketSCI (Mobile Web) Interface and the Main Web Interface):
    1. On an Apache/PHP Linux server:
      scinterface/lang/mynewlang/langfile.php
      scinterface/lang/mynewlang/preheader-langfile.php
      scinterface/lang/mynewlang/titles.php
      scinterface/pda/lang/mynewlang/langfile.php
      scinterface/pda/lang/mynewlang/preheader-langfile.php
      scinterface/pda/lang/mynewlang/titles.php
  6. The mynewlang language is now ready to be used by both the PocketSCI (Mobile Web) Interface and the Main Web Interface.

Additional References

Personal tools