When one is typing 1st the 'st' is transformed to super script. This was only done for english text. Then when typing 1er in a french text, nothing happened, but typing 1st in a french text was running as fine as for an english text. I wanted to fix that issue for a long time... and I finally took some time to do it when I learned that ICU could help me on that point.
To fix this bug, I changed the implementation of:
- the com.sun.star.i18n.OrdinalSuffix service to use ICU to get the localized prefix
- the SvxAutoCorrect::FnChgOrdinalNumber( ) method to make it use that service
I found out that the RuleBasedNumberFormat class from ICU4C was correctly providing the localized suffix only for english locale with the current version of ICU used by OOo (4.0.x). As this behaviour has been improved in ICU 4.2, I then have added the patch in the Experimental section of patches/dev300/apply. The patch can be found on the go-oo git repo:
There are several related issues upstream, but the main one is: i#20348. Even thought the patch doesn't implement Sun's specifications related to that issue, this is better than nothing...
Here is a screenshot of the autocorrection with that patch.
Screenshot of the new autocorrection for ordinal suffixes
I can start here a small list of what I know which could be improved, but this could certainly be extended:
- ICU formatting is providing only one suffix: there are cases where this suffix has be be changed according to the genre/number, eg: 1er can be also 1Ã¨re or 1ers or 1Ã¨res in french...
- ICU provides a default suffix for some locales which may have variations due to users habits, eg: 2e can also be written 2Ã¨me in french and it only depends on the local habits.