Mastering Redmine

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book project on this site and/or

Buy the book

By buying this book you will also be donating to Redmine (see this page).


Enhancement #1562

Localisation

Added by Andriy Lesyuk over 2 years ago. Updated about 2 years ago.

Status:Open Start:23 Jan 2011
Priority:Normal Due date:
Assigned to:Andriy Lesyuk % Done:

0%

Category:Core
Target version:2.00
Votes: 0

Description

The number of potential international users grows. There are several services in IF which can use Orangutan too. So the fact that it is only English can become a problem.

What should be internationalized:
  • Output messages;
  • Input regexp queries;
  • Holidays calculation.

The problem is that it is not so easy to localise program like Orangutan... Let’s review in details:

Output messages

Sample output message looks like this:

1 $message .= Orangutan::Context::Random(
2     'Be ready to receive emails now.',
3     'Emails are coming now... ;)',
4     'As you command...'
5 );

This should be replaced with something like:

1 $message .= $user->Localise('Be ready to receive emails now.');

Here "Be ready to receive emails now." is a "base" message which refers to an array of localised messages...

Note: String should be localised depending on user’s settings (on global ones if user’s settings are not set yet). That is user will choose the language.

Input regexp queries

It is perhaps the most complex part...

Sample request:

1 response => [
2     '^(?:Please )?((?:do(?:n\'t| not)|never|stop) )?notify(?:ing)?(?: me)? (?:by|using) e?-?mail(?: messages)?!*\.*$',
3     '^(?:I )?(do(?:n\'t| not) )?(?:want) to be notified (?:by|using) e?-?mail(?: messages)?!*\.*$',
4     '^(?:(Disable)|enable) (?:Redmine )?e?-?mail notifications!*\.*$',
5     '^Turn (?:on|(off)) (?:Redmine )?e?-?mail notifications!*\.*$'
6 ],

Should be something like:

1 response => Orangutan::Lozalise('^(?:Please )?((?:do(?:n\'t| not)|never|stop) )?notify(?:ing)?(?: me)? (?:by|using) e?-?mail(?: messages)?!*\.*$');

Again, here "^(?:Please )...(?: messages)?!*\.*$" is a base query which will be translated to localised ones (more than one).

Note: Unlike output messages input queries should be translated to queries using global settings. Besides it should be possible to define several languages for input queries. For example, for IF Orangutan should support ukrainian, english and russian. Anyway user’s settings (e.g. if user selected polish) can be taken into account too.

Holidays calculation

For holidays there should be special API allowing to extend Orangutan::Date.

Conclusion

Apparently we can’t use standard PO solution for Orangutan. At least because we need to support arrays etc. So own flexible solution is to be developed.

History

Updated by Andriy Lesyuk over 2 years ago

  • Target version set to 2.00

Updated by Andriy Lesyuk about 2 years ago

  • Tracker changed from Feature to Enhancement

Also available in: Atom PDF