Quoting Konstantin Käfer <kkaefer@gmail.com>:
Are there existing math libraries that might help? Simple solution might be a SQL table that you add the exceptions to 'th' to. So the translation for 1 would contain 1st and the translation for 2 would 2nd and your 'th' default would be suffixed for everything else.
This doesn't work like you imagine it: Different language have completely different concepts of ordinal numbers. In some cases, they even depend on the genus (other languages have > 1 grammatical genus) of the word. In French for example, you say "mon 1er chat" (my 1st cat) but "ma 1ère souris" (my first mouse). In German, the short form of ordinal numbers is constructed by simply adding a dot to the number: "meine 1. Katze" and "meine 1. Maus".
The OP had said that 1st, 2nd, etc was English oriented. I gave an English oriented solution. My first opinion was to use the full English word, i.e. first, second, etc and avoid the need for the specialized translation. Yes, I am stupid when it comes to other language vernacular.
Different genera are already a problem with translation variables, for example, take the string: "Your %post has been created." where % post is a content type name. Now the problem is, that "Artikel" (= article) is masculine while "Umfrage" (= poll) is of female gender. You can't write "Der %post wurde erstellt." because "Der" is the masculine article while "Umfrage" would require "Die" instead of "Der".
I really appreciate those that are forced to learn English to communicate with the rest of the world. I do understand the difficulties and I am amazed at how much of the world is able to communicate with me. One of the best stories I have heard is one set of parents who knew 7 different languages and forced there children to speak a different language on the different days of the week. If we typical Americans had to actually learn and _use_ some other language to communicate with others we might be a better country. Earnie