|Status:||Open||Start date:||23 Jan 2011|
|Assignee:||Andriy Lesyuk||% Done:||
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:
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...
: 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...
1response => [ 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:
1response => 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.