Skip to content
bsag edited this page Jul 16, 2011 · 1 revision

Translating Tracks

Overview

Translating Tracks into another language is not very difficult and does not require you to be a developer

In general the steps are:

  • get a copy of tracks
    • either make a copy of your running tracks (to make sure you always have a working verions)
    • or get it from git using git clone git://github.com/TracksApp/tracks.git
  • create an empty locale file in /config/locales, i.e. touch /path/to/copy/of/tracks/config/locales/XX.yml
    • XX.yml is the locale file for your language where XX is the short name for your country like the following who are allready there: en (english) or de (german) or nl (dutch).
  • run Tracks in development mode: script/server -e development
    • this will run tracks on localhost on port 3000
    • this will require you to configure a database in config/databases.yml for the development environment. To be safe, use a copy of your database or make backups!
    • access it by pointing your webbrowser to http://localhost:3000
  • go to your preferences page and select your language as default
    • all pages should look wrong or fail. No worry!
  • point your browser to http://localhost:3000/translate
    • this is the translate plugin that will show you all strings that need to be translated
    • set the filter right: set your language by choosing “Translate from EN to XX” with XX being your language and choose Display
    • You can select “untranslated” to filter on untranslated strings
  • The “auto translage” link uses Google to translate the string. Very handy. Be aware though that it will translate parameters like %{count} too. Change this back or Tracks will fail
  • When you save the translations, it will write it to XX.yml in your config/locales directory

Some pages need to be translated manually:

  • app/views/integrations/index.en.html. Create an index.XX.html in this directory with XX being your language
  • Same goes for app/views/data/index.en.html and yaml_form.en.html

For the datepicker in the edit and new todo form, you need to add a translation file in public/javascripts/i18n. They can be found in http://jqueryui.com/demos/datepicker/#localization which references the following repository of translations: http://jquery-ui.googlecode.com/svn/trunk/ui/i18n/

Help and troubleshooting

  • you can switch languages by changing the url on every page
    • http://localhost:3000?locale=nl will switch to dutch.
    • if your page gives errors, first check with locale=en if the error is caused by your language changes. Remember that auto translate can mess up parameters, sometimes putting a space between $ and {param} and sometimes translating the name of the parameter!
    • see the i18n documentation for rails for more technical details http://guides.rubyonrails.org/i18n.html

Getting your changes into the next release

  • the easiest for the maintainer of Tracks is to create a clone of Tracks on github, merge your changes and issue a pull request.
    • make sure you only add your changes needed for the translation
  • or create a ticket on assembla with a patch with your changes
  • or upload the changed files to assembla in a ticket if creating a patch is not for you :-)

Clone this wiki locally