marklogic - Russian translations for the month "May" -


in russian translation of english word month of may can 1 of 2 options. if 1 saying "the 31st of may" word may translated "Мая" , if 1 saying "may 2014" word may should translated "май" because no longer using "of may".

using marklogic's implementation of fn:format-date function cannot determine how can "май" version of may.

here function call:

fn:format-date(xs:date("2014-05-01"), "[mnn] [y]", 'ru')

is there way "май" version of may or format-date ever return "Мая"?

from can tell documentation picture format implementation dependent. may xquery has no way specify different version of month name.

marklogic uses library "icu" http://site.icu-project.org/ unicode , localization releated features. best library know of, not perfect means. library doesn't understand xquery patterns date display there complex work parse out xquery patterns use lower level api's related data. that, things day , date names more subtle in reality library , internal database can represent.

to better control need write or part of own date time formatter. can use parts work replace substitute parts dont. example use

let $d := xs:date("2014-05-01"),    $f := fn:format-date($d, "%%%%month%%%% [y]", 'ru') ,   $final := fn:replace( $f , "%%%%month%%%%" , my-own-month-formatter( $d ) ) 

where supply function my-own-month-formatter() returns right month name based on total date. functions extracting values date-time fields available in xquery functx module.

here example of customized date name translation function functx

http://www.xqueryfunctions.com/xq/functx_month-name-en.html


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -