vue-i18n-extract icon indicating copy to clipboard operation
vue-i18n-extract copied to clipboard

JS Locale File Support

Open owlyowl opened this issue 2 years ago • 0 comments

We're using .js files for our locale files so we can include date formatting functions in our locales e.g:

function formatDate(i18nContext, month) {
    return `${i18nContext.named('day') ? i18nContext.named('day') + '. ' : ''}${month}${i18nContext.named('year') ? ' ' + i18nContext.named('year') : ''}`;
}

export default {
    'January': (ctx) => formatDate(ctx, 'Januar'),
    'February': (ctx) => formatDate(ctx, 'Februar'),
    'March': (ctx) => formatDate(ctx, 'März'),
    'April': (ctx) => formatDate(ctx, 'April'),
    'May': (ctx) => formatDate(ctx, 'Mai'),
    'June': (ctx) => formatDate(ctx, 'Juni'),
    'July': (ctx) => formatDate(ctx, 'Juli'),
    'August': (ctx) => formatDate(ctx, 'August'),
    'September': (ctx) => formatDate(ctx, 'September'),
    'October': (ctx) => formatDate(ctx, 'Oktober'),
    'November': (ctx) => formatDate(ctx, 'November'),
    'December': (ctx) => formatDate(ctx, 'Dezember'),
    'Clear': 'Löschen'
};

I was wondering if there were plans to support the use of js locale files for reporting?

owlyowl avatar Jul 28 '22 04:07 owlyowl