Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS Locale File Support #178

Open
owlyowl opened this issue Jul 28, 2022 · 0 comments
Open

JS Locale File Support #178

owlyowl opened this issue Jul 28, 2022 · 0 comments

Comments

@owlyowl
Copy link

owlyowl commented Jul 28, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant