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

Translatiosn #53

Open
sanderha opened this issue Sep 5, 2016 · 3 comments
Open

Translatiosn #53

sanderha opened this issue Sep 5, 2016 · 3 comments

Comments

@sanderha
Copy link

sanderha commented Sep 5, 2016

I might be missing something but I was wondering how I can translate strings defined in JS? For example I need to translate the "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB." string. Is there any way to do this?

@unclecheese
Copy link
Owner

You're right. This isn't supported, and it should have been by now. :)

Keen to submit a PR? All we have to do is chuck some params into the dropzone config in getConfigJSON()

$data['dictInvalidFileType'] = _t('Dropzone.INVALID_FILE_TYPE','Invalid file type');
// etc...

Ensure that the fallback translations come straight from the JS file, so that nothing changes for English users.

@unclecheese
Copy link
Owner

@t-silvius
Copy link

For anyone trying to figure this out: it's already possible to add your custom translations (which are set in defaultOptions).

Just add them to your config.yml file, e.g.:
FileAttachmentField:
defaults:
dictDefaultMessage: "My custom translation goes here"

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

3 participants