wiki:Creating a Language Pack
Last modified 7 years ago Last modified on 05/24/11 03:03:10

Preparing

Make some decisions

  1. Find a translator. You will need the following information about this person:
    • Real name
    • Email
    • Make up a username
    • Make up a password
  1. The short name for your language. This is something like "english" (as opposed to "U.S. English"). In this document, this name is referred to as "YOUR_LANG".
  2. The formal name for your language. This is what people will see on the screen. It will be something like "U.S. English" or "Norwegian (Nynorsk)". This is referred to as FORMAL_LANG_NAME.
  3. The language code for your language. The identifier for the language. Consists of the ISO language name code plus a hyphen plus the ISO country code. E.g. eng-US for U.S. English. Some languages may not require a country specification; they may be identified by the language code only. E.g. arb for Arabic or urd for Urdu. This is referred to as LANG_ID.
  4. A flag icon or other image to represent your language. It should be 32x32 pixels.

With the AMIS source tree

  1. Get the full AMIS source tree (big download):

NOTE: AMIS has moved to github; new instructions coming soon.

svn co https://daisy-svn.cvsdude.com/amis
  1. In the AMIS subversion tree, go to the amis/trunk/langpacks directory
  2. Unzip the generic.tar.gz file
  3. Rename the directory "generic" with the short name for your language (see above).

With the DAISY Lion

  1. Get the DAISY Lion source tree:
    svn co https://daisy-svn.cvsdude.com/lion
    
  2. Make sure your machine can log into the DAISY Lion server. Contact the project administrator to set this up.
  3. Go to the lionapp/trunk/lion/daisylion/scripts directory
  4. Generate the correct configuration file for AMIS
    python ../config/generate_config.py amis combo > ../config/lion.cfg
    
  1. Run the add_lang script (found in lionapp/trunk/lion/daisylion/scripts)
    • Supply a username and password for the translator.
    • Also supply an ID for your language. Use LANG_ID (see above).
      python add_lang.py --langname="My Language" --realname="Trans Lator" --email="translator@email.com" LANG_ID translator_username translator_password
      
  1. Until this is part of the language creation process, do this too (run_sql.py is in lionapp/trunk/lion/daisylion/scripts):
    python run_sql.py "UPDATE languages SET audiodir=\"langpacks/YOUR_LANG\" WHERE langid=\"LANG_ID\""
    

The directory "amis/trunk/langpacks/YOUR_LANG" is the same as what you created in the AMIS source tree (using the short name for your language). The LANG_ID value is the one you calculated according to the guidelines (see above).

Be careful to specify the WHERE .. part of the statement -- otherwise you will overwrite all audiodir values for all languages. Also be sure to properly escape quotes (as shown).

Translating

  1. The translator goes to the DAISY Lion website and logs in using their username and password
  2. They follow all the instructions and translate all the text
  3. They download a list of all the prompts and use Obi to make audio recordings
  4. They upload these recordings in a batch at the DAISY Lion website.
  5. They download the help file and translate it.
  6. They record the help file as a DAISY book.
  7. They submit the help file to the AMIS team.

Collect output

With the DAISY Lion

  1. Make sure your machine can log into the DAISY Lion server. Contact the project administrator to set this up.
  2. "Accept" all audio that the user has uploaded (audio_uploads.py is in lionapp/trunk/lion/daisylion/scripts):
     python audio_uploads.py LANG_ID accept
    
  3. Copy the audio files from the server and put them in SVN:
    1. log into the FTP for the Lion website and go to this directory:
      /srv/d_daisylion/www/www.example.net/htdocs/daisylionaudio
      
    2. You will see a list of directories, each representing a language ID. Download the directory for your LANG-ID.
    3. Make any necessary adjustments to the audio files (trim, amplify, convert to MP3, etc)
    4. Copy all audio files to the language pack directory:
      amis/trunk/langpacks/YOUR_LANG/audio
      
  4. Check that the user has completed all tasks (all .py scripts found in lionapp/trunk/lion/daisylion/scripts):
    1. This script will report missing audio files or items for which an audio file was never created:
      python check_audio.py LANG_ID amis/trunk/langpacks/YOUR_LANG/audio
      
    2. This script will see if any items are marked "TO-DO", in which case each item should be checked with the translator to ensure that they are finished with it.
      python get_todos.py LANG_ID
      
  5. Run the following script from daisylion/scripts/:
    python amis_export_all.py --langid=LANG_ID
    

