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:
Sample output message looks like this:
$message .= Orangutan::Context::Random( 'Be ready to receive emails now.', 'Emails are coming now... ;)', 'As you command...' );
This should be replaced with something like:
$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...
: 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...
response => [ '^(?:Please )?((?:do(?:n\'t| not)|never|stop) )?notify(?:ing)?(?: me)? (?:by|using) e?-?mail(?: messages)?!*\.*$', '^(?:I )?(do(?:n\'t| not) )?(?:want) to be notified (?:by|using) e?-?mail(?: messages)?!*\.*$', '^(?:(Disable)|enable) (?:Redmine )?e?-?mail notifications!*\.*$', '^Turn (?:on|(off)) (?:Redmine )?e?-?mail notifications!*\.*$' ],
Should be something like:
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).
: 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.
For holidays there should be special API allowing to extend Orangutan::Date.
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.