Those are interesting enhancements. I don't think it would be hard at all to extend it to support injection of numbers or words. Simply have the map entry contain an additional element that ties itself to a position in a sequence of items passed and replace it appropriately.
To be honest, I have no idea how I would address singular/plural forms. It seems like that would have to be handled externally and the bundle would just need separate keys in a bundle for singular and plural forms. If you have any suggestions, I would love to here them. Unless, you were just suggesting, like the above, that you could inject a plural or singular form of a word into a longer string, which is probably what you meant now that I think about it. Thanks, Ryan Dew On Thu, Feb 21, 2013 at 4:00 AM, Florent Georges <[email protected]> wrote: > Ryan Dew wrote: > > Hi, > > > I'm sure it can be improved, but if you want to see an example > > of a library that makes use of map:map objects and server > > fields, like Mike mentioned, you can go here: > > https://github.com/ryanjdew/XQuery-i18n/blob/master/i18n.xqy > > Interesting. But if I am right, it only resolves strings given > two key: a name and a locale. But the tricky part is to inject > variable parts. For instance numbers (computed by the app), > adapting words with singular/plural forms, injecting additional > words (e.g. adjectives generally don't go to the same place in EN > and FR), etc. > > Did I miss anything? Or do you have any plan to support some > of those? > > Regards, > > -- > Florent Georges > http://fgeorges.org/ > http://h2oconsulting.be/ > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general >
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