Organizing

Prepare the RC file

  1. Open amis/trunk/langpacks/YOUR_LANG/AmisLangpack/AmisLangpack.rc in UltraEdit?
  2. Choose "File->Conversions->UTF-8 to Unicode" and save the file (use the same file name)

This step converts the file from UTF-8 to UTF-16 Little Endian with CR, LF. This step should be automated in the future; however, it is not as simple as it sounds.

Edit the module description file

  1. Open amis/trunk/langpacks/YOUR_LANG/moduleDesc.xml
  2. Replace the following text:
    • Change the language ID:
      <moduleDesc xmlns="http://amisproject.org" id="INSERT_LANGID" filename="./AmisLangpack.dll" type="langpack" enabled="yes">
      
      becomes
      
      <moduleDesc xmlns="http://amisproject.org" id="LANG_ID" filename="./AmisLangpack.dll" type="langpack" enabled="yes">
      
    • Change the name of the language:
<text>INSERT_LANGNAME</text>

becomes

<text>FORMAL_LANG_NAME</text>
  1. Save and close moduleDesc.xml
  2. Copy your flag icon into two places: amis/trunk/langpacks/YOUR_LANG/flag.ico and amis/trunk/langpacks/YOUR_LANG/AmisLangpack/flag.ico . Be sure it is named "flag.ico"
  3. Make an MP3 audio recording of the formal name of your language. Save the audio file as amis/trunk/langpacks/YOUR_LANG/thislang.mp3

Compiling

  1. Open amis/trunk/langpacks/YOUR_LANG/AmisLangpack/AmisLangpack.sln in Visual Studio 2005
  2. Right-click the project properties
  3. For the "Debug" configuration: under "Post-build", enter the following value for "Command line" (you should just have to change the LANG_ID and YOUR_LANG values):
    ..\..\..\amis\bin\copyLangpack.bat LANG_ID  ..\..\..\langpacks\YOUR_LANG debug
    
  1. For the "Release" configuration: under "Post-build", enter the following value for "Command line" (you should just have to change the LANG_ID and YOUR_LANG values):
    ..\..\..\amis\bin\copyLangpack.bat LANG_ID  ..\..\..\langpacks\YOUR_LANG release
    
  1. If you haven't already (as part of the AMIS build process), run amis/tags/amis31/bin/run_first_to_copy_settings.bat . This will copy the AMIS settings to your Windows application data directory.
  2. Build the AmisLangpack? project from Visual Studio 2005. All the files have now been compiled and copied to c:\documents and settings\all users\application data\AMIS\settings\lang\LANG_ID\ .
  3. Unzip amis/tags/amis31/bin.zip into amis/tags/amis31/bin/ . This will copy the files required for AMIS (exe, dlls) so that you don't have to build AMIS yourself.
  4. Verify that the language pack works by starting AMIS (amis/tags/amis31/bin/AMIS.exe) and changing the language setting in File->Preferences.

Making an installer

  1. Prepare the following:
  • HELP_TEXT_FILE = name of the text document in the DAISY-formatted Help book. Might be something like "amis.html".
  • LANG_ID = see above
  • FORMAL_LANG_NAME = see above. In this case, adjust to be only ASCII 0-9, a-z characters.
  • WORD_FOR_CONTRAST = If the language uses a Latin script, write the translation for the word "contrast", as in "color contrast". There is a list of words in amis/trunk/langpacks/words_for_contrast.txt. If there is no translation possible, use the english "contrast" instead.

  1. Edit amis/tags/amis31/installer/main/make-amis-installer-main.bat:
    Add this to the file, following the existing format:
    
     ELSE IF %LANGID%==LANG_ID (
    	echo "Building FORMAL_LANG_NAME"
    	call make-amis-installer.bat LANG_ID "FORMAL_LANG_NAME" HELP_TEXT_FILE WORD_FOR_CONTRAST
    	call setup-langpack.bat LANG_ID "FORMAL_LANG_NAME" HELP_TEXT_FILE
    ) 
    
  2. You should get two executables:
  • Setup-amis31-FORMAL_LANG_NAME.exe : A complete AMIS installer with your new language set as the default
  • Setup-amis31-langpack-FORMAL_LANG_NAME.exe : An add-on language pack for your language.
  1. Test and distribute!