forked from TracksApp/tracks
-
Notifications
You must be signed in to change notification settings - Fork 0
Translating tracks
bsag edited this page Jul 16, 2011
·
1 revision
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.ymlis the locale file for your language whereXXis 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.ymlfor 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.ymlin yourconfig/localesdirectory
Some pages need to be translated manually:
-
app/views/integrations/index.en.html. Create anindex.XX.htmlin this directory withXXbeing your language - Same goes for
app/views/data/index.en.htmlandyaml_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/
- 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=enif 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
- 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 :-)